Fix reporting inventory for provisioned nodes in the Ironic driver
Currently we report the full inventory for available nodes, and an empty
inventory for nodes that are deployed to or otherwise unavailable.
Reporting an empty inventory for deployed nodes has 2 bad consequences:
1. Nova tries deleting the inventory for Placement, which fails, because
the resources are still in use. This results in nasty warnings.
2. When adding a resource class to a deployed node, it does not get into
inventory, and thus does not get to Placement. It results in an error
later on, when the custom resource class is not found.
This patch fixes the latter problem by
1. Always reporting the custom resource class for deployed nodes, if present.
2. Reporting VCPUS/memory/disk in exactly the same amount, as it is configured
in the ironic node's properties.
As a side effect, the warnings are no longer shown for deployed nodes.
They still appear, however, for nodes during cleaning.
Partial-Bug: #1710141
Change-Id: I2fd1e4a95f000da19864e75299afa51527697101
(cherry picked from commit 9ed692bf8c84e0a702536101cd6cb084d33e1c26)
Reviewed: https:/ /review. openstack. org/494216 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=c92337bdf80 fea4c0a8ebb433b acec4cc07f7a94
Committed: https:/
Submitter: Jenkins
Branch: stable/pike
commit c92337bdf80fea4 c0a8ebb433bacec 4cc07f7a94
Author: Dmitry Tantsur <email address hidden>
Date: Fri Aug 11 13:52:02 2017 +0200
Fix reporting inventory for provisioned nodes in the Ironic driver
Currently we report the full inventory for available nodes, and an empty
inventory for nodes that are deployed to or otherwise unavailable.
Reporting an empty inventory for deployed nodes has 2 bad consequences:
1. Nova tries deleting the inventory for Placement, which fails, because
the resources are still in use. This results in nasty warnings.
2. When adding a resource class to a deployed node, it does not get into
inventory, and thus does not get to Placement. It results in an error
later on, when the custom resource class is not found.
This patch fixes the latter problem by
1. Always reporting the custom resource class for deployed nodes, if present.
2. Reporting VCPUS/memory/disk in exactly the same amount, as it is configured
in the ironic node's properties.
As a side effect, the warnings are no longer shown for deployed nodes.
They still appear, however, for nodes during cleaning.
Partial-Bug: #1710141 a19864e75299afa 51527697101 702536101cd6cb0 84d33e1c26)
Change-Id: I2fd1e4a95f000d
(cherry picked from commit 9ed692bf8c84e0a