安装openstack踩的一个坑

Openstack Mitaka在图形化界面的时候出现以下报错:

[[email protected] ~]# openstack server create --flavor m1.tiny --image cirros --nic net-id=2d79dc77-be66-4850-af01-8e6946f16035 --security-group default --key-name mykey provider-instance
Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class ‘neutronclient.common.exceptions.Unauthorized‘> (HTTP 500) (Request-ID: req-1d4cf44f-8b06-43e0-8392-25296b29eecb)

查了下网上资料,各种奇葩版本都有,但是对我的这个问题没有任何效果,核查下配置文件:

[[email protected] ~]# . demo-openrc 
[[email protected] ~]# openstack keypair list
+-------+-------------------------------------------------+
| Name  | Fingerprint                                     |
+-------+-------------------------------------------------+
| mykey | 1f:48:e1:77:bb:ea:ea:c8:7b:08:39:b1:96:8d:48:28 |
+-------+-------------------------------------------------+
[[email protected] ~]# openstack flavor list
+----+-----------+-------+------+-----------+-------+-----------+
| ID | Name      |   RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+-----------+-------+------+-----------+-------+-----------+
| 0  | m1.nano   |    64 |    1 |         0 |     1 | True      |
| 1  | m1.tiny   |   512 |    1 |         0 |     1 | True      |
| 2  | m1.small  |  2048 |   20 |         0 |     1 | True      |
| 3  | m1.medium |  4096 |   40 |         0 |     2 | True      |
| 4  | m1.large  |  8192 |   80 |         0 |     4 | True      |
| 5  | m1.xlarge | 16384 |  160 |         0 |     8 | True      |
+----+-----------+-------+------+-----------+-------+-----------+
[[email protected] ~]# openstack image list
+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| e2a8ac12-1a02-4f5b-bb7d-83064926ccbc | cirros | active |
+--------------------------------------+--------+--------+
You have new mail in /var/spool/mail/root
[[email protected] ~]# openstack network list
+--------------------------------------+----------+--------------------------------------+
| ID                                   | Name     | Subnets                              |
+--------------------------------------+----------+--------------------------------------+
| 2d79dc77-be66-4850-af01-8e6946f16035 | provider | 270b8cca-c8bc-4413-a035-8ed9b77230b6 |
+--------------------------------------+----------+--------------------------------------+
[[email protected] ~]#  openstack security group list
+--------------------------------------+---------+------------------------+-----------------------------
| ID                                   | Name    | Description            | Project                          |
+--------------------------------------+---------+------------------------+----------------------------------+
| eb33483e-827d-480c-8b08-776f1e3a1223 | default | Default security group | cb870d39c2f54546a3de1b64c758bb16 |
+--------------------------------------+---------+------------------------+----------------------------

查看错误日志信息:

[[email protected] nova]# grep ERROR nova-api.log |tail -30
2017-03-14 12:52:38.675 5035 ERROR nova.api.openstack.extensions Unauthorized: Unknown auth type: None
2017-03-14 12:52:38.675 5035 ERROR nova.api.openstack.extensions 
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions [req-1d4cf44f-8b06-43e0-8392-25296b29eecb d02c78a51a72449589c8b63b51fb1c0d cb870d39c2f54546a3de1b64c758bb16 - - -] Unexpected exception in API method
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions Traceback (most recent call last):
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/api/openstack/extensions.py", line 478, in wrapped
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     return f(*args, **kwargs)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 73, in wrapper
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     return func(*args, **kwargs)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 73, in wrapper
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     return func(*args, **kwargs)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 73, in wrapper
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     return func(*args, **kwargs)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/servers.py", line 629, in create
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     **create_kwargs)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/hooks.py", line 154, in inner
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     rv = f(*args, **kwargs)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 1563, in create
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     check_server_group_quota=check_server_group_quota)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 1146, in _create_instance
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     reservation_id, max_count)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 873, in _validate_and_build_base_options
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     pci_request_info, requested_networks)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 1081, in create_pci_requests_for_sriov_ports
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     neutron = get_client(context, admin=True)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 141, in get_client
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     _ADMIN_AUTH = _load_auth_plugin(CONF)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions   File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 122, in _load_auth_plugin
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions     raise neutron_client_exc.Unauthorized(message=err_msg)
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions Unauthorized: Unknown auth type: None
2017-03-14 12:58:11.089 5035 ERROR nova.api.openstack.extensions

按照报错提示,检查我的nova配置,检查控制节点和计算节点,也没发现有啥异常

