[solved] kvm template: cannot clone as linked?

m.ardito

Active Member
Feb 17, 2010
1,473
12
38
Torino, Italy
Hi,
pve-manager/3.1-21/93bf03d4 (running kernel: 2.6.32-26-pve)

Code:
# pveversion -v
proxmox-ve-2.6.32: 3.1-114 (running kernel: 2.6.32-26-pve)
pve-manager: 3.1-21 (running version: 3.1-21/93bf03d4)
pve-kernel-2.6.32-20-pve: 2.6.32-100
pve-kernel-2.6.32-19-pve: 2.6.32-96
pve-kernel-2.6.32-26-pve: 2.6.32-114
pve-kernel-2.6.32-11-pve: 2.6.32-66
pve-kernel-2.6.32-23-pve: 2.6.32-109
lvm2: 2.02.98-pve4
clvm: 2.02.98-pve4
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.0-2
pve-cluster: 3.0-8
qemu-server: 3.1-8
pve-firmware: 1.0-23
libpve-common-perl: 3.0-8
libpve-access-control: 3.0-7
libpve-storage-perl: 3.0-17
pve-libspice-server1: 0.12.4-2
vncterm: 1.1-4
vzctl: 4.0-1pve4
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.4-17
ksm-control-daemon: 1.1-1
glusterfs-client: 3.4.1-1
created a basic ubuntu server kvm, from iso, converted to template:

Code:
# cat /etc/pve/nodes/pve1/qemu-server/110.conf
bootdisk: virtio0
cores: 4
ide2: none,media=cdrom
memory: 1024
name: u1204-basic
virtio0: iso_qnap:110/vm-110-disk-1.qcow2,size=8G
net0: virtio=3A:A2:28:01:DC:BC,bridge=vmbr0
ostype: l26
sockets: 1
template: 1
Now if I try to clone from this, I can only do a full clone, selecting linked makes the "clone" button greyed...

btw, iso_qnap is a nfs share.

Code:
nfs: iso_qnap
        path /mnt/pve/iso_qnap
        server 192.168.x.x
        export /iso_images
        options vers=3
        content images,iso,vztmpl,rootdir,backup
        maxfiles 2
...what is the piece I am missing? I'm sure there is one... :)

Marco

edit: I tried from qm (cli), too but no matter which options I pass, it goes full, don't know why... ?

Code:
root@pve1:~# qm clone 110 112 -description testclone -name testclone -target pve1
create full clone of drive virtio0 (iso_qnap:110/vm-110-disk-1.qcow2)
Formatting '/mnt/pve/iso_qnap/images/112/vm-112-disk-1.qcow2', fmt=qcow2 size=8589934592 encryption=off cluster_size=65536 preallocation='metadata' lazy_refcounts=off
transferred: 0 bytes remaining: 8589934592 bytes total: 8589934592 bytes progression: 0.00 %
transferred: 171798691 bytes remaining: 8418135901 bytes total: 8589934592 bytes progression: 2.00 %
transferred: 343597383 bytes remaining: 8246337209 bytes total: 8589934592 bytes progression: 4.00 %
transferred: 516255068 bytes remaining: 8073679524 bytes total: 8589934592 bytes progression: 6.01 %
^Cclone failed: copy failed: command '/usr/bin/qemu-img convert -t writeback -p -C -f qcow2 -O qcow2 /mnt/pve/iso_qnap/images/110/vm-110-disk-1.qcow2 /mnt/pve/iso_qnap/images/112/vm-112-disk-1.qcow2' failed: interrupted by signal
root@pve1:~# ^C
root@pve1:~# ls /mnt/pve/iso_qnap/images/112/
root@pve1:~# qm clone 110 112 -description testclone -name testclone -target pve1 -full 0
create full clone of drive virtio0 (iso_qnap:110/vm-110-disk-1.qcow2)
Formatting '/mnt/pve/iso_qnap/images/112/vm-112-disk-1.qcow2', fmt=qcow2 size=8589934592 encryption=off cluster_size=65536 preallocation='metadata' lazy_refcounts=off
transferred: 0 bytes remaining: 8589934592 bytes total: 8589934592 bytes progression: 0.00 %
transferred: 171798691 bytes remaining: 8418135901 bytes total: 8589934592 bytes progression: 2.00 %
transferred: 343597383 bytes remaining: 8246337209 bytes total: 8589934592 bytes progression: 4.00 %
transferred: 516255068 bytes remaining: 8073679524 bytes total: 8589934592 bytes progression: 6.01 %
transferred: 688053760 bytes remaining: 7901880832 bytes total: 8589934592 bytes progression: 8.01 %
^Cclone failed: copy failed: command '/usr/bin/qemu-img convert -t writeback -p -C -f qcow2 -O qcow2 /mnt/pve/iso_qnap/images/110/vm-110-disk-1.qcow2 /mnt/pve/iso_qnap/images/112/vm-112-disk-1.qcow2' failed: interrupted by signal
 
Last edited:

m.ardito

Active Member
Feb 17, 2010
1,473
12
38
Torino, Italy
Re: kvm template: cannot clone as linked?

some more info and a new partly working result:

VM 110 above was
- originally made with disk on lvm/iscsi
- converted to template
- when I could not create a linked clone from gui, I realized about lvm/iscsi (not permitted for linked clones)
- so i "moved" the disk of the templated 110 from lvm/iscsi to qcow2/nfs
- still I could not create a linked clone from gui
- tried cli: "qm clone 110 112 -description testclone -name testclone -target pve1 -full 0" => resulted in "create full clone of drive virtio0 (iso_qnap:110/vm-110-disk-1.qcow2)" (I interrupted the task)

