User Tools

Site Tools


openvz:restoring-containers

Restoring an OpenVZ container from a backup

On the server where you want to restore the VM, type:

vzrestore /vz/dump/vzdump-openvz-1101-2010_06_17-18_05_42.tgz 1201

where 1201 is the new VEID of the restored VM, you can use any VEID that is unused the server, you could even use 1101 again if it is unused.
If you don't want to modify the settings of the VM (e.g. IP address, hostname), you can start it now, but please make sure that the original VM is stopped on th first server, because otherwise the IP addresses conflict

vzctl start 1201

If you want to run both VMs (the original one and the clone) at the same time, you must change the IP address and hostname of the clone before you start it. To set a new hostname, type something like this

vzctl set 1201 --hostname test2.dw.lan --save

To set a new IP address, we must first delete the original one…

vzctl set 1201 --ipdel 192.168.0.101 --save

… and then set a new one

vzctl set 1201 --ipadd 192.168.0.201 --save

Afterwards we can start the clone

vzctl start 1201
openvz/restoring-containers.txt · Last modified: 2010-08-24 11:41 (external edit)