Nessa dica rápida iremos aprender como anexar um disco físico do seu servidor proxmox dentro de um maquina virtual.
Essa dica também é conhecida Como fazer Passthrough de HD.
1ª Passo – Listar os HD’s fisicamente para isso utilize os comando lsblk
proxmox01:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 447,1G 0 disk ├─sda1 8:1 0 446,2G 0 part / ├─sda2 8:2 0 1K 0 part └─sda5 8:5 0 976M 0 part [SWAP] sdb 8:16 0 931,5G 0 disk ├─sdb1 8:17 0 300M 0 part ├─sdb2 8:18 0 100M 0 part ├─sdb3 8:19 0 128M 0 part ├─sdb4 8:20 0 146G 0 part └─sdb5 8:21 0 785G 0 part sdc 8:32 0 931,5G 0 disk ├─sdc1 8:33 0 300M 0 part ├─sdc2 8:34 0 100M 0 part ├─sdc3 8:35 0 128M 0 part ├─sdc4 8:36 0 146G 0 part └─sdc5 8:37 0 785G 0 part sdd 8:48 0 1,8T 0 disk ├─sdd1 8:49 0 128M 0 part └─sdd2 8:50 0 1,8T 0 part sr0 11:0 1 1024M 0 rom
2ª Passo – Identificar os HD’s fisicamente para isso utilize os comando ls -lha /dev/disk/by-id
ls -lha /dev/disk/by-id/ total 0 drwxr-xr-x 2 root root 820 out 14 13:18 . drwxr-xr-x 9 root root 180 out 14 13:18 .. lrwxrwxrwx 1 root root 9 out 11 09:48 ata-hp_DVDRAM_GUB0N_KMGF58F2532 -> ../../sr0 lrwxrwxrwx 1 root root 9 out 11 09:48 ata-KINGSTON_SEDC600M480G_50026B7686B8050C -> ../../sda lrwxrwxrwx 1 root root 10 out 11 09:48 ata-KINGSTON_SEDC600M480G_50026B7686B8050C-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 out 11 09:48 ata-KINGSTON_SEDC600M480G_50026B7686B8050C-part2 -> ../../sda2 lrwxrwxrwx 1 root root 10 out 11 09:48 ata-KINGSTON_SEDC600M480G_50026B7686B8050C-part5 -> ../../sda5 lrwxrwxrwx 1 root root 9 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX -> ../../sdb lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part1 -> ../../sdb1 lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part2 -> ../../sdb2 lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part3 -> ../../sdb3 lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part4 -> ../../sdb4 lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part5 -> ../../sdb5 lrwxrwxrwx 1 root root 9 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E -> ../../sdc lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part1 -> ../../sdc1 lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part2 -> ../../sdc2 lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part3 -> ../../sdc3 lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part4 -> ../../sdc4 lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part5 -> ../../sdc5 lrwxrwxrwx 1 root root 9 out 14 13:18 ata-MB2000GDUNV_26CBK12XF1BA -> ../../sdd lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB2000GDUNV_26CBK12XF1BA-part1 -> ../../sdd1 lrwxrwxrwx 1 root root 10 out 14 13:18 ata-MB2000GDUNV_26CBK12XF1BA-part2 -> ../../sdd2 lrwxrwxrwx 1 root root 9 out 14 13:18 wwn-0x50000396dbc008fa -> ../../sdd lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x50000396dbc008fa-part1 -> ../../sdd1 lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x50000396dbc008fa-part2 -> ../../sdd2 lrwxrwxrwx 1 root root 9 out 14 13:18 wwn-0x5000c50086fee3f7 -> ../../sdb lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c50086fee3f7-part1 -> ../../sdb1 lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c50086fee3f7-part2 -> ../../sdb2 lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c50086fee3f7-part3 -> ../../sdb3 lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c50086fee3f7-part4 -> ../../sdb4 lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c50086fee3f7-part5 -> ../../sdb5 lrwxrwxrwx 1 root root 9 out 14 13:18 wwn-0x5000c5008798a3d3 -> ../../sdc lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c5008798a3d3-part1 -> ../../sdc1 lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c5008798a3d3-part2 -> ../../sdc2 lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c5008798a3d3-part3 -> ../../sdc3 lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c5008798a3d3-part4 -> ../../sdc4 lrwxrwxrwx 1 root root 10 out 14 13:18 wwn-0x5000c5008798a3d3-part5 -> ../../sdc5 lrwxrwxrwx 1 root root 9 out 11 09:48 wwn-0x50026b7686b8050c -> ../../sda lrwxrwxrwx 1 root root 10 out 11 09:48 wwn-0x50026b7686b8050c-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 out 11 09:48 wwn-0x50026b7686b8050c-part2 -> ../../sda2 lrwxrwxrwx 1 root root 10 out 11 09:48 wwn-0x50026b7686b8050c-part5 -> ../../sda5
3ª Passo – Agora iremos anexar os discos a vm com o seguinte comando, para isso efeteu login como administrador no shell do seu servidor linux.
qm set 100 -sata3 /dev/disk/by-id/wwn-0x5000c5008798a3d3
Onde:
- qm set = Comando do proxmox para configurar um Host Guest
- 100 = ID do Host ( no meu caso um servidor Windows)
- -sataX = -Tipo de controladora que vai ser utilizada, pode ser sata ou scsi o X representa o número
- /dev/disk/by-id/wwn-0x5000c5008798a3d3 = E por fim o identifacador do disco, pode ser o wwn- ou ata- ( /dev/disk/by-id/wwn-0x5000c5008798a3d3 ou ata-MB2000GDUNV_26CBK12XF1BA) tanto faz.
Sobre o Autor