安装openstack踩的一个坑

简介:

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

1
2
3
[root@linux-node1 ~] # 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)

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[root@linux-node1 ~] # . demo-openrc 
[root@linux-node1 ~] # openstack keypair list
+-------+-------------------------------------------------+
| Name  | Fingerprint                                     |
+-------+-------------------------------------------------+
| mykey | 1f:48:e1:77:bb:ea:ea:c8:7b:08:39:b1:96:8d:48:28 |
+-------+-------------------------------------------------+
[root@linux-node1 ~] # 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      |
+----+-----------+-------+------+-----------+-------+-----------+
[root@linux-node1 ~] # openstack image list
+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| e2a8ac12-1a02-4f5b-bb7d-83064926ccbc | cirros | active |
+--------------------------------------+--------+--------+
You have new mail  in  /var/spool/mail/root
[root@linux-node1 ~] # openstack network list
+--------------------------------------+----------+--------------------------------------+
| ID                                   | Name     | Subnets                              |
+--------------------------------------+----------+--------------------------------------+
| 2d79dc77-be66-4850-af01-8e6946f16035 | provider | 270b8cca-c8bc-4413-a035-8ed9b77230b6 |
+--------------------------------------+----------+--------------------------------------+
[root@linux-node1 ~] #  openstack security group list
+--------------------------------------+---------+------------------------+-----------------------------
| ID                                   | Name    | Description            | Project                          |
+--------------------------------------+---------+------------------------+----------------------------------+
| eb33483e-827d-480c-8b08-776f1e3a1223 | default | Default security group | cb870d39c2f54546a3de1b64c758bb16 |
+--------------------------------------+---------+------------------------+----------------------------

查看错误日志信息:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[root@linux-node1 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配置,检查控制节点和计算节点,也没发现有啥异常

1
2
3
4
grep  'ERROR'  /var/log/nova/ *
grep  'ERROR'  /var/log/neutron/ *
grep  'ERROR'  /var/log/glance/ *
grep  'ERROR'  /var/log/keystone/ *

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

spacer.gifwKioL1jHnTzCSBW6AAATkSyN2tU976.png-wh_50

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@linux-node1 ~] # openstack server create --flavor m1.tiny --image cirros --nic net-id=2d79dc77-be66-4850-af01-8e6946f16035 --security-group default --key-name mykey provider-instance
[root@linux-node1 ~] # 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
查看发现云主机已经生效
[root@linux-node1 ~] # openstack server list
+--------------------------------------+-------------------+--------+----------------------+
| ID                                   | Name              | Status | Networks             |
+--------------------------------------+-------------------+--------+----------------------+
| 3ffb5d28-bfee-4562-bbb2-57d3956a8f0c | provider-instance | ACTIVE | provider=10.10.10.89 |
+--------------------------------------+-------------------+--------+----------------------+

在数据库中进行核对:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
[root@linux-node1 ~] # 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
在计算节点上进行比对:
[root@linux-node2 nova] # virsh list --all
  Id    Name                           State
----------------------------------------------------
  1     instance-00000001              running
  2     instance-00000002              running
[root@linux-node2 nova] # virsh domuuid instance-00000001
3ffb5d28-bfee-4562-bbb2-57d3956a8f0c
[root@linux-node2 nova] # virsh domuuid instance-00000002
55cbd36c-0308-4d9a-b43e-978680002abf

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










本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1906366,如需转载请自行联系原作者
目录
相关文章
|
IDE Linux KVM
云计算|OpenStack|社区版OpenStack---基本概念科普(kvm的驱动类别和安装)
云计算|OpenStack|社区版OpenStack---基本概念科普(kvm的驱动类别和安装)
542 0
|
存储 消息中间件 数据库
云计算|OpenStack|社区版OpenStack安装部署文档(八--- 存储服务cinder的安装部署---Rocky版)
云计算|OpenStack|社区版OpenStack安装部署文档(八--- 存储服务cinder的安装部署---Rocky版)
569 0
|
云计算 数据安全/隐私保护 虚拟化
云计算|OpenStack|社区版OpenStack安装部署文档(十一--- 如何获取镜像---Rocky版)
云计算|OpenStack|社区版OpenStack安装部署文档(十一--- 如何获取镜像---Rocky版)
703 0
|
存储 网络协议 Linux
如何安装OpenStack?
【8月更文挑战第21天】
1736 1
|
Linux 网络安全 API
云计算|OpenStack|社区版OpenStack安装部署文档(五 --- 计算服务nova安装部署---Rocky版)
云计算|OpenStack|社区版OpenStack安装部署文档(五 --- 计算服务nova安装部署---Rocky版)
766 0
|
云计算
云计算|OpenStack|社区版OpenStack安装部署文档(十--- 调整配额限制和解决建虚拟机报错---No valid host was found---Rocky版)
云计算|OpenStack|社区版OpenStack安装部署文档(十--- 调整配额限制和解决建虚拟机报错---No valid host was found---Rocky版)
651 0
|
弹性计算 Linux 网络安全
云计算|OpenStack|社区版OpenStack安装部署文档(九--- 创建一个虚拟机实例---Rocky版)
云计算|OpenStack|社区版OpenStack安装部署文档(九--- 创建一个虚拟机实例---Rocky版)
307 0
|
Linux API 数据库
云计算|OpenStack|社区版OpenStack安装部署文档(六 --- 网络服务neutron的安装部署---Rocky版)
云计算|OpenStack|社区版OpenStack安装部署文档(六 --- 网络服务neutron的安装部署---Rocky版)
521 0
|
存储 云计算 虚拟化
云计算|OpenStack|使用VMware安装华为云的R006版CNA和VRM---初步使用(二)
云计算|OpenStack|使用VMware安装华为云的R006版CNA和VRM---初步使用(二)
608 0
|
存储 虚拟化 数据安全/隐私保护
云计算|OpenStack|使用VMware安装华为云的R006版CNA和VRM---初始安装(一)
云计算|OpenStack|使用VMware安装华为云的R006版CNA和VRM---初始安装(一)
1301 0

热门文章

最新文章