diff --git a/nova/tests/unit/virt/xenapi/test_vmops.py b/nova/tests/unit/virt/xenapi/test_vmops.py index 1e4e526b23e2..e5a0e1cc7fe2 100644 --- a/nova/tests/unit/virt/xenapi/test_vmops.py +++ b/nova/tests/unit/virt/xenapi/test_vmops.py @@ -349,7 +349,7 @@ class SpawnTestCase(VMOpsTestBase): if include_root_vdi: vdis["root"] = {"ref": "fake_ref"} self.vmops._get_vdis_for_instance(context, instance, - name_label, "image_id", di_type, + name_label, image_meta, di_type, block_device_info).AndReturn(vdis) self.vmops._resize_up_vdis(instance, vdis) step += 1 diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 148cb2a02b0e..06b2761e1b2f 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -347,7 +347,7 @@ class VMOps(object): bad_volumes_callback(bad_devices) def _get_vdis_for_instance(self, context, instance, name_label, - image_id, image_type, block_device_info): + image_meta, image_type, block_device_info): """Create or connect to all virtual disks for this instance.""" vdis = self._connect_cinder_volumes(instance, block_device_info) @@ -356,7 +356,7 @@ class VMOps(object): # then use the Glance image as the root device if 'root' not in vdis: create_image_vdis = vm_utils.create_image(context, self._session, - instance, name_label, image_id, image_type) + instance, name_label, image_meta.id, image_type) vdis.update(create_image_vdis) # Fetch VDI refs now so we don't have to fetch the ref multiple times @@ -416,7 +416,7 @@ class VMOps(object): def create_disks_step(undo_mgr, disk_image_type, image_meta, name_label): vdis = self._get_vdis_for_instance(context, instance, name_label, - image_meta.id, disk_image_type, + image_meta, disk_image_type, block_device_info) def undo_create_disks():