[Openstack] [Nova] The server instance changes from 'shutoff' to 'active' after created an instance snapshot

Wangpan hzwangpan at corp.netease.com
Wed Jul 11 07:25:12 UTC 2012


Hi all,

These are what I did (nova version is 'Essex'):
1. logon the instance
2. shutdown it using 'shutdown -h now'
3. wait a few minutes until the instance's vm_state, power_state change to 'shutoff', '5' respectively
4. run cmd 'nova image-create <server> <name>' to snapshot the server instance
5. the instance's vm_state changes to 'active', but the power_state doesn't change(still '5')

My questions:
1. Can we create a snapshot with a 'shutoff' instance?
2. If we can do the above operation, what is the correct vm_state after it? still 'shutoff' or changes to 'active'?
3. I also saw the source codes in nova/nova/compute/manager.py:snapshot_instance(), the vm_state is update at first by
               self._instance_update(context,
                              instance_ref['id'],
                              power_state=current_power_state,
                              vm_state=vm_states.ACTIVE)
   and the task_state is changed to 'None' finally
               self._instance_update(context, instance_ref['id'], task_state=None)
   should we change back the vm_state like this, too?

Thanks in Advance

Best Regards,
Wangpan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20120711/081c30df/attachment.html>


More information about the Openstack mailing list