Linux guest shows the reverse sequence of attached pass through disk.

Gridsah

Member
Mar 16, 2021
11
0
6
27
The first, pve version:

Code:
# pveversion -v
proxmox-ve: 7.1-1 (running kernel: 5.13.19-2-pve)
pve-manager: 7.1-7 (running version: 7.1-7/df5740ad)
pve-kernel-helper: 7.1-6
pve-kernel-5.13: 7.1-5
pve-kernel-5.13.19-2-pve: 5.13.19-4
ceph-fuse: 14.2.21-1
corosync: 3.1.5-pve2
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown: residual config
ifupdown2: 3.1.0-1+pmx3
libjs-extjs: 7.0.0-1
libknet1: 1.22-pve2
libproxmox-acme-perl: 1.4.0
libproxmox-backup-qemu0: 1.2.0-1
libpve-access-control: 7.1-5
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.0-14
libpve-guest-common-perl: 4.0-3
libpve-http-server-perl: 4.0-4
libpve-storage-perl: 7.0-15
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 4.0.11-1
lxcfs: 4.0.11-pve1
novnc-pve: 1.2.0-3
proxmox-backup-client: 2.1.2-1
proxmox-backup-file-restore: 2.1.2-1
proxmox-mini-journalreader: 1.3-1
proxmox-widget-toolkit: 3.4-4
pve-cluster: 7.1-2
pve-container: 4.1-2
pve-docs: 7.1-2
pve-edk2-firmware: 3.20210831-2
pve-firewall: 4.2-5
pve-firmware: 3.3-3
pve-ha-manager: 3.3-1
pve-i18n: 2.6-2
pve-qemu-kvm: 6.1.0-3
pve-xtermjs: 4.12.0-1
qemu-server: 7.1-4
smartmontools: 7.2-1
spiceterm: 3.2-2
swtpm: 0.7.0~rc1+2
vncterm: 1.7-1
zfsutils-linux: 2.1.1-pve3

I have a debian 11 guest with config:

Code:
# cat /etc/pve/local/qemu-server/200.conf 
agent: 1,fstrim_cloned_disks=1
bios: ovmf
boot: order=scsi0;ide0
cores: 4
cpu: host
efidisk0: local:200/vm-200-disk-0.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K
ide0: none,media=cdrom
memory: 4096
meta: creation-qemu=6.1.0,ctime=1640270330
name: Debian11a
net0: virtio=CE:F7:31:96:52:B4,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: l26
scsi0: local:200/vm-200-disk-1.qcow2,size=16G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=bd568256-65da-4dc2-a576-d1adfdb6e68f
sockets: 1
tpmstate0: local:200/vm-200-disk-2.qcow2,size=4M,version=v2.0
vmgenid: 78c93a6c-b6b9-4937-9f51-cd5132c76651

And then I passthrough my disk to guest:

Code:
qm set 200 -scsi1 /dev/disk/by-id/nvme-INTEL_MEMPEK1J016GA_BTBT83660LKW016N
qm set 200 -scsi2 /dev/disk/by-id/nvme-INTEL_MEMPEK1J016GA_BTBT837000F9016N
qm set 200 -scsi3 /dev/disk/by-id/scsi-35000cca01a88d470
qm set 200 -scsi4 /dev/disk/by-id/scsi-35000cca01a88d304
qm set 200 -scsi5 /dev/disk/by-id/ata-HGST_HUS728T8TALE6L4_VDGW2G2D
qm set 200 -scsi6 /dev/disk/by-id/ata-HGST_HUS728T8TALE6L4_VGGP235G

So, I get 200 vm config like this:

Code:
agent: 1,fstrim_cloned_disks=1
bios: ovmf
boot: order=scsi0;ide0
cores: 4
cpu: host
efidisk0: local:200/vm-200-disk-0.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K
ide0: none,media=cdrom
memory: 4096
meta: creation-qemu=6.1.0,ctime=1640270330
name: Debian11a
net0: virtio=CE:F7:31:96:52:B4,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: l26
scsi0: local:200/vm-200-disk-1.qcow2,size=16G,ssd=1
scsi1: /dev/disk/by-id/nvme-INTEL_MEMPEK1J016GA_BTBT83660LKW016N,size=13736M
scsi2: /dev/disk/by-id/nvme-INTEL_MEMPEK1J016GA_BTBT837000F9016N,size=13736M
scsi3: /dev/disk/by-id/scsi-35000cca01a88d470,size=2930266584K
scsi4: /dev/disk/by-id/scsi-35000cca01a88d304,size=2930266584K
scsi5: /dev/disk/by-id/ata-HGST_HUS728T8TALE6L4_VDGW2G2D,size=7814026584K
scsi6: /dev/disk/by-id/ata-HGST_HUS728T8TALE6L4_VGGP235G,size=7814026584K
scsihw: virtio-scsi-pci
smbios1: uuid=bd568256-65da-4dc2-a576-d1adfdb6e68f
sockets: 1
tpmstate0: local:200/vm-200-disk-2.qcow2,size=4M,version=v2.0
vmgenid: 78c93a6c-b6b9-4937-9f51-cd5132c76651

After I boot the vm, lsblk shows this:

Code:
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   16G  0 disk
├─sda1   8:1    0  512M  0 part /boot/efi
├─sda2   8:2    0  977M  0 part /boot
└─sda3   8:3    0 14.5G  0 part /
sdb      8:16   0  7.3T  0 disk
└─sdb1   8:17   0  7.3T  0 part
sdc      8:32   0  7.3T  0 disk
└─sdc1   8:33   0  7.3T  0 part
sdd      8:48   0  2.7T  0 disk
└─sdd1   8:49   0  2.7T  0 part
sde      8:64   0  2.7T  0 disk
└─sde1   8:65   0  2.7T  0 part
sdf      8:80   0 13.4G  0 disk
└─sdf1   8:81   0 13.4G  0 part
sdg      8:96   0 13.4G  0 disk
└─sdg1   8:97   0 13.4G  0 part
sr0     11:0    1 1024M  0 rom

That shows the exact opposite order from sdb to sdg. But my last debian11 guest without uefi and tpm shows the right order.

Is that a bug or something? How can I get the right disk order?
 
As always, never rely on /dev/sd<X> being stable.
The ordering can change for whatever reason.

If you need a stable path, use /dev/disk/by-id as you do for passthrough.
 
As always, never rely on /dev/sd<X> being stable.
The ordering can change for whatever reason.

If you need a stable path, use /dev/disk/by-id as you do for passthrough.
Yes. /dev/disk/by-id is the right way. I reinstalled debian 11 with uefi boot. ( before that is bios boot)

Everything is fine except the disk sequence.

I just want to know if I encountered an bug or something wierd that I need to know.
 
Not that I know of.