grep ‘ERROR‘ /var/log/nova/*
grep ‘ERROR‘ /var/log/neutron/*
grep ‘ERROR‘ /var/log/glance/*
grep ‘ERROR‘ /var/log/keystone/*

后来排查发现(自己在编辑neutron的时候,忘记添加rpc_backend = rabbit):

在计算节点后控制节点都添加后,重启neutron相关服务,然后再次执行创建云主机的操作

[[email protected] ~]# openstack server create --flavor m1.tiny --image cirros --nic net-id=2d79dc77-be66-4850-af01-8e6946f16035 --security-group default --key-name mykey provider-instance
[[email protected] ~]# openstack network list
+--------------------------------------+----------+--------------------------------------+
| ID                                   | Name     | Subnets                              |
+--------------------------------------+----------+--------------------------------------+
| 2d79dc77-be66-4850-af01-8e6946f16035 | provider | 270b8cca-c8bc-4413-a035-8ed9b77230b6 |
+--------------------------------------+----------+--------------------------------------+
You have new mail in /var/spool/mail/root
查看发现云主机已经生效
[[email protected] ~]# openstack server list
+--------------------------------------+-------------------+--------+----------------------+
| ID                                   | Name              | Status | Networks             |
+--------------------------------------+-------------------+--------+----------------------+
| 3ffb5d28-bfee-4562-bbb2-57d3956a8f0c | provider-instance | ACTIVE | provider=10.10.10.89 |
+--------------------------------------+-------------------+--------+----------------------+

在数据库中进行核对:

[[email protected] ~]# mysql -unova -p
Enter password: 
MariaDB [(none)]> use nova;
MariaDB [nova]> show tables;
+--------------------------------------------+
| Tables_in_nova                             |
+--------------------------------------------+
| agent_builds                               |
| aggregate_hosts                            |
| aggregate_metadata                         |
| aggregates                                 |
| allocations                                |
| block_device_mapping                       |
| bw_usage_cache                             |
| cells                                      |
| certificates                               |
| compute_nodes                              |
| console_pools                              |
| consoles                                   |
| dns_domains                                |
| fixed_ips                                  |
| floating_ips                               |
| instance_actions                           |
| instance_actions_events                    |
| instance_extra                             |
| instance_faults                            |
| instance_group_member                      |
| instance_group_policy                      |
| instance_groups                            |
| instance_id_mappings                       |
| instance_info_caches                       |
| instance_metadata                          |
| instance_system_metadata                   |
| instance_type_extra_specs                  |
| instance_type_projects                     |
| instance_types                             |
| instances                                  |
| inventories                                |
| key_pairs                                  |
| migrate_version                            |
| migrations                                 |
| networks                                   |
| pci_devices                                |
| project_user_quotas                        |
| provider_fw_rules                          |
| quota_classes                              |
| quota_usages                               |
| quotas                                     |
| reservations                               |
| resource_provider_aggregates               |
| resource_providers                         |
| s3_images                                  |
| security_group_default_rules               |
| security_group_instance_association        |
| security_group_rules                       |
| security_groups                            |
| services                                   |
| shadow_agent_builds                        |
| shadow_aggregate_hosts                     |
| shadow_aggregate_metadata                  |
| shadow_aggregates                          |
| shadow_block_device_mapping                |
| shadow_bw_usage_cache                      |
| shadow_cells                               |
| shadow_certificates                        |
| shadow_compute_nodes                       |
| shadow_console_pools                       |
| shadow_consoles                            |
| shadow_dns_domains                         |
| shadow_fixed_ips                           |
| shadow_floating_ips                        |
| shadow_instance_actions                    |
| shadow_instance_actions_events             |
| shadow_instance_extra                      |
| shadow_instance_faults                     |
| shadow_instance_group_member               |
| shadow_instance_group_policy               |
| shadow_instance_groups                     |
| shadow_instance_id_mappings                |
| shadow_instance_info_caches                |
| shadow_instance_metadata                   |
| shadow_instance_system_metadata            |
| shadow_instance_type_extra_specs           |
| shadow_instance_type_projects              |
| shadow_instance_types                      |
| shadow_instances                           |
| shadow_key_pairs                           |
| shadow_migrate_version                     |
| shadow_migrations                          |
| shadow_networks                            |
| shadow_pci_devices                         |
| shadow_project_user_quotas                 |
| shadow_provider_fw_rules                   |
| shadow_quota_classes                       |
| shadow_quota_usages                        |
| shadow_quotas                              |
| shadow_reservations                        |
| shadow_s3_images                           |
| shadow_security_group_default_rules        |
| shadow_security_group_instance_association |
| shadow_security_group_rules                |
| shadow_security_groups                     |
| shadow_services                            |
| shadow_snapshot_id_mappings                |
| shadow_snapshots                           |
| shadow_task_log                            |
| shadow_virtual_interfaces                  |
| shadow_volume_id_mappings                  |
| shadow_volume_usage_cache                  |
| snapshot_id_mappings                       |
| snapshots                                  |
| tags                                       |
| task_log                                   |
| virtual_interfaces                         |
| volume_id_mappings                         |
| volume_usage_cache                         |
+--------------------------------------------+
109 rows in set (0.02 sec)
MariaDB [nova]> select uuid from instances \G;
*************************** 1. row ***************************
uuid: 3ffb5d28-bfee-4562-bbb2-57d3956a8f0c
*************************** 2. row ***************************
uuid: 55cbd36c-0308-4d9a-b43e-978680002abf
2 rows in set (0.01 sec)
ERROR: No query specified
在计算节点上进行比对:
[[email protected] nova]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     instance-00000001              running
 2     instance-00000002              running
[[email protected] nova]# virsh domuuid instance-00000001
3ffb5d28-bfee-4562-bbb2-57d3956a8f0c
[[email protected] nova]# virsh domuuid instance-00000002
55cbd36c-0308-4d9a-b43e-978680002abf

到此,问题得到解决,OpenStack的配置是个细心活,需要明白它的各个组件的关联,这样排除故障的时候会有的放矢。

时间: 2024-12-16 18:59:26

安装openstack踩的一个坑的相关文章

使用ffmpeg视频编码过程中踩的一个坑

今天说说使用ffmpeg在写视频编码程序中踩的一个坑,这个坑让我花了好多时间,回头想想,很多时候一旦思维定势真的挺难突破的.下面是不正确的编码结果: 使用ffmpeg做视频编码过程中,首先要新建数据帧,并为数据帧分配相应内存,以便于保存图像数据,为数据帧分配内存需要用到av_image_alloc()这个函数,该函数将根据传入的图像宽.高.图像格式.数据对齐基数等参数进行内存分配. 这其中有一个参数可能会让人迷惑,那就是数据对齐基数这个参数该设置多少?顺便说说为什么要数据对齐,之所以要对齐,主要

1.MySQL5.7.19 安装配置踩过的坑

这篇文章主要是分享 安装MySQL时遇到的一些问题,以及解决方法. 第一步:下载MySQL 下载地址:https://dev.mysql.com/downloads/mysql/5.1.html#downloads 我下载的是5.7.19版本,下载地址里面也只有解压版,下载后再进行环境变量的配置就可以. 2.解压并安装Mysql5.7.19 (1)将下载的包解压到指定的路径,自己可以指定路径,我直接解压到了D盘,解压到了                         D:\mysq的目录下.则

最近用Timer踩了一个坑,分享一下避免别人继续踩

最近做一个小项目,项目中有一个定时服务,需要向对方定时发送数据,时间间隔是1.5s,然后就想到了用C#的Timer类,我们知道Timer 确实非常好用,因为里面有非常人性化的start和stop功能,在Timer里面还有一个Interval,就是用来设置时间间隔,然后时间间隔到了就会触 发Elapsed事件,我们只需要把callback函数注册到这个事件就可以了,如果Interval到了就会触发Elapsed,貌似一切看起来很顺其自然,但是 有一点一定要注意,callback函数本身执行也是需要

Javascript之旅——第八站:说说instanceof踩了一个坑

前些天写js遇到了一个instanceof的坑,我们的页面中有一个iframe,我在index页面中计算得到了一个array,然后需要传递到Flight页面 这个嵌套的iframe中的一个函数(SearchFlight)中,作为防御性编程,我需要在SearchFlight函数中进行参数检测,也就是判断过来的参数一 定是Array类型. 一:抛出问题 举个例子,下面有两个页面. Index.html页面 1 <!DOCTYPE html> 2 <html xmlns="http:

安装tensorflow踩的那些坑

折腾了三四天,终于是把tensorflow安装上了,记录下安扎ungzhongyudao的各种问题 主要参考: 官网:https://www.tensorflow.org/ 极客学院中文翻译:http://wiki.jikexueyuan.com/project/tensorflow-zh/ 电脑配置ASUS FX50飞行堡垒 系统:win10 cpu:intel i5-4200H 内存:8G 显卡:nvidia GTX950m 4g显存 ============================

linux 下在安装redis 踩过的坑

第一步: tar -zxvf redis-4.0.10.tar.gz 第二部: cd redis-4.0.10  目录 执行 make 编译   结果报错: 原因:  需要依赖三个包 解决: 依次安装 : yum install gcc yum install gcc-c++ yum install tcl 安装完之后make 又报错 解决办法:执行 make MALLOC=libc    完美解决问题 具体可参考:https://blog.csdn.net/libraryhu/article/

安装Postgresql踩过的坑

PG安装相关的 1  系统语言的设置 PG的安装,和系统的locale设置有一定的关系,需要设置,如在.profile或.bashrc中 也可以运行下面的命令: dpkg-reconfigure locales 2 一次安装失败时,会有冲突失败,这时需要在/var/lib/dpkg/info进行相应的处理,如把它删除了还是备份啥的 3 在运行下面命令时: sudo  service  postgresql start 需要先运行sudo  pg_createcluster 9.X  main -

java 反射的踩的一个坑

今天工作的时候用到了一个反射.其业务简单描述为:系统启动时将需要定时调用的方法签名保存到数据库中,开启线程定时从数据库中读取对应的方法签名,通过反射生成实例后调用方法.完成一定的定时任务. 写到的方法签名如下 public Class A{ public void  statistics( Member member, boolean flag )   // 这么写是错的. } 调用  A.class().getMethod("statistics", Member.class, Bo

Mac 下安装wxpython踩过的坑

一.下载 1.wxpython 下载地址:https://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/ 指定版本下载 二.安装 1.双击解压 2.进入以下页面 (1)双击.pkg,进行安装,若提示异常,无法安装,则转到第二步 (2)点击安装包,右键选择:显示包内容 (3)打开Contents/Resources (4)双击解压文件:.pax.gz (5)将解压文件lib复制到 系统 /usr/local中,再将postfli