-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Synchronize Ironic provision_state
to Nautobot
#163
Conversation
This commit includes a Workflow and Sensor that reacts to Events submitted by Ironic through Openstack AMQP EventSource. Each `ironic.node.update.end` event triggers a workflow to synchronize node's provision_state to Nautobot.
bab33ef
to
50ad761
Compare
I'll add my comments here: The primary use-case for tracking the ironic provisioning state is really missing here. So I have my own assumption. Perhaps there are more, so feel free to add in more details/thoughts.
So, I'll see your two options, veto one, and raise a 3rd one. Storing in device.statusThis option should NOT be done. This state is going to be used by other systems and having this be very dynamic on the states to account for everything that Ironic is seeing really doesn't offer what we need. Storing provision_state in a custom fieldI'm ok with this option. It would be more standardized and dedicated to this data. Storing provision_state in the "notes" fieldI'm also ok with this, just append a note to the device with the new state. Shows a rolling log w/ timestamps of "events". |
Thanks for feedback @khackworth, I went ahead and updated the code to use a custom field. The reason for choosing this over the notes is that it can be looked up both programmatically and in the UI quite easily and it is timestamped too. |
9821b61
to
7b5afe9
Compare
7b5afe9
to
99fd595
Compare
So I don't think we should be storing the Ironic state 1:1. It's more of this machine is available. This machine is actively used. This machine is broken. |
The review of state changes and metrics don't belong in Nautobot. But they belong in tools for gathering metrics. There's OpenStack actions logs that can be used for details on the state machine changes as well. |
Which tools are those? Are they accessible by all relevant parties (i.e. DCOPS)?
The "machine is actively used/broken" thing is being tracked by Status field. This is just an additional context for operators. |
They would need to be once we get those running. It just seems like the wrong place to show the state machine steps inside of Nautobot.
Sounds good. |
This PR adds a workflow and related sensor that listens to the RabbitMQ messages from Ironic (enabled for dev in https://github.com/RSS-Engineering/undercloud-deploy/pull/94) and every time the node in Ironic is updated, the status is synchronized back to the Nautobot.
While this works as is, I don't feel super good about storing the
provision_state
in thestatus
field in the Nautobot. I would appreciate some thoughts and feedback on this.Here is what I was debating:
Storing provision_state in the
Device.status
Pros: easy to implement, immediately visible in various places in the UI. Does not require schema changes. The history of changes is automatically tracked.
Cons: bloat in the number of possible statuses (Ironic has 25 of them). Will still require ansible changes to prepopulate Status choices.
Storing
provision_state
in a custom fieldPros: relatively easy to implement, controlled separately from the Device Status (good thing if that's what we want, for example, to include billing-specific statuses. or we want to avoid having Ironic overriding manually set statuses). No need to pre-populate as the custom field will likely be just a simple string.
Cons: may be more difficult to present in the UI, controlled separately from the Device Status (bad thing if we have to keep them in sync)
If you have any opinions on this, please do share them.