diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index bf7609f..6a1591c 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -4381,7 +4381,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, + if cache_name.startswith('ephemeral'): + image.cache(fetch_func=self._create_ephemeral, + fs_label=cache_name, + os_type=instance["os_type"], + filename=cache_name, + size=info['virt_disk_size'], + ephemeral_size=instance['ephemeral_gb']) + elif cache_name.startswith('swap'): + inst_type = flavors.extract_flavor(instance) + swap_mb = inst_type['swap'] + image.cache(fetch_func=self._create_swap, + filename="swap_%s" % swap_mb, + size = swap_mb * unit.Mi + swap_mb=swap_mb) + else: + image.cache(fetch_func=libvirt_utils.fetch_image, context=context, filename=cache_name, image_id=instance['image_ref'],
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, startswith( 'ephemeral' ): fetch_func= self._create_ ephemeral, cache_name, instance[ "os_type" ], cache_name, 'virt_disk_ size'], size=instance[ 'ephemeral_ gb']) startswith( 'swap') : extract_ flavor( instance) fetch_func= self._create_ swap, fetch_func= libvirt_ utils.fetch_ image,
context= context,
filename= cache_name,
image_ id=instance[ 'image_ ref'],
index bf7609f..6a1591c 100644
--- a/nova/
+++ b/nova/
@@ -4381,7 +4381,22 @@ class LibvirtDriver(
- image.cache(
+ if cache_name.
+ image.cache(
+ fs_label=
+ os_type=
+ filename=
+ size=info[
+ ephemeral_
+ elif cache_name.
+ inst_type = flavors.
+ swap_mb = inst_type['swap']
+ image.cache(
+ filename="swap_%s" % swap_mb,
+ size = swap_mb * unit.Mi
+ swap_mb=swap_mb)
+ else:
+ image.cache(