which steps to clone openvz machines?

m.ardito

Famous Member
Feb 17, 2010
1,473
17
103
Torino, Italy
Hi,

My experience with openvz is very low, since i used mostly kvm until now.

i recently successfully created an openvz vm, based on the ubuntu 8.04 template, to provide a simple service to my network. I kept pretty much anything with defaults.

now, i wish to check if a backup of this openvz machine is good and restorable: you never know..., this happened sometimes during tests with some kvm machine . ok, i could have done errors during the backup process there, but now i just want to double check my critical machines, so i think to restore their backup as _another_ machine, since i have the "real" vm running on the same host/network.

this said, i have to "clone" the restored openvz vm to a free VMID, an then for sure have to change IP and hostname, just to be able to boot it and test that all is running fine, etc.

what exactly I have to do, in the openvz case? I can manage kvm machines, but with openvz I'm a bit lost and don't want to mess up anything...

Thanks, Marco
 
do a vzrestore to a new VMID, then go the web interface and change IP and hostname, that´s it on the Proxmox VE side.
 
thanks tom, from pve gui i can easily change the hostname, but about the IP address: I already see a
Bridged Ethernet Device, eth0, bound to vmbr0, with no IP info....? How should I perform IP change?

Marco
 
Last edited:
See virtual machine configuration/network (in the case of venet, default).

If you use veth, you need to change the IP inside the container.
 
Sorry, I AM looking at virtual machine configuration/network:

Clipboard01.jpg
but can't see any IP specified there, I may be confused is this venet or veth?

Marco
 
this is veth. so configure it inside.
 
oh, ok. Now i have restored my backup to another VMID. original vm had eth>vmbr0 configured.
i changed vmbr on the new vm from pve gui, to avoid network conflict withe the producion vm, so that now is eth0>vmbr10 (this is a fake network for kvm machines, and has no host ethx)

but if i start the vm it suddenly stops:
Code:
proxmox1:~# vzctl start 109
Starting container ...
Container is mounted
Adding IP address(es):
Setting CPU units: 1000
Setting CPUs: 1
Set hostname: openvzmwserve.proxmox
File resolv.conf was modified
Setting quota ugidlimit: 0
Configure veth devices: veth117.0
Unable to create veth: File exists
Container start failed
Stopping container ...
Container was stopped
Container is unmounted
so i can't change the ip from inside... sorry i'm trying to use my kvm knowledge to understand this but i feel it is totally different...

do i need to attach to openvz vm eth to a host vmbr bridged with a real host eth to make it work?

Marco
 
so i can't change the ip from inside... sorry i'm trying to use my kvm knowledge to understand this but i feel it is totally different...

You can - it's a container. Just edit the file before you start the container:

# vi /var/lib/vz/private/<VMID>/etc/network/interfaces

(above is for a debian based container)
 
Oh... yes, of course...!! I completely forgot the main difference... :)

So, in the "veth" i can use this method. Does it works also for "venet"? (ignorance growing here...)

I've read somewhere that venet (default) is easier but doesn't allow distinctive MACs, and that is bad of course in hosted environments, because the hoster could detect and block this behaviour, and that in those case is better to use veth. Is there any other consideration to take when deciding if use veth or venet?

I'v tried reading openvz wiki but find it quite difficult to focus just on those point related to a pve installation, instead of a "regular" openvz environment. I find myself always asking: "how is this related to pve"? I know it must be a limit of mines... :)

Thanks, Marco
 
Oh... yes, of course...!! I completely forgot the main difference... :)

So, in the "veth" i can use this method. Does it works also for "venet"? (ignorance growing here...)

No, You can change the IP one the web interface when using venet.

I've read somewhere that venet (default) is easier but doesn't allow distinctive MACs, and that is bad of course in hosted environments, because the hoster could detect and block this behaviour, and that in those case is better to use veth. Is there any other consideration to take when deciding if use veth or venet?

I'v tried reading openvz wiki but find it quite difficult to focus just on those point related to a pve installation, instead of a "regular" openvz environment. I find myself always asking: "how is this related to pve"? I know it must be a limit of mines... :)

There is nothing special in PVE - it behaves like a regular openvz environment.

http://wiki.openvz.org/Differences_between_venet_and_veth
 

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!