Reviewed:  https://review.opendev.org/631294
Committed: 
https://git.openstack.org/cgit/openstack/nova/commit/?id=90e0e874bde38937380d09ab27a7defbb5475cc2
Submitter: Zuul
Branch:    master

commit 90e0e874bde38937380d09ab27a7defbb5475cc2
Author: Matthew Booth <mbo...@redhat.com>
Date:   Tue Aug 14 16:05:11 2018 +0100

    Add functional test for bug 1550919
    
    This adds a failing test, which we fix in change I76448196.
    
    An earlier version of this change was previously merged as
    change I5619728d. This was later reverted, as it was failing in the
    gate. However, on inspection these failures seem to have been simply
    timeouts due to load.
    
    Changes from previous version:
    
    - Increase the timeouts which were previously triggering, and
      serialise server creation to reduce the chance of this recurring.
    - Add an LVM test, which highlights the requirement to flag the
      creation of ephemeral and swap disks.
    - Add an Qcow2 test, essentially the same as the Flat test but ensures
      coverage of the most common backends.
    - Each test now uses a separate instances_path allowing for cleanup
      without racing against other active tests.
    - Some nits addressed.
    
    For the time being this test does not make use of the recently improved
    nova.tests.functional.libvirt.base.ServersTestBase class to ease
    backports. Future changes should be made to use this class removing some
    of the common setUp logic from _LibvirtEvacuateTest.
    
    Co-Authored-By: Lee Yarwood <lyarw...@redhat.com>
    Related-Bug: #1550919
    Change-Id: I1062b3e74382734edbb2142a09ff0073c66af8db


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

Title:
  [Libvirt]Evacuate fail may cause disk image be deleted

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  I checked latest source of nova on master branch, this problem is
  still exists.

  When we are doing evacuate, eventually _do_rebuild_instance will be called.
  As rebuild is not implemented in libvirt driver, in fact 
_rebuild_default_impl is called.

          try:    
              with instance.mutated_migration_context():
                  self.driver.rebuild(**kwargs)
          except NotImplementedError:
              # NOTE(rpodolyaka): driver doesn't provide specialized version 
              # of rebuild, fall back to the default implementation
              self._rebuild_default_impl(**kwargs)

  _rebuild_default_impl will call self.driver.spawn to boot up the instance, 
and spawn will in turn call _create_domain_and_network
  when VirtualInterfaceCreateException or Timeout happen, self.cleanup will be 
called.

          except exception.VirtualInterfaceCreateException:
              # Neutron reported failure and we didn't swallow it, so
              # bail here
              with excutils.save_and_reraise_exception():
                  if guest:
                      guest.poweroff()
                  self.cleanup(context, instance, network_info=network_info,
                               block_device_info=block_device_info)
          except eventlet.timeout.Timeout:
              # We never heard from Neutron
              LOG.warn(_LW('Timeout waiting for vif plugging callback for '
                           'instance %(uuid)s'), {'uuid': instance.uuid},
                       instance=instance)
              if CONF.vif_plugging_is_fatal:
                  if guest:
                      guest.poweroff()
                  self.cleanup(context, instance, network_info=network_info,
                               block_device_info=block_device_info)
                  raise exception.VirtualInterfaceCreateException()

  Because default value for parameter destroy_disks is True
      def cleanup(self, context, instance, network_info, block_device_info=None,
                  destroy_disks=True, migrate_data=None, destroy_vifs=True):

  So if error occur when doing evacuate during wait neutron's event,
  instance's disk file will be deleted unexpectedly

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to