[PVE-User] Disk recognition order

Emmanuel Kasper e.kasper at proxmox.com
Tue Aug 29 15:04:56 CEST 2017


Hi Uwe

On 08/29/2017 01:44 PM, Uwe Sauter wrote:
> I thought so but when setting up new VMs where the disks don't have partitions yet, there is yet nothing that you could use

Disks too have ids, not only partitions or file systems.

If you use /dev/disk/by-id in your it should be stable between reboots,
as these ids are based on the disk entries of your vm.conf.

example
on host

qm config 106 | egrep '^scsi[0-9]+'

scsi0: pveintel120:vm-106-disk-1,backup=0,discard=on,iothread=1,size=32G
scsi1: pvesam:vm-106-disk-2,size=16G
scsi12: pvesam:vm-106-disk-3,backup=0,iothread=1,size=16G

on guest

lsscsi --scsi_id | grep 'HARDDISK'

[2:0:0:0]    disk    QEMU     QEMU HARDDISK    2.5+  /dev/sda
0QEMU_QEMU_HARDDISK_drive-scsi0
[2:0:0:1]    disk    QEMU     QEMU HARDDISK    2.5+  /dev/sdc
0QEMU_QEMU_HARDDISK_drive-scsi1
[2:0:0:12]   disk    QEMU     QEMU HARDDISK    2.5+  /dev/sdb
0QEMU_QEMU_HARDDISK_drive-scsi12

you will also find this id in

/dev/disk/by-id/scsi-0<the_id>





More information about the pve-user mailing list