From 54afa0683fb4e7bb259ffd3c810f0e767114b221 Mon Sep 17 00:00:00 2001 From: Vladik Romanovsky Date: Thu, 26 Jun 2014 17:46:43 -0400 Subject: [PATCH] libvirt: removing lxc specific disk mapping Currently, LXC specific disk mapping is being created, preventing the attached volumes from being added to the LXC disk mapping. Removing this part, to allow volumes to be included in mapping. Related-Bug: #1269990 Change-Id: I97bcff558b6d8876a10adb36c19ab3f4c972a708 --- nova/tests/virt/libvirt/test_blockinfo.py | 1 + nova/virt/libvirt/blockinfo.py | 17 ----------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/nova/tests/virt/libvirt/test_blockinfo.py b/nova/tests/virt/libvirt/test_blockinfo.py index 62f8589362bc..9fec83ee4ae2 100644 --- a/nova/tests/virt/libvirt/test_blockinfo.py +++ b/nova/tests/virt/libvirt/test_blockinfo.py @@ -205,6 +205,7 @@ class LibvirtBlockInfoTest(test.TestCase): # A simple disk mapping setup, but for lxc user_context = context.RequestContext(self.user_id, self.project_id) + self.test_instance['ephemeral_gb'] = 0 instance_ref = db.instance_create(user_context, self.test_instance) mapping = blockinfo.get_disk_mapping("lxc", instance_ref, diff --git a/nova/virt/libvirt/blockinfo.py b/nova/virt/libvirt/blockinfo.py index 27800eceedd8..d83bee8ecbca 100644 --- a/nova/virt/libvirt/blockinfo.py +++ b/nova/virt/libvirt/blockinfo.py @@ -501,23 +501,6 @@ def get_disk_mapping(virt_type, instance, driver.block_device_info_get_mapping(block_device_info)) if get_device_name(bdm)] - if virt_type == "lxc": - # NOTE(zul): This information is not used by the libvirt driver - # however we need to populate mapping so the image can be - # created when the instance is started. This can - # be removed when we convert LXC to use block devices. - root_disk_bus = disk_bus - root_device_type = 'disk' - - root_info = get_next_disk_info(mapping, - root_disk_bus, - root_device_type, - boot_index=1) - mapping['root'] = root_info - mapping['disk'] = root_info - - return mapping - if rescue: rescue_info = get_next_disk_info(mapping, disk_bus, boot_index=1)