[4.6] CLOUDSTACK-9083: Add disk serial to kvm virt xml#1121
Conversation
Adds disk serial ids based on volume uuids to the virt xml. This may be useful for appliances/software that needs some serial ids on the VM disks. This does not impact existing/running VMs, the vm virt xmls will be updates for running VMs the next time they are stopped/started. For testing, disk serial (of debian based systemvm) in the virt xml matched that in /sys/devices/pci0000:00:0000:00:07.0/virtio4/block/vda/serial. We currently don't support scsi-blcok devices for which serial is not supported, for this we've added a DeviceType (LUN) which may be used in future and a check to not add the serial to the xml if disk type is LUN. Refer: https://libvirt.org/formatdomain.html#elementsDisks Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
|
Ping @wido @wilderrodrigues @remibergsma |
|
LGTM based on these tests: Result: And: Result: @bhaisaab Tests look OK, I didn't test the actual change. |
|
Pinging @DaanHoogland @borisroman to do second review. |
There was a problem hiding this comment.
So why is the LUN type added here?
There was a problem hiding this comment.
SCSI block devices, LUN are not supported; the type was added to avoid possible bug in case we decide to support this storage/device type in future. See https://libvirt.org/formatdomain.html#elementsDisks for details.
|
Verifying this is simple, just check the in the VM's virt xml (virsh edit domain, note the serial in the xml for the disk/volume) and ssh into the VM and check the hdd/vda serial (on debian based systemvm it was available at /sys/devices/pci0000:00:0000:00:07.0/virtio4/block/vda/serial) |
|
LGTM based on the code. I don't see any real issues. |
|
Merging now that we're tests performed and 2LGTMs. |
[4.6] CLOUDSTACK-9083: Add disk serial to kvm virt xmlAdds disk serial ids based on volume uuids to the virt xml. This may be useful for appliances/software that needs some serial ids on the VM disks. This does not impact existing/running VMs, the vm virt xmls will be updates for running VMs the next time they are stopped/started. For testing, disk serial (of debian based systemvm) in the virt xml matched that in /sys/devices/pci0000:00:0000:00:07.0/virtio4/block/vda/serial. We currently don't support scsi-blcok devices for which serial is not supported, for this we've added a DeviceType (LUN) which may be used in future and a check to not add the serial to the xml if disk type is LUN. Refer: https://libvirt.org/formatdomain.html#elementsDisks * pr/1121: CLOUDSTACK-9083: Add disk serial to kvm virt xml Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
|
great @bhaisaab I'll create the merge forward |
Adds disk serial ids based on volume uuids to the virt xml. This may be useful
for appliances/software that needs some serial ids on the VM disks. This does not
impact existing/running VMs, the vm virt xmls will be updates for running VMs
the next time they are stopped/started.
For testing, disk serial (of debian based systemvm) in the virt xml matched that
in /sys/devices/pci0000:00:0000:00:07.0/virtio4/block/vda/serial.
We currently don't support scsi-blcok devices for which serial is not supported,
for this we've added a DeviceType (LUN) which may be used in future and a check
to not add the serial to the xml if disk type is LUN.
Refer: https://libvirt.org/formatdomain.html#elementsDisks