[PVE-User] Matching WUI VM hardware disks to Linux guest disks

Eneko Lacunza elacunza at binovo.es
Tue Nov 10 15:01:33 CET 2020


Hi Chris,

El 10/11/20 a las 10:53, Chris Hofstaedtler | Deduktiva escribió:
> Hi,
>
> * Eneko Lacunza via pve-user <pve-user at lists.proxmox.com> [201110 09:03]:
>> I have hit a simple problem. Let be a VM with 3 disks, with .conf extract:
>>
>> scsi0: ceph-proxmox:vm-100-disk-1,cache=writeback,size=6G
>> scsi1: ceph-proxmox:vm-100-disk-0,cache=writeback,size=400G
>> scsi2: ceph-proxmox:vm-100-disk-3,cache=writeback,size=400G
>>
>> We have two virtual disks with identical size (400G).
>>
>> How can I be sure what device on Linux guest is each?
> You can also check - and use in /etc/fstab - the /dev/disk/by-*
> symlinks.
>
> In a VM, maybe the most relevant "id" is the actual path.
> /dev/disk/by-path has these links (in my case):
>
>    pci-0000:06:05.0-scsi-0:0:0:0 -> sda
>    pci-0000:00:05.0-scsi-0:0:0:1 -> sdb
>
> If your sdb/sdc are swapped, the SCSI IDs in the path should still
> be correct.
lrwxrwxrwx 1 root root  9 Oct 29 15:24 pci-0000:00:05.0-scsi-0:0:0:0 -> 
../../sda
lrwxrwxrwx 1 root root 10 Oct 29 15:24 
pci-0000:00:05.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 29 15:24 
pci-0000:00:05.0-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 29 15:24 
pci-0000:00:05.0-scsi-0:0:0:0-part5 -> ../../sda5
lrwxrwxrwx 1 root root  9 Nov 10 09:08 pci-0000:00:05.0-scsi-0:0:0:1 -> 
../../sdc
lrwxrwxrwx 1 root root  9 Oct 29 15:24 pci-0000:00:05.0-scsi-0:0:0:2 -> 
../../sdb

Yes, they are.

> If you don't like the pci path in there, /dev/disk/by-id has:
>    scsi-0QEMU_QEMU_HARDDISK_drive-scsi0 -> sda
>    scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 -> sdb
>
> But you'll have to check if those match with the VM settings (I'd
> expect them to).
lrwxrwxrwx 1 root root  9 Oct 29 15:24 
scsi-0QEMU_QEMU_HARDDISK_drive-scsi0 -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 29 15:24 
scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 29 15:24 
scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 29 15:24 
scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part5 -> ../../sda5
lrwxrwxrwx 1 root root  9 Nov 10 09:08 
scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 -> ../../sdc
lrwxrwxrwx 1 root root  9 Oct 29 15:24 
scsi-0QEMU_QEMU_HARDDISK_drive-scsi2 -> ../../sdb

Those match too.


> As you've discovered and others have said, lsscsi, or lsblk -S can
> be used to see the SCSI IDs, too. The same info is also availabe
> from udevadm: udevadm info /dev/sda
> If you dig around in /sys, it's also there ;-)
Thanks for detailing more check options! :)

Cheers

-- 
Eneko Lacunza                | +34 943 569 206
                              | elacunza at binovo.es
Zuzendari teknikoa           | https://www.binovo.es
Director técnico             | Astigarragako Bidea, 2 - 2º izda.
BINOVO IT HUMAN PROJECT S.L  | oficina 10-11, 20180 Oiartzun





More information about the pve-user mailing list