在控制节点创建实例时,遇到以下错误。首先确保命令格式正确。
[root@controller ~]# openstack server create --flavor 0f29be3e-089d-4339-88c1-28b4edf3778b --image df4a76af-1dad-43cc-95c5-6700fee1374d --network 3b92a5e0-db76-4207-82eb-c8d6c392bb1c --block-device uuid=906ff027-3fe1-4d6e-a0f0-aeaaa4b46985 --wait test-server
Error creating server: test-server
Error creating server
打开/var/log/nova/nova-conductor.log日志,查看报错情况。
WARNING nova.scheduler.utils [req-2ef18f53-7d27-42e7-a367-059ab7f2bfcd ba89422fdc8b4202bbe1fca7a9c358b0 f0be814d573449b2aa0c20178d14195e- default default] [instance: 70222c6a-eb6b-4327-af37-36b4d071d2d7] Setting instance to ERROR state.: MaxRetriesExceeded: 超过最大尝试次数。Exhausted all hosts available for retrying build failures for instance 70222c6a-eb6b-4327-af37-36b4d071d2d7.
看网上的方案是需要查看计算节点的neutron的 cat /var/log/neutron/linuxbridge-agent.log 文件。
报的错误如下:
[root@compute ~]# cat /var/log/neutron/linuxbridge-agent.log
2022-02-22 19:05:03.674 8023 ERROR neutron % (opt.name, str(ve)))
2022-02-22 19:05:03.674 8023 ERROR neutron ConfigFileValueError: Value for option l ocal_ip is not valid: OVERLAY_INTERFACE_IP_ADDRESS is not IPv4 or IPv6 address
2022-02-22 19:05:03.674 8023 ERROR neutron
看上去应该是有一个地方的IP地址没配置正确,我在计算节点上,终于找到了这个配置文件。
[root@compute neutron]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
将:
[vxlan]
enable_vxlan = true
local_ip = OVERLAY_INTERFACE_IP_ADDRESS
l2_population = true改为
[vxlan]
enable_vxlan = true
local_ip = 192.168.100.102
l2_population = true
重回控制节点,运行创建实例命令后成功。
[root@controller nova]# openstack server create --flavor 0f29be3e-089d-4339-88c1-28b4edf3778b --image df4a76af-1dad-43cc-95c5-6700fee1374d --network 3b92a5e0-db76-4207-82eb-c8d6c392bb1c --block-device uuid=906ff027-3fe1-4d6e-a0f0-aeaaa4b46985 --wait test-server
+-------------------------------------+----------------------------------------------------------+
| Field | Value |
+-------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | compute |
| OS-EXT-SRV-ATTR:hypervisor_hostname | compute |
| OS-EXT-SRV-ATTR:instance_name | instance-00000008 |
| OS-EXT-STS:power_state | Running |
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | active |
| OS-SRV-USG:launched_at | 2022-02-22T11:16:29.000000 |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | public=172.16.175.105 |
| adminPass | GpYVx3fBCYh8 |
| config_drive | |
| created | 2022-02-22T11:16:15Z |
| flavor | m1.tiny (0f29be3e-089d-4339-88c1-28b4edf3778b) |
| hostId | e07c8abe1164a36eafc939bed7256486e4e2bea6c685b9337d4ce165 |
| id | 0b2c2aa6-d3a9-4618-8d39-c7ce1d745a02 |
| image | cirros (df4a76af-1dad-43cc-95c5-6700fee1374d) |
| key_name | None |
| name | test-server |
| progress | 0 |
| project_id | f0be814d573449b2aa0c20178d14195e |
| properties | |
| security_groups | name='default' |
| status | ACTIVE |
| updated | 2022-02-22T11:16:29Z |
| user_id | ba89422fdc8b4202bbe1fca7a9c358b0 |
| volumes_attached | id='906ff027-3fe1-4d6e-a0f0-aeaaa4b46985' |
+-------------------------------------+----------------------------------------------------------+