Reviewed: https://review.openstack.org/516395 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f02afc6569bd930114a4b56413dbd6becc5e7e75 Submitter: Zuul Branch: master
commit f02afc6569bd930114a4b56413dbd6becc5e7e75 Author: Matt Riedemann <mriedem...@gmail.com> Date: Mon Oct 30 12:49:31 2017 -0400 libvirt: do not remove inst_base when volume-backed during resize When confirming a resize, the libvirt driver on the source host checks to see if the instance base directory (which contains the domain xml files, etc) exists and if the root disk image does not, it removes the instance base directory. However, the root image disk won't exist on local storage for a volume-backed instance and if the instance base directory is on shared storage, e.g. NFS or Ceph, between the source and destination host, the instance base directory is incorrectly deleted. This adds a check to see if the instance is volume-backed when checking to see if the instance base directory should be removed from the source host when confirming a resize. Change-Id: I29fac80d08baf64bf69e54cf673e55123174de2a Closes-Bug: #1728603 ** 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/1728603 Title: Resize a boot-from-volume instance with NFS destroys instance 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: Turns out that the fix for https://bugs.launchpad.net/nova/+bug/1666831 accidentally broke boot- from-volume setups that use NFS. In particular, this line: https://github.com/openstack/nova/blob/stable/ocata/nova/virt/libvirt/driver.py#L1149 if os.path.exists(inst_base) and not root_disk.exists(): try: shutil.rmtree(inst_base) except OSError as e: if e.errno != errno.ENOENT: raise Causes the instance basedir which includes the instances libvirt.XML file to be deleted. The above needs to be changed to this in order to prevent BFV instances from being destroyed on resize... if os.path.exists(inst_base) and not root_disk.exists() and not compute_utils.is_volume_backed_instance(instance._context, instance): This bug was reported and the fix confirmed by Joris S'heeren To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1728603/+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