so, i created another vm from iso, 111
- originally made with disk on qcow2/nfs
- converted to template
- still I could not create a linked clone from gui
- tried cli: "# qm clone 111 112 -description testclone -name testclone -target pve1 -full 0" => got:

create linked clone of drive ide0 (iso_qnap:111/base-111-disk-1.qcow2)
clone 111/base-111-disk-1.qcow2: images, vm-112-disk-1.qcow2, 112 to vm-112-disk-1.qcow2 (base=../111/base-111-disk-1.qcow2)
Formatting '/mnt/pve/iso_qnap/images/112/vm-112-disk-1.qcow2', fmt=qcow2 size=8589934592 backing_file='../111/base-111-disk-1.qcow2' encryption=off cluster_size=65536 lazy_refcounts=off

then vm 112 started, and got

~# ls -lah /mnt/pve/iso_qnap/images/112/
total 31M
drwxr-xr-x 2 root root 4.0K Nov 19 16:07 .
drwxr-xr-x 19 root root 4.0K Nov 19 16:00 ..
-rw-r--r-- 1 root root 31M Nov 19 16:11 vm-112-disk-1.qcow2

so it's a linked clone...

1) at least gui has some issue about linked clones?
2) why I a linked clone could not be created from vm 110 (this is not gui issue, even on cli qm switched to full, don't know why...)

Marco
 

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
16,491
315
83
Austria
www.proxmox.com
Re: kvm template: cannot clone as linked?

created a basic ubuntu server kvm, from iso, converted to template:

Code:
# cat /etc/pve/nodes/pve1/qemu-server/110.conf
bootdisk: virtio0
cores: 4
ide2: none,media=cdrom
memory: 1024
name: u1204-basic
virtio0: iso_qnap:110/vm-110-disk-1.qcow2,size=8G
net0: virtio=3A:A2:28:01:DC:BC,bridge=vmbr0
ostype: l26
sockets: 1
template: 1
This is simply not a template, because templates may only contain base images.
 

m.ardito

Active Member
Feb 17, 2010
1,473
12
38
Torino, Italy
Re: kvm template: cannot clone as linked?

This is simply not a template, because templates may only contain base images.
well I wrote how it was created from pve gui... and pve gui still thinks it's a template (only for full clones)
it was my lvm/iscsi disk mistake (then moved to qcow1/nfs) to trigger this "false" template config?

and vm 111:
# cat /etc/pve/local/qemu-server/111.conf
bootdisk: virtio0
cores: 4
ide0: iso_qnap:111/base-111-disk-1.qcow2,format=qcow2,size=8G
ide2: none,media=cdrom
memory: 1024
name: u1204-basic2
net0: e1000=0E:8E:AE:73:65:39,bridge=vmbr0
ostype: l26
sockets: 1
template: 1

from this vm qm creates linked clone on cli, but pve gui do not allow for...

Marco
 

m.ardito

Active Member
Feb 17, 2010
1,473
12
38
Torino, Italy
Re: kvm template: cannot clone as linked?

i tried this to make vm 110 usable by qm (still not by gui) to make linked clones:

- untemplated vm 110 (put template: 0 in 110.conf)
# cat /etc/pve/nodes/pve1/qemu-server/110.conf
bootdisk: virtio0
cores: 4
ide2: none,media=cdrom
memory: 1024
name: u1204-basic
virtio0: iso_qnap:110/vm-110-disk-1.qcow2,size=8G
net0: virtio=3A:A2:28:01:DC:BC,bridge=vmbr0
ostype: l26
sockets: 1
template: 1

- then converted vm 110 to template again (gui)

bootdisk: virtio0
cores: 4
ide2: none,media=cdrom
memory: 1024
name: u1204-basic
net0: virtio=3A:A2:28:01:DC:BC,bridge=vmbr0
ostype: l26
sockets: 1
template: 1
virtio0: iso_qnap:110/base-110-disk-1.qcow2,format=qcow2,size=8G

- then this worked
~# qm clone 110 113 -description testclone -name testclone -target pve1 -full 0
create linked clone of drive virtio0 (iso_qnap:110/base-110-disk-1.qcow2)
clone 110/base-110-disk-1.qcow2: images, vm-113-disk-1.qcow2, 113 to vm-113-disk-1.qcow2 (base=../110/base-110-disk-1.qcow2)
Formatting '/mnt/pve/iso_qnap/images/113/vm-113-disk-1.qcow2', fmt=qcow2 size=8589934592 backing_file='../110/base-110-disk-1.qcow2' encryption=off cluster_size=65536 lazy_refcounts=off

now the only missing piece is why gui does not allow linked clones from these templates... ?

Marco
 

m.ardito

Active Member
Feb 17, 2010
1,473
12
38
Torino, Italy
Re: kvm template: cannot clone as linked?

no, i've always just
- installed,
- rebooted until login prompt, then
- stop the vm and
- converted to template

Marco
 

m.ardito

Active Member
Feb 17, 2010
1,473
12
38
Torino, Italy
Re: kvm template: cannot clone as linked?

...don't know why, tried again today from gui, did not touch .confs, but today the "clone" button is active

I can switch between full and linked clone option and it stays active. and, most important works, as the cli already did yesterday...

can't guess what changed, apart for gui reload, browser cache issues?

Marco
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!