twa
(Thomas Waser)
October 6, 2025, 3:48pm
1
Please, describe the problem here and provide additional information below (if applicable) …
Versions of the related components and OS (frontend, hypervisors, VMs):
Alma 9, OpenNebula 7.0, KVM, iscsi storage with LVM driver
Steps to reproduce:
attach a new (only tried with volatile) disk to a VM via Sunstone, set a custom serial and check with udevadm info <disk> inside the VM
Current results:
before reboot the serial looks something like
ID_SERIAL=0QEMU_QEMU_HARDDISK_drive-scsi0-0-18-0 and ID_SCSI_SERIAL is missing
after reboot both are working
Expected results:
both serials to be set without a reboot
brunorro
(Bruno Rodríguez)
October 8, 2025, 2:31pm
2
Hello,
Have you triggered the udevadm rules (sudo udevadm trigger) after the disk is attached?
Do dmesg and lshw show any useful information before the VM is rebooted?
Thanks
twa
(Thomas Waser)
October 8, 2025, 4:48pm
3
i’ve tried triggering the udev rules, nothing changed. i’m not sure how that’s supposed to update the serial though.
dmesg shows:
[6849284.483828] scsi 0:0:23:0: Direct-Access QEMU QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5
[6849284.605794] sd 0:0:23:0: Power-on or device reset occurred
[6849284.606890] sd 0:0:23:0: LUN assignments on this target have changed. The Linux SCSI layer does not automatically remap LUN assignments.
[6849284.607071] sd 0:0:23:0: [sda] 31457280 512-byte logical blocks: (16.1 GB/15.0 GiB)
[6849284.607793] sd 0:0:23:0: [sda] Write Protect is off
[6849284.607797] sd 0:0:23:0: [sda] Mode Sense: 63 00 00 08
[6849284.608017] sd 0:0:23:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[6849284.610834] sd 0:0:23:0: [sda] Attached SCSI disk
[6849284.612076] sd 0:0:23:0: Attached scsi generic sg1 type 0
lshw:
*-disk
description: SCSI Disk
product: QEMU HARDDISK
vendor: QEMU
physical id: 0.17.0
bus info: scsi@0:0.23.0
logical name: /dev/sda
version: 2.5+
size: 15GiB (16GB)
capabilities: 5400rpm
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512
i think the issue is with the attach_disk script. after attaching the disk virsh dumpxml also doesn’t show a serial for the disk:
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' discard='unmap'/>
<source dev='/var/lib/one//datastores/100/45/disk.2' index='4'/>
<backingStore/>
<target dev='sdx' bus='scsi'/>
<alias name='scsi0-0-23-0'/>
<address type='drive' controller='0' bus='0' target='23' unit='0'/>
</disk>
after powering off and restarting the vm:
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' discard='unmap'/>
<source dev='/var/lib/one//datastores/100/45/disk.2' index='2'/>
<backingStore/>
<target dev='sdx' bus='scsi'/>
<serial>test.serial</serial>
<alias name='scsi0-0-23-0'/>
<address type='drive' controller='0' bus='0' target='23' unit='0'/>
</disk>
Could you try the attached patch?
attach_disk_serial.patch (1.4 KB)
Should be applied on the frontend:
# become the oneadmin user
sudo -i -u oneadmin
# apply the patch
patch -b -p 0 <...path_to/attach_disk_serrial.patch
# populate the patched drivers on the hosts
onehost sync --force
Best Regards,
Anton Todorov
twa
(Thomas Waser)
October 20, 2025, 3:05pm
5
patch works perfectly, thanks!
1 Like
Great,
Just added a github issue with the patch.
Best Regards,
Anton Todorov
system
(system)
Closed
November 19, 2025, 4:31pm
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.