问题

在部署openstack 时,在控制台上收到以下错误消息

2015-08-14 06:42:59Z [overcloud.Controller.0.Controller]: CREATE_FAILED  ResourceInError: resources.Controller: Went to status ERROR due to "Message: No valid host was found. There are not enough hosts available., Code: 500"
2015-08-14 06:42:59Z [overcloud.Controller.0]: CREATE_FAILED  Resource CREATE failed: ResourceInError: resources.Controller: Went to status ERROR due to "Message: No valid host was found. There are not enough hosts available., Code: 500"
2015-08-14 06:42:59Z [overcloud.Controller.0]: CREATE_FAILED  ResourceInError: resources[0].resources.Controller: Went to status ERROR due to "Message: No valid host was found. There are not enough hosts available., Code: 500"
2015-08-14 06:42:59Z [overcloud.Controller]: CREATE_FAILED  Resource CREATE failed: ResourceInError: resources[0].resources.Controller: Went to status ERROR due to "Message: No valid host was found. There are not enough hosts available., Code: 500"
2015-08-14 06:42:59Z [overcloud.Controller]: CREATE_FAILED  ResourceInError: resources.Controller.resources[0].resources.Controller: Went to status ERROR due to "Message: No valid host was found. There are not enough hosts available., Code: 500"
2015-08-14 06:43:00Z [overcloud]: CREATE_FAILED  Resource CREATE failed: ResourceInError: resources.Controller.resources[0].resources.Controller: Went to status ERROR due to "Message: No valid host was found. There are not enough hosts available., Code: 500"

在 nova-conductor.log 中,我们可能会发现以下消息

nova-conductor.log:2015-08-12 22:50:24.855 11372 WARNING nova.scheduler.utils [req-1bcec69e-4ad1-4460-bdd0-506e701dd81b a557b3e88e20446d921adbea6667e9ec d7f4df43c5db41f08572f582344b4e6f - - -] Failed to compute_task_build_instances: No valid host was found. There are not enough hosts available.
nova-conductor.log:2015-08-12 22:50:26.995 11373 WARNING nova.scheduler.utils [req-0070ba9f-5eed-441d-a762-16bb9eaf9e8a a557b3e88e20446d921adbea6667e9ec d7f4df43c5db41f08572f582344b4e6f - - -] Failed to compute_task_build_instances: No valid host was found. There are not enough hosts available.

在 nova-scheduler.log 中,可能会出现以下消息

