[enhacement] Create and pass serial or wwn to VM block devices created via virsh pods

Bug #1785755 reported by Dmitrii Shcherbakov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Newell Jensen

Bug Description

When curtin gets support for maas-devicename -> serial/wwn-based symlinks it will become important to actually pass persistent identifiers to the hypervisor via MAAS, see

https://bugs.launchpad.net/curtin/+bug/1735839
https://bugs.launchpad.net/curtin/+bug/1735839/comments/10

For virtio-blk devices this would mean using <serial> element in a domain xml file:

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/libvirt/images/maas.qcow2'/>
      <backingStore/>
      <target dev='sda' bus='scsi'/>
      <serial>a76f8801-92d3-4aff-9c96-a51a054517a0</serial> # <-- this
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

# QEMU CLI arg
-drive file=/var/lib/libvirt/images/maas-1.qcow2,format=qcow2,if=none,id=drive-virtio-disk0,serial=a76f8801-92d3-4aff-9c96-a51a054517a0 # ...

cat /sys/class/block/vda/serial
a76f8801-92d3-4aff-9

A UUID will be truncated as a serial number has a limited length.

For virtio-scsi devices

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/libvirt/images/maas.qcow2'/>
      <backingStore/>
      <target dev='sda' bus='scsi'/>
      <wwn>5000c50015ea71ad</wwn> # <--- this
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='scsi' index='0' model='virtio-scsi'>
      <alias name='scsi0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>

# QEMU CLI arg
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1,wwn=0x5000c50015ea71ad

by-id symlinks:

├── wwn-0x5000c50015ea71ad -> ../../sda
├── wwn-0x5000c50015ea71ad-part1 -> ../../sda1
└── wwn-0x5000c50015ea71ad-part2 -> ../../sda2

Relevant QEMU and libvirt commits:

https://git.qemu.org/?p=qemu.git;a=commit;h=95ebda85e09ed2b7f00deb2adbdafa5ccf5db948
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=64cc22841e72d37d577416f5836155ecd0a9bfb6
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=9a502563eef7d7c2c9120b237059426e229eefe9
https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=6e73850b01ee7d5816a803d684e9d669dad036f3

Related branches

tags: added: pods track
Changed in maas:
milestone: none → 2.5.0alpha2
importance: Undecided → Medium
status: New → Triaged
summary: - Create and pass serial or wwn to VM block devices created via virsh pods
+ [enhacement] Create and pass serial or wwn to VM block devices created
+ via virsh pods
tags: added: wishlist
Changed in maas:
assignee: nobody → Newell Jensen (newell-jensen)
Changed in maas:
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.