diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-08-16 11:28:27 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-08-16 11:48:24 -0700 |
| commit | 3a47c02c58cefed0e230190b4bcef14527c82709 (patch) | |
| tree | e111f037f0fb985db6a474c10839a3aabafb0d25 /nova/virt | |
| parent | 1e7769cf5587c1ce92f206b39fe646975b19fc95 (diff) | |
Allows libvirt to set a serial number for a volume
The serial number defaults to the volume_id of the volume being
attached. We may expose a method in the future to set a different
serial number when creating or attaching a volume.
The purpose of this change is to give users a consistent place
they can find their volume. It should show up now in most flavors
of linux under /disk/by-id/virtio-<volume_uuid>
Fixes bug 1004328
Change-Id: Id1c56b5b23d799deb7da2d39ae57ecb48965c55f
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/libvirt/volume.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/virt/libvirt/volume.py b/nova/virt/libvirt/volume.py index 3c286a901..54e6bfbf6 100644 --- a/nova/virt/libvirt/volume.py +++ b/nova/virt/libvirt/volume.py @@ -47,6 +47,7 @@ class LibvirtVolumeDriver(object): conf.source_path = connection_info['data']['device_path'] conf.target_dev = mount_device conf.target_bus = "virtio" + conf.serial = connection_info.get('serial') return conf def disconnect_volume(self, connection_info, mount_device): @@ -67,6 +68,7 @@ class LibvirtFakeVolumeDriver(LibvirtVolumeDriver): conf.source_host = "fake" conf.target_dev = mount_device conf.target_bus = "virtio" + conf.serial = connection_info.get('serial') return conf @@ -83,6 +85,7 @@ class LibvirtNetVolumeDriver(LibvirtVolumeDriver): conf.source_host = connection_info['data']['name'] conf.target_dev = mount_device conf.target_bus = "virtio" + conf.serial = connection_info.get('serial') netdisk_properties = connection_info['data'] if netdisk_properties.get('auth_enabled'): conf.auth_username = netdisk_properties['auth_username'] |
