Browse Source

Merge "xenapi: Remove Xen-only code paths"

tags/22.0.0.0rc1
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
9a2763f846
5 changed files with 13 additions and 32 deletions
  1. +1
    -7
      nova/cmd/novncproxy.py
  2. +0
    -3
      nova/compute/manager.py
  3. +2
    -0
      nova/objects/fields.py
  4. +10
    -8
      nova/tests/unit/compute/test_compute.py
  5. +0
    -14
      nova/tests/unit/compute/test_compute_mgr.py

+ 1
- 7
nova/cmd/novncproxy.py View File

@@ -39,13 +39,7 @@ def main():
CONF.set_default('web', '/usr/share/novnc')
config.parse_args(sys.argv)

# TODO(stephenfin): Always enable the security proxy once we support RFB
# version 3.3, as used in XenServer.
security_proxy = None
if CONF.compute_driver != 'xenapi.XenAPIDriver':
security_proxy = rfb.RFBSecurityProxy()

baseproxy.proxy(
host=CONF.vnc.novncproxy_host,
port=CONF.vnc.novncproxy_port,
security_proxy=security_proxy)
security_proxy=rfb.RFBSecurityProxy())

+ 0
- 3
nova/compute/manager.py View File

@@ -8439,9 +8439,6 @@ class ComputeManager(manager.Manager):
# vpmem must be cleanped
do_cleanup = not migrate_data.is_shared_instance_path or has_vpmem
destroy_disks = not migrate_data.is_shared_block_storage
elif isinstance(migrate_data, migrate_data_obj.XenapiLiveMigrateData):
do_cleanup = migrate_data.block_migration
destroy_disks = migrate_data.block_migration
elif isinstance(migrate_data, migrate_data_obj.HyperVLiveMigrateData):
# NOTE(claudiub): We need to cleanup any zombie Planned VM.
do_cleanup = True


+ 2
- 0
nova/objects/fields.py View File

@@ -778,6 +778,8 @@ class DiskFormat(BaseNovaEnum):
ALL = (RBD, LVM, QCOW2, RAW, PLOOP, VHD, VMDK, VDI, ISO)


# TODO(stephenfin): Remove the xenapi value when we bump the 'Diagnostics'
# object (the only user of this enum) to 2.0
class HypervisorDriver(BaseNovaEnum):
LIBVIRT = "libvirt"
XENAPI = "xenapi"


+ 10
- 8
nova/tests/unit/compute/test_compute.py View File

@@ -6224,8 +6224,10 @@ class ComputeTestCase(BaseTestCase,
fake_bdms.append(bdms)
return bdms

migrate_data = migrate_data_obj.XenapiLiveMigrateData(
block_migration=True)
migrate_data = migrate_data_obj.LibvirtLiveMigrateData(
block_migration=True,
is_shared_instance_path=False,
is_shared_block_storage=False)

mock_pre.side_effect = test.TestingException
mock_get_bdms.side_effect = gen_fake_bdms
@@ -6245,9 +6247,9 @@ class ComputeTestCase(BaseTestCase,
# submitted to a thread executor raises, the exception will not be
# raised unless Future.result() is called.
self.compute.live_migration(
c, dest=dest_host, block_migration=True,
instance=instance, migration=migration,
migrate_data=migrate_data)
c, dest=dest_host, block_migration=True,
instance=instance, migration=migration,
migrate_data=migrate_data)
mock_setup.assert_called_once_with(c, instance, self.compute.host)
mock_client.move_allocations.assert_called_once_with(
c, migration.uuid, instance.uuid)
@@ -6262,8 +6264,8 @@ class ComputeTestCase(BaseTestCase,
self.assertEqual('failed', migration.status)
mock_get_disk.assert_called()
mock_pre.assert_called_once_with(c,
instance, True, mock_get_disk.return_value, dest_host,
migrate_data)
instance, True, mock_get_disk.return_value, dest_host,
migrate_data)

# Assert that _rollback_live_migration puts connection_info back to
# what it was before the call to pre_live_migration.
@@ -6289,7 +6291,7 @@ class ComputeTestCase(BaseTestCase,
mock_rollback.assert_called_once_with(c, instance, dest_host,
destroy_disks=True,
migrate_data=test.MatchType(
migrate_data_obj.XenapiLiveMigrateData))
migrate_data_obj.LibvirtLiveMigrateData))
# Assert that the final attachment_ids returned by
# BlockDeviceMappingList.get_by_instance_uuid are then deleted.
mock_attachment_delete.assert_has_calls([


+ 0
- 14
nova/tests/unit/compute/test_compute_mgr.py View File

@@ -10435,20 +10435,6 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase,
self.assertFalse(do_cleanup)
self.assertFalse(destroy_disks)

def test_live_migration_cleanup_flags_block_migrate_xenapi(self):
migrate_data = objects.XenapiLiveMigrateData(block_migration=True)
do_cleanup, destroy_disks = self.compute._live_migration_cleanup_flags(
migrate_data)
self.assertTrue(do_cleanup)
self.assertTrue(destroy_disks)

def test_live_migration_cleanup_flags_live_migrate_xenapi(self):
migrate_data = objects.XenapiLiveMigrateData(block_migration=False)
do_cleanup, destroy_disks = self.compute._live_migration_cleanup_flags(
migrate_data)
self.assertFalse(do_cleanup)
self.assertFalse(destroy_disks)

def test_live_migration_cleanup_flags_live_migrate(self):
do_cleanup, destroy_disks = self.compute._live_migration_cleanup_flags(
{})


Loading…
Cancel
Save