nova-scheduler.log:2015-08-13 16:22:48.035 1475 INFO nova.filters [req-291df51f-aac0-42dc-bc72-84dfdb3e4a0c a557b3e88e20446d921adbea6667e9ec d7f4df43c5db41f085744b4e6f - - -] Filtering removed all hosts for the request with instance ID 'f6ec9c8e-4dd9-4995-92b7-b570bb06790f'. Filter results: ['RetryFilter: (start: 3, en, 'TripleOCapabilitiesFilter: (start: 3, end: 3)', 'ComputeCapabilitiesFilter: (start: 3, end: 1)', 'AvailabilityZoneFilter: (start: 1, end: 1)', 'RamFilter: (s1, end: 1)', 'DiskFilter: (start: 1, end: 0)']

分析与解决方法

情况1

确保有足够多的节点处于可用状态、未处于维护模式且未被现有实例使用。

[stack@undercloud-director ~]$openstack baremetal node list
+--------------------------------------+---------------------------+---------------+-------------+--------------------+-------------+
| UUID                                 | Name                      | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+---------------------------+---------------+-------------+--------------------+-------------+
| 8ef9b862-9a4f-4961-813c-4b81be7c8e48 | overcloud-controller      | None          | power off   | available          | False       |
| 7995f1f2-4af7-4c5d-9099-fc928c4c73b3 | overcloud-compute.example | None          | power off   | available          | False       |
| 7c84cdf2-c5b2-47fb-a741-30c025b54183 | overcloud-ceph.example    | None          | power off   | available          | False       |
+--------------------------------------+---------------------------+---------------+-------------+--------------------+-------------+

情况2

确保 undercloud 能够使用电源凭证(例如 ipmi_address、ipmi_username 和 ipmi_password)连接到 overcloud 管理程序

[stack@undercloud-director ~]$ipmitool -I lanplus -H 10.43.138.12 -L ADMINISTRATOR -p 6320 -U admin -R 3 -N 5 -P redhat power status
Chassis Power is off
[stack@undercloud-director ~]$ipmitool -I lanplus -H 10.43.138.12 -L ADMINISTRATOR -p 6321 -U admin -R 3 -N 5 -P redhat power status
Chassis Power is off
[stack@undercloud-director ~]$ipmitool -I lanplus -H 10.43.138.12 -L ADMINISTRATOR -p 6320 -U admin -R 3 -N 5 -P redhat power status
Chassis Power is off

多次观察到 ipmitool 无法连接到管理程序,因此在 overcloud 部署期间添加节点功能中断

情况3

确保我们运行并启用了计算服务:

[stack@undercloud-director ~]$openstack compute service list --service nova-compute
+----+--------------+-----------------------------+------+---------+-------+----------------------------+
| ID | Binary       | Host                        | Zone | Status  | State | Updated At                 |
+----+--------------+-----------------------------+------+---------+-------+----------------------------+
|  4 | nova-compute | undercloud-director.example | nova | enabled | up    | 2015-08-14T12:51:23.000000 |
+----+--------------+-----------------------------+------+---------+-------+----------------------------+

默认情况下,计算服务在连续 10 次构建失败后被禁用。
这是为了确保新的构建请求不会路由到损坏的 Compute 服务。
如果是这种情况,请确保修复故障源,然后重新启用它:

$openstack compute service set --enable <COMPUTE HOST> nova-compute

情况3:(最有可能)

确保节点的属性与指定风味的属性字段完全匹配。
节点的属性在自省阶段填充

例如我节点的属性

[stack@undercloud-director ~]$openstack baremetal node show ece1651a-6adc-4826-9f77-5d47891c6c9b -c properties
+------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                           |
+------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| properties | {u'memory_mb': u'10240', u'cpu_arch': u'x86_64', u'local_gb': u'49', u'cpus': u'4', u'capabilities':                                            |
|            | u'profile:control,cpu_aes:true,cpu_hugepages:true,boot_option:local'}                                                                           |
+------------+-------------------------------------------------------------------------------------------------------------------------------------------------+

该节点被分配给“控制”配置文件突出显示,因此请检查“控制”风味的属性

[stack@undercloud-director ~]$openstack flavor show control -c properties -f value
capabilities:boot_option='local', capabilities:cpu_aes='true', capabilities:cpu_hugepages='true', capabilities:profile='control', cpu_arch='x86_64'

如我们所见,这两个属性字段完全匹配。

如何更新“节点”的属性内容?

我们可以手动更新节点的属性内容,但我不建议这样做,因为自省会自动填充这些内容。
我们应该修改风味属性以匹配节点的内容。
但是我们仍然可以使用以下命令更新节点的属性

$ironic node-update overcloud-controller.example add properties/capabilities='profile:control,cpu_aes:true,cpu_hugepages:true,boot_option:local'
openstack NoValidHost: No valid host was found. There are not enough hosts available

如何更新flavor的属性字段?

要更新风味的属性部分,请使用以下命令

$openstack flavor set --property "capabilities:profile"="control"  --property "capabilities:cpu_aes"="true"  --property "capabilities:cpu_hugepages"="true" --property "capabilities:boot_option"="local" control

按照以下链接获取更多可以使用的选项
https://docs.openstack.org/ironic/latest/install/configure-nova-flavors.html

可以有更多的可能性,这些是我在测试阶段遇到的少数。
如果以上没有,那么有关我们可以查看以下日志文件的更多信息

/var/log/ironic/*
/var/log/nova/*
日期:2020-06-02 22:16:59 来源:oir作者:oir