← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1290294] Re: Instance's XXX_resize dir never be deleted if we resize a pre-grizzly instance in havana

 

** Also affects: nova/icehouse
   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/1290294

Title:
  Instance's XXX_resize dir never be deleted if we resize a pre-grizzly
  instance in havana

Status in OpenStack Compute (Nova):
  Fix Released
Status in OpenStack Compute (nova) icehouse series:
  New

Bug description:
  reproduce steps:
  1. create an instance under Folsom
  2. update nova to Havana
  3. resize the instance to another host
  4. confirm the resize
  5. examine the instance dir on source host

  you will find the instance-0000xxxx_resize dir exists there which was
  not deleted while confirming resize.

  the reason is that:
  in the _cleanup_resize in libvirt driver:
  def _cleanup_resize(self, instance, network_info):
          target = libvirt_utils.get_instance_path(instance) + "_resize"

  we get the instance path by using get_instance_path method in libvirt utils,
  but we check the original instance dir of pre-grizzly instances' before we return it,
  if this instance is a resized one which original instance dir exists on another host(the dest host),
  the wrong instance path with uuid will be returned, and then the `target` existing check will be failed,
  then the instance-xxxx_resize dir will never be deleted.

  def get_instance_path(instance, forceold=False, relative=False):
      """Determine the correct path for instance storage.

      This method determines the directory name for instance storage, while
      handling the fact that we changed the naming style to something more
      unique in the grizzly release.

      :param instance: the instance we want a path for
      :param forceold: force the use of the pre-grizzly format
      :param relative: if True, just the relative path is returned

      :returns: a path to store information about that instance
      """
      pre_grizzly_name = os.path.join(CONF.instances_path, instance['name'])
      if forceold or os.path.exists(pre_grizzly_name):                  ############### here we check the original instance dir, but if we have resized the instance to another host, this check will be failed, and a wrong dir with instance uuid will be returned.
          if relative:
              return instance['name']
          return pre_grizzly_name

      if relative:
          return instance['uuid']
      return os.path.join(CONF.instances_path, instance['uuid'])

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


References