qcow2 template, clone to LVM - possible?

matko

New Member
May 27, 2013
3
0
1
After some successful cloning processes (LVM template, LVM destination) I'm trying to improve the speed by using compressed qcow2 template instead.
The LVM is 50GB, and the compressed .qcow2 I created is 400MB, so it means essentially I read only 400MB over network (but still write 50GB to destination) instead of reading the full 50GB LVM.

I then tried to place the .qcow2 template in varios places to get proxmox web ui to pick it up, so I can use it from the gui but to no avail. I tried sticking it on both "template" (nfs) datastores and "images" (nfs) datastore, at the following paths:

/mnt/pve/templates/template/centos-minimal-try1.qcow2
/mnt/pve/os-isos/images/centos-minimal-try1.qcow2
/mnt/pve/os-isos/centos-minimal-try1.qcow2
/mnt/pve/os-isos/dump/centos-minimal-try1.qcow2

Proxmox is not picking it up, so I guess the proxmox backends reads the contents of the above directories periodically, but only expects a certain type of file names etc. Please advice!

I generated the the qcow2 file from an existing (LVM) template, using qemu-img like this:

qemu-img convert -t writeback -c -p -O qcow2 /dev/TEST01/vm-103-disk-1 -c /mnt/pve/templates/template/centos-minimal-try1.qcow2


Please advice
 
Proxmox expects '$datastore/images/<vmid>/<file>.<filename>' - in my case, /mnt/pve/os-isos/images/996.

.qcow2 didn't work out, but .raw did (which also is sparse).
 
Here is an example. MY VM us a single disk:

# qm config 106|grep '^virtio0'
virtio0: local:106/vm-106-disk-2.qcow2,format=qcow2,size=1G

The file system path is:

# pvesm path local:106/vm-106-disk-2.qcow2
/var/lib/vz/images/106/vm-106-disk-2.qcow2


After converting that to a template i get:

# qm config 106|grep '^virtio0'
virtio0: local:106/base-106-disk-2.qcow2,format=qcow2,size=1G

# pvesm path local:106/base-106-disk-2.qcow2
/var/lib/vz/images/106/base-106-disk-2.qcow2

So the trick is the the volume name starts with 'base-{VMID}-'
 
Interesting.
The part of the config from my template is virtio0: local:119/base-119-disk-1.qcow2,format=qcow2,size=7G , yet I can't clone this one to a lvm-volume, getting the message qcow2 is not supported.
 
Interesting.
The part of the config from my template is virtio0: local:119/base-119-disk-1.qcow2,format=qcow2,size=7G , yet I can't clone this one to a lvm-volume, getting the message qcow2 is not supported.

AFAIK this is already fixed in git, so this bug is fixed with the next update.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!