<div dir="ltr"><div dir="ltr">On Wed, Dec 4, 2019 at 2:55 PM Dmitry Tantsur <<a href="mailto:dtantsur@redhat.com">dtantsur@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 4, 2019 at 7:58 PM Matt Riedemann <<a href="mailto:mriedemos@gmail.com" target="_blank">mriedemos@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The 1.50 microversion [1] in the ironic API added the "owner" field to <br>
the node and I'm trying to use that to add some scheduler filtering in <br>
nova [2]. It's my understanding that the owner field on a provisioned <br>
node (instance_uuid on the node is set) can be changed, but I'm <br>
surprised that is allowed. Was that an oversight in developing that feature?<br></blockquote><div><br></div><div>I think so.. we have also uncovered it while discussing <a href="https://review.opendev.org/#/c/696707/" target="_blank">https://review.opendev.org/#/c/696707/</a> which can make this issue worse.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The use case for the scheduler filter is baremetal nodes are owned by <br>
different (non-admin) projects in a deployment. When a non-admin project <br>
creates a baremetal server via nova, nova will filter out nodes that are <br>
not owned by the project (based on the node.owner field). If a node <br>
isn't owned by any project, only admins can use it. Admins also have <br>
access to all nodes regardless of owner.<br>
<br>
Given that, let's say user 1 from project A creates a server on nova X <br>
that is owned by project A (node.owner=A). Then the node.owner is <br>
changed to project B. What should happen? Should nova detect that <br>
ownership change and stop the node or something?<br>
<br>
Note that with other resources that can transfer ownership, like <br>
volumes, that can only be done when they aren't in use. So why don't we <br>
have the same rules for nodes?<br>
<br>
Assuming we do want to enforce this in the API (a 409 response when <br>
trying to change the owner on a provisioned node), how would that be <br>
done given this is a problem since 1.50 which was added in Stein? Would <br>
a policy rule be added to ironic to determine if someone can change the <br>
owner on a provisioned node and if so, what would be the default rule? <br>
The same as "baremetal:node:update" (rule:is_admin)?<br></blockquote><div><br></div><div>I like the idea of something like baremetal:node:update_owner defaulting to rule:is_admin (NOT to baremetal:node:update). I can work on a patch tomorrow if nobody beats me to it.</div></div></div></blockquote><div><br></div><div>I'm happy to take this on. Thanks!</div><div><br></div><div>Mainn</div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div></div><div>Dmitry<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
[1] <br>
<a href="https://docs.openstack.org/ironic/latest/contributor/webapi-version-history.html#id7" rel="noreferrer" target="_blank">https://docs.openstack.org/ironic/latest/contributor/webapi-version-history.html#id7</a><br>
[2] <a href="https://blueprints.launchpad.net/nova/+spec/ironic-tenant-filter" rel="noreferrer" target="_blank">https://blueprints.launchpad.net/nova/+spec/ironic-tenant-filter</a><br>
<br>
-- <br>
<br>
Thanks,<br>
<br>
Matt<br>
<br>
</blockquote></div></div>
</blockquote></div></div>