qm importdisk <vmid> <source> <storage>
Import an external disk image as an unused disk in a VM. The image format has to be supported by qemu-img(1).
<vmid>: <integer> (1 - N)
The (unique) ID of the VM.
<source>: <string>
Path to the disk image to import
<storage>: <string>
Target storage ID
--format <qcow2 | raw | vmdk>
Target format
dd
.dd
: The command qm rescan
checks if there are VM disks on the storages that fit the naming schema of the virtual machines and add them to the config if they are missingqm rescan
should find the respective disk images on the LVM storage.➜ ~ qm list # Shows which VMs are on your Proxmox VE host
VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID
100 pve stopped 4096 16.00 0
101 Windows10 stopped 4096 0.00 0
102 Windows10 stopped 4096 0.00 0
➜ ~ lvs # List content of your LVM storages
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve twi-aotz-- <64.75g 7.64 1.81
root pve -wi-ao---- 150.00g
swap pve -wi-ao---- 8.00g
vm-105-disk-0 pve Vwi-a-tz-- 500.00g data 0.99
➜ ~ qm create 105 # Create a new VM with ID 105
➜ ~ qm rescan --vmid 105 # Add missing volumes to the VM
rescan volumes...
VM 105 add unreferenced volume 'local-lvm:vm-105-disk-0' as 'unused0' to config
➜ ~ qm config 105 # Show configuration of the VM
boot:
smbios1: uuid=a548df63-660a-42ff-83ab-5dae7b9794bf
unused0: local-lvm:vm-105-disk-0
vmgenid: 31854cdd-5196-4f7e-8ebf-aae324ae0b41