← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1206312] Re: resize-revert might be failed when using slow NFS

 

** Changed in: nova
       Status: Fix Committed => 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/1206312

Title:
  resize-revert might be failed when using slow NFS

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  
  I did the followig steps with a script.
  1) resize vm
  2) resize-revert vm
  3) goto 1)

  Sometimes found resize failed with following error:
  [root@rhel8233 ~]# nova show vm1
  +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  | Property                            | Value                                                                                                                                                      |
  +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  | status                              | ERROR                                                                                                                                                      |
  | updated                             | 2013-07-15T03:11:31Z                                                                                                                                       |
  | OS-EXT-STS:task_state               | None                                                                                                                                                       |
  | OS-EXT-SRV-ATTR:host                | rhel8234                                                                                                                                                   |
  | key_name                            | None                                                                                                                                                       |
  | image                               | cirros-0.3.0-x86_64 (9e66c9bb-ed95-42ab-b8f6-70a0f88b876a)                                                                                                 |
  | hostId                              | 0ddc9ca22d1deceff5ac4f83526f950fac6bb9b7c185c899985e60e1                                                                                                   |
  | OS-EXT-STS:vm_state                 | error                                                                                                                                                      |
  | OS-EXT-SRV-ATTR:instance_name       | instance-00000068                                                                                                                                          |
  | OS-SRV-USG:launched_at              | 2013-07-15T02:59:20.000000                                                                                                                                 |
  | OS-EXT-SRV-ATTR:hypervisor_hostname | rhel8234                                                                                                                                                   |
  | flavor                              | m1.tiny (1)                                                                                                                                                |
  | id                                  | fb33fb20-260c-4096-9448-f4bdb5b2e617                                                                                                                       |
  | security_groups                     | [{u'name': u'default'}]                                                                                                                                    |
  | OS-SRV-USG:terminated_at            | None                                                                                                                                                       |
  | user_id                             | e18753eee1ec42349ef4d48f6a0cba01                                                                                                                           |
  | name                                | vm1                                                                                                                                                        |
  | created                             | 2013-07-15T02:45:22Z                                                                                                                                       |
  | tenant_id                           | 333416515ef44d51a3e6d03e003458ba                                                                                                                           |
  | OS-DCF:diskConfig                   | MANUAL                                                                                                                                                     |
  | metadata                            | {}                                                                                                                                                         |
  | accessIPv4                          |                                                                                                                                                            |
  | accessIPv6                          |                                                                                                                                                            |
  | fault                               | {u'message': u'OSError', u'code': 500, u'details': u'[Errno 2] No such file or directory: \'/var/lib/nova/instances/fb33fb20-260c-4096-9448-f4bdb5b2e617\' |
  |                                     |   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 238, in decorated_function                                                         |
  |                                     |     return function(self, context, *args, **kwargs)                                                                                                        |
  |                                     |   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 2463, in finish_revert_resize                                                      |
  |                                     |     block_device_info, power_on)                                                                                                                           |
  |                                     |   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3892, in finish_revert_migration                                               |
  |                                     |     self._cleanup_failed_migration(inst_base)                                                                                                              |
  |                                     |   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3876, in _cleanup_failed_migration                                             |
  |                                     |     shutil.rmtree(inst_base)                                                                                                                               |
  |                                     |   File "/usr/lib64/python2.6/shutil.py", line 204, in rmtree                                                                                               |
  |                                     |     onerror(os.listdir, path, sys.exc_info())                                                                                                              |
  |                                     |   File "/usr/lib64/python2.6/shutil.py", line 202, in rmtree                                                                                               |
  |                                     |     names = os.listdir(path)                                                                                                                               |
  |                                     | ', u'created': u'2013-07-15T03:11:31Z'}                                                                                                                    |
  | OS-EXT-STS:power_state              | 1                                                                                                                                                          |
  | OS-EXT-AZ:availability_zone         | nova                                                                                                                                                       |
  | config_drive                        |                                                                                                                                                            |
  +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+

  After some debug, found that in driver.py:: finish_revert_migration()

  def finish_revert_migration(self, instance, network_info,
                                  block_device_info=None, power_on=True):
          LOG.debug(_("Starting finish_revert_migration"),
                     instance=instance)

          inst_base = libvirt_utils.get_instance_path(instance)
          inst_base_resize = inst_base + "_resize"

          # NOTE(danms): if we're recovering from a failed migration,
          # make sure we don't have a left-over same-host base directory
          # that would conflict. Also, don't fail on the rename if the
          # failure happened early.
          if os.path.exists(inst_base_resize):
              if os.path.exists(inst_base): <<< This can sometimes be true even the inst_base has been destroyed in manager.py::revert_resize
                  self._cleanup_failed_migration(inst_base) <<< exception here, since inst_base cannot be found
              utils.execute('mv', inst_base_resize, inst_base)

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