[openstack-dev] [nova] Add expected_task for instance.save() used by block_device mapping in compute.manager._build_resources

Zhenyu Zheng zhengzhenyulixi at gmail.com
Tue Nov 3 03:52:36 UTC 2015


Hi all,

We have recently meet this problem: for large scale deployment, command can
be sent concurrently, and for several times, when an instance was asked to
be delete during it is launching, we observed that the vm_state and
task_state of that instance has changed abnormally like this:

When we delete the instance while its' task state is networking:
scheduling->none->(networking)->deleting->block_device_mapping-->spawing-->none
The expected task_state should be:
networking->deleting->deleted
and the vm_state changes like this:
BUILD-ACIVE-disappear , which is also very strange for user.

After we dive deeper, we found out that in the _build_resource code, the
instance.save() for block_device_mapping doesn't contain
expected_task_state:
https://git.openstack.org/cgit/openstack/nova/tree/nova/compute/manager.py#n2135
,
so it also saved "deleting" and two process keep working which causes the
above situation.

How about we add some expected_task_state also for block_device_mapping?
The expected task states can be NETWORKING, SCHEDULING, and none.

I have registered a bug for this:
https://bugs.launchpad.net/nova/+bug/1512563

Any suggestions?

Best Regards,
Zheng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151103/0a6b017e/attachment.html>


More information about the OpenStack-dev mailing list