<div dir="ltr">Hi all,<div><br></div><div>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:</div><div> </div><div>When we delete the instance while its' task state is networking:<br></div><div>scheduling->none->(networking)->deleting->block_device_mapping-->spawing-->none </div><div>The expected task_state should be:</div><div>networking->deleting->deleted</div><div>and the vm_state changes like this:</div><div>BUILD-ACIVE-disappear , which is also very strange for user.</div><div><br></div><div>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:</div><div><a href="https://git.openstack.org/cgit/openstack/nova/tree/nova/compute/manager.py#n2135">https://git.openstack.org/cgit/openstack/nova/tree/nova/compute/manager.py#n2135</a> , so it also saved "deleting" and two process keep working which causes the above situation.</div><div><br></div><div>How about we add some expected_task_state also for block_device_mapping?</div><div>The expected task states can be NETWORKING, SCHEDULING, and none.</div><div><br></div><div>I have registered a bug for this:</div><div><a href="https://bugs.launchpad.net/nova/+bug/1512563">https://bugs.launchpad.net/nova/+bug/1512563</a><br></div><div><br></div><div>Any suggestions?</div><div><br></div><div>Best Regards,</div><div>Zheng</div></div>