← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1385480] [NEW] LVM rescue disk not remove during unrescue

 

Public bug reported:

Rescuing and unrescuing LVM backed instance leaves behind the .rescue
disk image. This is caused by unrescue assuming that instances have file
based disks.

def unrescue(self, instance, network_info):
"""Reboot the VM which is being rescued back into primary images.
"""
instance_dir = libvirt_utils.get_instance_path(instance)
unrescue_xml_path = os.path.join(instance_dir, 'unrescue.xml')
xml = libvirt_utils.load_file(unrescue_xml_path)
virt_dom = self._lookup_by_name(instance.name)
self._destroy(instance)
self._create_domain(xml, virt_dom)
libvirt_utils.file_delete(unrescue_xml_path) 
rescue_files = os.path.join(instance_dir, "*.rescue")
for rescue_file in glob.iglob(rescue_files):
libvirt_utils.file_delete(rescue_file)        <<<-------------- here

The last line delete all of the .rescue files in the instance directory
but does not clean up the .rescue LVM volumes.

----------------------
To reproduce:

1. Configure nova for LVM ephemeral storage with

[libvirt]
images_type = lvm
images_volume_group = nova-lvm

2. Stack
3. Boot an instance with flavor other than nano or micro, so the instance has a non-zero disk size
4. Rescue the instance
5. Unrescue the instance
6. Observe the rescue image left in nova-lvm/<instance uuid>.rescue

** Affects: nova
     Importance: Undecided
     Assignee: Dan Genin (daniel-genin)
         Status: New


** Tags: leak lvm unrescue

-- 
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/1385480

Title:
  LVM rescue disk not remove during unrescue

Status in OpenStack Compute (Nova):
  New

Bug description:
  Rescuing and unrescuing LVM backed instance leaves behind the .rescue
  disk image. This is caused by unrescue assuming that instances have
  file based disks.

  def unrescue(self, instance, network_info):
  """Reboot the VM which is being rescued back into primary images.
  """
  instance_dir = libvirt_utils.get_instance_path(instance)
  unrescue_xml_path = os.path.join(instance_dir, 'unrescue.xml')
  xml = libvirt_utils.load_file(unrescue_xml_path)
  virt_dom = self._lookup_by_name(instance.name)
  self._destroy(instance)
  self._create_domain(xml, virt_dom)
  libvirt_utils.file_delete(unrescue_xml_path) 
  rescue_files = os.path.join(instance_dir, "*.rescue")
  for rescue_file in glob.iglob(rescue_files):
  libvirt_utils.file_delete(rescue_file)        <<<-------------- here

  The last line delete all of the .rescue files in the instance
  directory but does not clean up the .rescue LVM volumes.

  ----------------------
  To reproduce:

  1. Configure nova for LVM ephemeral storage with

  [libvirt]
  images_type = lvm
  images_volume_group = nova-lvm

  2. Stack
  3. Boot an instance with flavor other than nano or micro, so the instance has a non-zero disk size
  4. Rescue the instance
  5. Unrescue the instance
  6. Observe the rescue image left in nova-lvm/<instance uuid>.rescue

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


Follow ups

References