Clone Template Disk Image in Cluster via command line

Densha

Member
Dec 13, 2017
5
0
6
54
Hi Forum

I am new to PVE. I have two servers configured as a cluster. I have created a template on the one of the nodes and I want to clone instances of this template to the second node. I tried via the GUI, by selecting the second node in the drop down and full clone, but the clone selection button does not activate.

The VM I wish to clone is

# cat /etc/pve/qemu-server/600.conf
balloon: 512
bootdisk: virtio0
cores: 1
ide2: none,media=cdrom
memory: 1024
name: abc-template
net0: virtio=0E:3D:6E:02:80:FA,bridge=vmbr1,tag=564
numa: 0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=d9019ad2-f0ad-483b-8631-aa20787fbd37
sockets: 1
template: 1
virtio0: local-lvm:base-600-disk-1,size=16G


#pvesm path local-lvm:base-600-disk-1
/dev/pve/base-600-disk-1



The status of my cluster is
# pvecm status
Quorum information
------------------
Date: Tue Mar 13 19:49:57 2018
Quorum provider: corosync_votequorum
Nodes: 2
Node ID: 0x00000001
Ring ID: 2/60
Quorate: Yes

Votequorum information
----------------------
Expected votes: 2
Highest expected: 2
Total votes: 2
Quorum: 2
Flags: Quorate

Membership information
----------------------
Nodeid Votes Name
0x00000002 1 10.10.10.88
0x00000001 1 10.10.1089 (local)


How can I clone the VM from first node to second node?

What is the command line to be able to do this?

Thanks

Densha
 
do you have the 'local-lvm' storage on both nodes? if not, you have to select the target storage to clone it, also this will only work offline, meaning the vm has to be shut down first
 
Dominik

Yes both nodes have local-lvm from the GUI. Is there a pve command I should run to confirm - that I can attach output.

The VM was/is shutdown and has been converted to template. I can clone the template on the node that it is running.

Densha
 
what exactly is shown on the clone window?

also please post the content of your /etc/pve/storage.cfg
 
Compute1 is the node with the template I wish to clone to Compute2.

The storage.cfg file is the same on both servers.

I have attached screen shot of the clone-window. The clone icon does not become active.

root@compute1:~# cat /etc/pve/storage.cfg
dir: local
path /var/lib/vz
content iso,vztmpl,backup

lvmthin: local-lvm
thinpool data
vgname pve
content rootdir,images

root@compute2:~# cat /etc/pve/storage.cfg
dir: local
path /var/lib/vz
content iso,vztmpl,backup

lvmthin: local-lvm
thinpool data
vgname pve
content rootdir,images
 

Attachments

  • clone-window.png
    clone-window.png
    14.4 KB · Views: 2
ok i just checked, and clone of a vm with local storage is not possible across nodes

you can do however the following:

clone the vm locally, migrate the clone
backup and restore on the target node