How to correctly clone KVM on another node

solidus

New Member
Jul 28, 2015
4
0
1
Hello! This is my first post and I am very satisfied with the discovery and use of Proxmox. I am still studying the Virtual Environment and all of its possibilities

I encountered some problems with the cloning of a KVM windows machine. Let me explain

Environment:
Proxmox version 3.2
Cluster with 2 nodes

Objective:
Clone of a KVM windows machine on another node via command line on a non-HA environment


Results:

qm clone <source_VMID> <destination_VMID> -name <destination_KVM_name> -target <destination_node>

The command works well but when i try to start the KVM on the destination node i get an "TASK ERROR: storage '<source_node>-storage' is not available on node '<destination_node>'


Any help is very appreciated, thanks
 
Hi solidus.

As the error message says, the storage on which the cloned VM image resides is not available/accessible by the second node.

If you want the cloning (from one to the other node) to work properly, you need to use a shared storage (like NFS, iSCSI, ... ) to hold the disk images.

As Thomas proposed, you can also try to use the "-full 1" option to force the creation of a full copy of the disk(s).


Best regards,

Alen


Do you already have a Commercial Support Subscription? - If not, Buy now
 
Last edited:
As the error seems a bit strange, we dug a bit into it and it looks like your target Node hasn't access to the storage where the VM gets cloned.
Look into Datacenter->Storage and Edit the storage you use as clone target, should be the one where your VM is.
There is a "Nodes" field, look if the target node is checked in there, if it's not, it hasn't access to this storage and the error makes sense.

Please report back if this solved your error.
 
@ alen

It is a non-HA environment without NFS, iSCSI, etc

All storages are local and marked as Shared (I dont know if its just a mark from the web-GUI and so is ineffective)



@ t.lamprecht

I tried the command with the "-full 1" parameter but it seems to be ignored

" qm clone <source_VMID> <destination_VMID> -name <destination_KVM_name> -target <destination_node> -full 1 " does not copy the volume to the new node

as I can confirm it during the remove of the clone machine on the new node I get the following output
------------------
#qm destroy 127
disk image '/var/lib/vz/images/127/vm-127-disk-2.raw' does not exists
------------------


As you suggested I added the following:
--------------
Look into Datacenter->Storage and Edit the storage you use as clone target, should be the one where your VM is.
There is a "Nodes" field, look if the target node is checked in there, if it's not, it hasn't access to this storage and the error makes sense.
--------------
and after that the storage "<source_node>-storage" appeared listed under "<destination_node>" as "<source_node>-storage (<destination_node>)"
but the size is very low compared to the shared "<source_node>-storage (<source_node>)"
also i retried the "qm clone" but the result is the same, no virtual disk "copied" on the new node

I there a way to bypass this via command line? maybe an rsync of the disk after the clone is terminated?


thank you very much
 
I removed the 'shared' flag but now its impossible to clone

----
can't clone VM to node '<destination_node>' (VM uses local storage)
----

So I am wondering if marking the storages as 'shared', making the clone and doing an rsync of the raw image (with stopped KVM) I can make this possible

Could this have any sense for you?

thanks
 
Ok I tried to make a full clone from the web-GUI but in the "Clone VM <VMID>" window where to insert the settings of the clone i cannot see in "Target Storage:" the local storage of the second node (in "Target Node:" i have already selected the second node)

Anyway i tried to launch it from command line
" qm clone <source_VMID> <destination_VMID> -name <destination_KVM_name> -target <destination_node> -full 1 "
but i still get the message
" can't clone VM to node '<destination_node>' (VM uses local storage) "
 
Is there any method to do this job by a shared storage with 1 Gb/s switch?
also which storage type is better for that?
 

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!