virt drivers' resume_state_on_host_boot don't handle migrating instances
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Dan Smith |
Bug Description
nova-compute's init_host() can attempt to resume instances that are found not to be in RUNNING power state... but should be.
For xenapi, the driver just tries to 'power on' the instance.
For libvirt, it tries to do a hard reboot.
Neither method account for 'resize_migrating' task state... where (at least in XenAPI), the instance would have been renamed to append '-orig' to it. The driver will raise NotFound because it can't find the instance.
nova-compute's init_host() will catch all Exceptions and set the instance to ERROR... but it seems that since we have code to clean up the destination (there's code that looks at all instances in the driver and looks to see if their 'host' changed... and destroys them if so)... we could potentially clean up the source as well. Rename the instance back, clear task_state, and restart the old instance?
Changed in nova: | |
importance: | Undecided → High |
milestone: | none → grizzly-rc1 |
status: | New → Triaged |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | grizzly-rc1 → 2013.1 |
Trace for XenAPI:
2013-02-22 05:29:04 9736 TRACE nova File "/opt/rackstack /1.31/nova/ lib/python2 packages/ nova-2013. 1-py2.6. egg/nova/ service. py", line 394, in start init_host( ) /1.31/nova/ lib/python2 packages/ nova-2013. 1-py2.6. egg/nova/ compute/ manager. py", line 468, in in instance( context, instance) /1.31/nova/ lib/python2 packages/ nova-2013. 1-py2.6. egg/nova/ compute/ manager. py", line 442, in _i /1.31/nova/ lib/python2 packages/ nova-2013. 1-py2.6. egg/nova/ virt/xenapi/ driver. py", line 607, in state_on_ host_boot power_on( instance) /1.31/nova/ lib/python2 packages/ nova-2013. 1-py2.6. egg/nova/ virt/xenapi/ vmops.py" , line 1296, in vm_opaque_ ref(instanc /1.31/nova/ lib/python2 packages/ nova-2013. 1-py2.6. egg/nova/ virt/xenapi/ vmops.py" , line 691, in 4834bbfa- cb0b-4b29- 8da2-b55d9f4dea 38
.6/site-
2013-02-22 05:29:04 9736 TRACE nova self.manager.
2013-02-22 05:29:04 9736 TRACE nova File "/opt/rackstack
.6/site-
it_host
2013-02-22 05:29:04 9736 TRACE nova self._init_
2013-02-22 05:29:04 9736 TRACE nova File "/opt/rackstack
.6/site-
nit_instance
2013-02-22 05:29:04 9736 TRACE nova block_device_info)
2013-02-22 05:29:04 9736 TRACE nova File "/opt/rackstack
.6/site-
resume_
2013-02-22 05:29:04 9736 TRACE nova self._vmops.
2013-02-22 05:29:04 9736 TRACE nova File "/opt/rackstack
.6/site-
power_on
2013-02-22 05:29:04 9736 TRACE nova vm_ref = self._get_
e)
2013-02-22 05:29:04 9736 TRACE nova File "/opt/rackstack
.6/site-
_get_vm_opaque_ref
2013-02-22 05:29:04 9736 TRACE nova instance['name'])
2013-02-22 05:29:04 9736 TRACE nova NotFound: Could not find VM with name instance-
At this point the compute process dies... because it was just in the init phase.
The instance's name in the driver at this moment was actually instance- 4834bbfa- cb0b-4b29- 8da2-b55d9f4dea 38-orig because it was being migrated when compute was restarted.