From a3ccd0f8454a0c381debf180b589d5837ef6674d Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 16 Sep 2011 15:38:29 -0400 Subject: create disk.local the same way ephemerals are created (LP: #851145) If the user did not specify '--block-device-mapping /dev/vdb=ephemeral0', then then the first non-root device would end up being created differently then if they had. It would not have a filesystem on it. This makes 'local_gb' in the libvirt connection created the same way that it would be if it were named ephemeral0. --- nova/virt/libvirt/connection.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'nova') diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index 64cd2c47f..034259d73 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -865,9 +865,13 @@ class LibvirtConnection(driver.ComputeDriver): local_gb = inst['local_gb'] if local_gb and not self._volume_in_mapping( self.default_local_device, block_device_info): - self._cache_image(fn=self._create_local, + fn = functools.partial(self._create_ephemeral, + fs_label='ephemeral0', + os_type=inst.os_type) + self._cache_image(fn=fn, target=basepath('disk.local'), - fname="local_%s" % local_gb, + fname="ephemeral_%s_%s_%s" % + ("0", local_gb, inst.os_type), cow=FLAGS.use_cow_images, local_size=local_gb) -- cgit