yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #57099
[Bug 1627694] Re: unshelving an instance doesn't rollback volumes connections on failure
@mriedem Thank you for your response.
We don't have to detach the volume from the server, or deleting anything from the DB. The problem is simply that the volumes are stayed connected to the node, because initialize_connection was called, but when spawning failed, and the VM is not on the node, the volumes stay connected to the node.
If terminate_connection is called on rollback, the user can safely retry the unshelving, and the volumes won't be connected to more than 1 node. Nothing will be changed in the DB regarding the VM's attached volumes or networks.
** Changed in: nova
Status: Invalid => Won't Fix
** Changed in: nova
Status: Won't Fix => Confirmed
--
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):
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
References