Reviewed: https://review.openstack.org/378009 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=dcdd2c9832c7c60fe9163cd744ca2b5acfe16bcc Submitter: Zuul Branch: master
commit dcdd2c9832c7c60fe9163cd744ca2b5acfe16bcc Author: Shoham Peller <shoham.pel...@stratoscale.com> Date: Tue Sep 27 20:25:05 2016 +0300 Handle spawning error on unshelving If spawning fails when unshelving, terminate the volumes' connections with the node, and remove the node reference from the instance entry. Co-Authored-By: Matt Riedemann <mriedem...@gmail.com> Closes-Bug: 1627694 Change-Id: I8cfb2280d956d452ccad1fc711bd814b7258147f ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1627694 Title: unshelving an instance doesn't rollback volumes connections on failure Status in OpenStack Compute (nova): Fix Released Status in OpenStack Compute (nova) ocata series: Confirmed Status in OpenStack Compute (nova) pike series: Confirmed Bug description: When creating and instance and it is being spawned for the first time fails, the instance's volumes' initialize_connection is being rolled- back, but when unshelving an shelved-offloaded instance, there's no rollback in case of failure. The reason is that when spawning an instance for the first time, nova-compute calls initialize_connection using the _build_resources() method: https://github.com/openstack/nova/blob/93e689516da0302b06c2760bb82c5004ae057913/nova/compute/manager.py#L1902 That context-aware method will also take care of rollback in case of a failure in spawning, and will terminate_connection of the volumes: https://github.com/openstack/nova/blob/93e689516da0302b06c2760bb82c5004ae057913/nova/compute/manager.py#L2095 But, when unshelving an instance, initialize_connection is not called in a context aware method, and no rollback in happening when spawning fails. https://github.com/openstack/nova/blob/93e689516da0302b06c2760bb82c5004ae057913/nova/compute/manager.py#L4330 This makes the volumes stay connected to the node even-though the instance is shelved-offloaded. If you want to see this problem, replace the driver.spawn() call with a "raise Exception", and see the volumes have connection to the node even though they shouldn't have. I'm using openstack Liberty, but I can see this problem in current master (pre-Newton) To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1627694/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp