Import dilemma

andersostling56

Active Member
Aug 2, 2020
29
3
43
70
Hi. Hope that someone can guide me here. I have to import a number of VM's from a Debian/KVM host to a PVE. The original files are a mix of qcow2 and raw format.

When I imported the first Windows VM (server 2019) using qm importdisk I was unable to boot it. I created the VM in PVE without an attached disk, and connected it later on in the GUI to a virtual disk adapter. However, I feel a bit lost when I were to select disk type (virtio, sata, scsci etc).

Any reference to a step by step guide would be much appreciated

root@pve:/store/import/2024-11-04.213041# qemu-img info HP-SRV02-C.qcow2

image: HP-SRV02-C.qcow2
file format: qcow2
virtual size: 50 GiB (53687091200 bytes)
disk size: 46.3 GiB
cluster_size: 65536
Format specific information:
compat: 1.1
compression type: zlib
lazy refcounts: false
refcount bits: 16
corrupt: false
extended l2: false
Child node '/file':
filename: HP-SRV02-C.qcow2
protocol type: file
file length: 46.3 GiB (49684021248 bytes)
disk size: 46.3 GiB

root@pve:/store/import/2024-11-04.213041# qemu-img info HP-SRV02-D.raw
image: HP-SRV02-D.raw
file format: raw
virtual size: 77.1 GiB (82753880064 bytes)
disk size: 77.1 GiB
Child node '/file':
filename: HP-SRV02-D.raw
protocol type: file
file length: 77.1 GiB (82753880064 bytes)
disk size: 77.1 GiB

The associated XML file from the KVM server looks like this

<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/HP-SRV02-C.qcow2' index='3'/>
<backingStore/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/HP-SRV02-D.raw' index='2'/>
<backingStore/>
<target dev='vdb' bus='virtio'/>
<alias name='virtio-disk1'/>
<address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
</disk>
 
Hope my answer will be helpful to you.
Migrate steps:
  • Create the VM in Proxmox: Set the same specs (CPU, RAM, etc.) as the original KVM VM, but don't attach any disks.
  • Use "qm importdisk" to import the disk.
    In the Proxmox web interface, select the VM and attach the imported disk. (Windows VMs recommended to use the SCSI interface).
  • (if using VirtIO or SCSI) Windows may need the appropriate drivers for VirtIO or SCSI.
 
Hope my answer will be helpful to you.
Migrate steps:
  • Create the VM in Proxmox: Set the same specs (CPU, RAM, etc.) as the original KVM VM, but don't attach any disks.
  • Use "qm importdisk" to import the disk.
    In the Proxmox web interface, select the VM and attach the imported disk. (Windows VMs recommended to use the SCSI interface).
  • (if using VirtIO or SCSI) Windows may need the appropriate drivers for VirtIO or SCSI.
I had to add an extra step after creating the "blank" VM. Even if one chose to not add a disk, an empty SCSI adapter is created. By removing this one before importing and attaching the images, I was able to fix this and import all 7 VM's successfully.
Thank you for replying!
/Anders
 
  • Like
Reactions: Magnus-mercer