<div dir="ltr">Hi all!<div><br></div><div>There is a long standing problem of resources reporting in ironic virt driver. It's described in a couple of bugs I've found - [0], [1]. Switching to placement API will make things better, but still there are some problems there. For example, there are cases when ironic needs to say "this node is not available", and it reports the vcpus=memory_mb=local_gb as 0 in this case. Placement API does not allow 0s, so in [2] it is proposed to remove inventory records in this case.</div><div><br></div><div>But the whole logic here [3] seems not that obvious to me, so I'd like to discuss when do we need to report 0s to placement API. I'm thinking about the following (copy-pasted from my comment on [2]):</div><div><br></div><div><div><ul><li>If there is an instance_uuid on the node, no matter what provision/power state it's in, consider the resources as used. In case it's an orphan, an admin will need to take some manual action anyway.</li><li>If there is no instance_uuid and a node is in cleaning/clean wait after tear down, it is a part of normal node lifecycle, report all resources as used. This means we need a way to determine if it's a manual or automated clean.</li><li>If there is no instance_uuid, and a node:</li><ul><li>has a bad power state or</li><li>is in maintenance</li><li>or actually in any other case, consider it unavailable, report available resources = used resources = 0. Provision state does not matter in this logic, all cases that we wanted to take into account are described in the first two bullets.</li></ul></ul><div><br></div></div></div><div><div>Any thoughts?<br></div><div><br></div><div>[0]. <a href="https://bugs.launchpad.net/nova/+bug/1402658">https://bugs.launchpad.net/nova/+bug/1402658</a></div><div>[1]. <a href="https://bugs.launchpad.net/nova/+bug/1637449">https://bugs.launchpad.net/nova/+bug/1637449</a></div><div>[2]. <a href="https://review.openstack.org/414214">https://review.openstack.org/414214</a></div><div>[3]. <a href="https://github.com/openstack/nova/blob/1506c36b4446f6ba1487a2d68e4b23cb3fca44cb/nova/virt/ironic/driver.py#L262">https://github.com/openstack/nova/blob/1506c36b4446f6ba1487a2d68e4b23cb3fca44cb/nova/virt/ironic/driver.py#L262</a></div></div><div><br></div><div>Happy holidays to everyone!</div><div>-Vlad</div></div>