KVM Clone

alphadog

Member
Nov 5, 2008
46
0
6
So, I have a KVM machine (Windows 2008 Server) with VMID 101. As per one or two other posts on this forum, I ssh'ed into the host used vzdump to dump out to /var/lib/vz/dump/vzdump-101.tar.

I then restore to a different VMID with vzdump --restore vzdump-101.dat 102.

Do I have to change anything in 102.conf, such as MAC address in vlan0 or ide0? Seems like I should, but the posts I've seen aren't in-depth and just say dump-and-restore, glossing over some inevitable details.

(Should be in the wiki too...)
 
I just realized that using vzdump, taking forever, did not result in a new image file.

So, what is the best way to clone a VM in Proxmox?
 
I just realized that using vzdump, taking forever, did not result in a new image file.

You should try to find out whats wrong. Currently we limit vzdump to one running instance (maybe you started 2 vzdumps?)

So, what is the best way to clone a VM in Proxmox?

Cloning a VM is always a manual task. You can copy the images (for example with vzdump), but you still need to change IPs, MAC manually. And you should even change ssh keys and such inside the VM.

I dont really know how to automate this.
 
No, just one stopped VM; I only had one VM created in the product test. But, it took 3-4 hours to back up a single 40G VM.

As for cloning "logistics", I understand having to change MACs, IPs and such, but here are two problems:
1) Where are all the settings stored? the .conf files only? Wiki doesn't document the actula "behind the scenes" very well for the industrious.
2) When you vzdump the files and restore to another VM, it does not create a second file, unless I am misunderstanding/missing a setting in the vzdump line. When I restored using the line as in my first post, it seems I just re-wrote the VM back to 101, not created a copy as 102, but a 102 entry was documented in the web interface. How do I solve that issue?

I suppose one could just create a script that dupes the actual VM, creates a new "default" conf file. The "innards" of a VM will have to be altered some other way. (Mount and modify?)
 
1) Where are all the settings stored? the .conf files only? Wiki doesn't document the actula "behind the scenes" very well for the industrious.

We are on unix, so we have manual pages ;-)

# man qm
# man vps.conf

2) When you vzdump the files and restore to another VM, it does not create a second file, unless I am misunderstanding/missing a setting in the vzdump line. When I restored using the line as in my first post, it seems I just re-wrote the VM back to 101, not created a copy as 102, but a 102 entry was documented in the web interface. How do I solve that issue?

It creates a new file here. Please can you re-test that. Here is an example:

# vzdump --restore /mnt/backup/vzdump-777.tar 600
 

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!