Ironic nodes that have an existing instance will report negative available RAM after upgrading beyond this commit: https://github.com/openstack/nova/commit/b99fb0a51c658301188bbc729d1437a9c8b75d00
The node attached to the instance will not have instance_info[memory_mb], etc, set on the node object in Ironic. This code causes the driver to report memory_mb_used=memory_mb=0 if this info is unset. The resource tracker notices that an instance is on that node and sets memory_mb_used to X (the size of the instance). After which the node reports (-X) available memory.
This can wreak havoc on tools that look at total available memory. These could range from capacity reporting tools to scheduler/cells filters. If more than half of the capacity has instances, the total memory available will be negative, and could cause things to not schedule properly or generate alerts.
Reviewed: https:/ /review. openstack. org/230487 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=047da6498db b3af71bcb9e6d0e 2c38aa23b06615
Committed: https:/
Submitter: Jenkins
Branch: master
commit 047da6498dbb3af 71bcb9e6d0e2c38 aa23b06615
Author: Jim Rollenhagen <email address hidden>
Date: Thu Oct 1 21:12:53 2015 -0700
Ironic: Fix bad capacity reporting if instance_info is unset
If node.instance_info is unset for a node that has an instance on it
(for example, when upgrading Nova from before the patch that set these
values on spawn), the Ironic driver reports 0 for both $resource and
$resource_used. The resource tracker will correct $resource_used, and
resources available will be reported as a negative number.
Correct this by reporting the original value if instance_info is unset.
Closes-Bug: #1502177 cd0ee2f24cd9530 4660ccf11eb
Change-Id: I13c5e5430fd305