garyk has a change up [1] which proposes to add a config option to log a warning rather than call the stop API when nova thinks that an instance is in an inconsistent state between the database and hypervisor and decides to stop it.

Regardless of that proposal, it brings up the fact that this code is a big pile of spaghetti and I kind of hate it. :)

It's called from the periodic task and the virt driver lifecycle event callback (implemented by libvirt and hyperv).

I was thinking it'd be nice to abstract some of that state -> action logic into objects. Like you create a factory which given some state value(s) yields an action, which could be logging/calling stop API, etc, but the point is that logic is abstracted away from _sync_instance_power_state so we don't have that giant mess of conditionals.

I don't really have a clear picture in my head for this, but wanted to dump it in the mailing list for something to think about if people want something to work on.

[1] https://review.openstack.org/#/c/190047/

--

Thanks,

Matt Riedemann


__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to