diff options
| author | Michael Still <mikal@stillhq.com> | 2012-12-18 16:32:14 +1100 |
|---|---|---|
| committer | Michael Still <mikal@stillhq.com> | 2012-12-19 11:13:24 +1100 |
| commit | 0cecdf4b8632d3a4eea816869796b03e8b928256 (patch) | |
| tree | 471d9fb2cd4c490cf42e6f112d8244f6d0850c4f /nova | |
| parent | 30ddc85a1046d8792cb9c2f82033124aebe50d0f (diff) | |
Reliably include OS type in ephemeral filenames.
Either include the OS type, or "default" if this isn't specified.
Also, I don't see why we care what ephemeral disk number this disk
was created as (they're all empty images in base, right?) so I've
removed that.
Resolves bug 1087030.
Change-Id: Iee7f8e9033a2e6a829421763090ed0e67c6b2da8
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/libvirt/driver.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 263fd5ca4..a6d12d4f4 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -1362,6 +1362,11 @@ class LibvirtDriver(driver.ComputeDriver): user_id=instance['user_id'], project_id=instance['project_id']) + # Lookup the filesystem type if required + os_type_with_default = instance['os_type'] + if not os_type_with_default: + os_type_with_default = 'default' + ephemeral_gb = instance['ephemeral_gb'] if ephemeral_gb and not self._volume_in_mapping( self.default_second_device, block_device_info): @@ -1369,9 +1374,7 @@ class LibvirtDriver(driver.ComputeDriver): fn = functools.partial(self._create_ephemeral, fs_label='ephemeral0', os_type=instance["os_type"]) - fname = "ephemeral_%s_%s_%s" % ("0", - ephemeral_gb, - instance["os_type"]) + fname = "ephemeral_%s_%s" % (ephemeral_gb, os_type_with_default) size = ephemeral_gb * 1024 * 1024 * 1024 image('disk.local').cache(fetch_func=fn, filename=fname, @@ -1385,9 +1388,7 @@ class LibvirtDriver(driver.ComputeDriver): fs_label='ephemeral%d' % eph['num'], os_type=instance["os_type"]) size = eph['size'] * 1024 * 1024 * 1024 - fname = "ephemeral_%s_%s_%s" % (eph['num'], - eph['size'], - instance["os_type"]) + fname = "ephemeral_%s_%s" % (eph['size'], os_type_with_default) image(_get_eph_disk(eph)).cache(fetch_func=fn, filename=fname, size=size, |
