One possible solution that seems to work:
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index bb3c312..68f68e6 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -4290,13 +4290,22 @@ class LibvirtDriver(driver.ComputeDriver): image = self.image_backend.image(instance, instance_disk, CONF.libvirt_images_type) - image.cache(fetch_func=libvirt_utils.fetch_image, - context=context, - filename=cache_name, - image_id=instance['image_ref'], - user_id=instance['user_id'], - project_id=instance['project_id'], - size=info['virt_disk_size']) + + if cache_name.startswith('ephemeral'): + image.cache(fetch_func=self._create_ephemeral, + fs_label='ephemeral0', + os_type=instance["os_type"], + filename=cache_name, + size=info['virt_disk_size'], + ephemeral_size=instance['ephemeral_gb']) + else: + image.cache(fetch_func=libvirt_utils.fetch_image, + context=context, + filename=cache_name, + image_id=instance['image_ref'], + user_id=instance['user_id'], + project_id=instance['project_id'], + size=info['virt_disk_size'])
One possible solution that seems to work:
diff --git a/nova/ virt/libvirt/ driver. py b/nova/ virt/libvirt/ driver. py virt/libvirt/ driver. py virt/libvirt/ driver. py driver. ComputeDriver) :
image = self.image_ backend. image(instance,
instance_ disk,
CONF.libvirt_ images_ type) fetch_func= libvirt_ utils.fetch_ image, cache_name, instance[ 'image_ ref'], instance[ 'user_id' ], id=instance[ 'project_ id'], 'virt_disk_ size']) startswith( 'ephemeral' ): fetch_func= self._create_ ephemeral, 'ephemeral0' , instance[ "os_type" ], cache_name, 'virt_disk_ size'], size=instance[ 'ephemeral_ gb']) fetch_func= libvirt_ utils.fetch_ image, cache_name, instance[ 'image_ ref'], instance[ 'user_id' ], id=instance[ 'project_ id'], 'virt_disk_ size'])
index bb3c312..68f68e6 100644
--- a/nova/
+++ b/nova/
@@ -4290,13 +4290,22 @@ class LibvirtDriver(
- image.cache(
- context=context,
- filename=
- image_id=
- user_id=
- project_
- size=info[
+
+ if cache_name.
+ image.cache(
+ fs_label=
+ os_type=
+ filename=
+ size=info[
+ ephemeral_
+ else:
+ image.cache(
+ context=context,
+ filename=
+ image_id=
+ user_id=
+ project_
+ size=info[