How to import qcow2 versus raw

Airw0lf

Member
Apr 11, 2021
78
5
13
it-visibility.net
Hi *,

I have converted vmdk images into qcow2 images.
When I try to import them, they are imported as raw image.
However, when I create a new vm with new disks, these disks are created as a qcow2 images.

Both are created on the "local" storage. Which points to /var/lib/vz.
This /var/lib/vz is actually a mount of a raid5 set being /mnt/md0 and formatted as ext4.

Is there anyone who can explain the different behavior?


With warm regards - Will
 
Last edited:
See the manual and try the "--format" argument:
qm disk import <vmid> <source> <storage> [OPTIONS]
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
 
  • Like
Reactions: Airw0lf
So lvm wise (i.e. thin provisioned by PVE or some folder on some lvm-volume) there is no difference in supported formats.
If you have a Proxmox storage object of type "dir" that points to a mountpoint, that mounts a filesystem, that was placed on LVM volume, then it doesnt matter what file format you use. Both raw and qcow are supported by PVE and the underlying layers (as listed above) do not care what the file is.
If you are using lvm-local or another LVM based storage object in PVE, then that is a block storage and you cant place a file on it, the data will always be imported as RAW.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: Airw0lf
If you have a Proxmox storage object of type "dir" that points to a mountpoint, that mounts a filesystem, that was placed on LVM volume, then it doesnt matter what file format you use. Both raw and qcow are supported by PVE and the underlying layers (as listed above) do not care what the file is.
If you are using lvm-local or another LVM based storage object in PVE, then that is a block storage and you cant place a file on it, the data will always be imported as RAW.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Great - thank you for the explenation.
Meanwhile I also tried this - works as described! :D

One last question:
What is expected to happen with the VM-configs if the mountpoint is changed?
For example from /var/lib/vz to /mnt/pve/allData?

edit:
Never mind the last question - just figured it out by (1) - change the mountpoint and (2) - modify the vm-configs by pointing the qcow2 files to the new mountpoint. This seems to do the trick.
 
Last edited: