← Back to team overview

yahoo-eng-team team mailing list archive

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

 

Public bug reported:

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.

** Affects: nova
     Importance: Undecided
         Status: New

-- 
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):
  New

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


Follow ups