← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1666831] Re: Nova recreates instance directory after migration/resize

 

Reviewed:  https://review.openstack.org/437356
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6347baf3d09036525b7f6df991ae440d558f9cc3
Submitter: Jenkins
Branch:    master

commit 6347baf3d09036525b7f6df991ae440d558f9cc3
Author: Maciej Józefczyk <maciej.jozefczyk@xxxxxxxxxxxx>
Date:   Thu Feb 23 12:56:04 2017 +0100

    Ensure that instance directory is removed after success migration/resize
    
    Nova recreates instance directory on source host after successful migration/resize.
    This patch removes directory of migrated instance from source host.
    
    Change-Id: Ic683f83e428106df64be42287e2c5f3b40e73da4
    Closes-Bug: #1666831


** 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/1666831

Title:
  Nova recreates instance directory after migration/resize

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Description
  ===========
  Nova recreates instance directory on source host after successful migration/resize when using QEMU Qcow2 file drives.

  
  Nova after migration executes method driver.confirm_migration().
  This method cleans instance directory (instance directory with suffix _resize):

  nova/virt/libvirt/driver.py
  1115         if os.path.exists(target):
  1116             # Deletion can fail over NFS, so retry the deletion as required.
  1117             # Set maximum attempt as 5, most test can remove the directory
  1118             # for the second time.
  1119             utils.execute('rm', '-rf', target, delay_on_retry=True,
  1120                           attempts=5)

  After that Nova executes:
  1122             root_disk = self.image_backend.by_name(instance, 'disk')

  root_disk is used to remove rdb snapshots, but during execution of
  self.image_backend.by_name() nova recreates instance directory.

  Flow:

  driver.confirm_migration()->self._cleanup_resize()->self.image_backend.by_name()
  -> (nova/virt/libvirt/imagebackend.py)
  image_backend.by_name()->Qcow2.__init__()->Qcow2.resolve_driver_format().

  Qcow2.resolve_driver_format():
   344             if self.disk_info_path is not None:
   345                 fileutils.ensure_tree(os.path.dirname(self.disk_info_path))
   346                 write_to_disk_info_file()

  
  Steps to reproduce
  ==================

  - spawn instance
  - migrate/resize instance
  - check that instance dir on old host still exists (example: /home/instances/<instance_uuid>/disk.info

  
  Expected result
  ===============
  After migration directory /home/instances/<instance_uuid> and file /home/instances/<instance_uuid> should not exist.

  Actual result
  =============
  Nova leaves instance directory after migration/resize.

  
  Environment
  ===========
  1. Openstack Newton (it seems master is affected too).

  2. Libvirt + KVM

  3. Qcow2 file images on local disk.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1666831/+subscriptions


References