Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Cloning VE

39 bytes added, 10:18, 9 July 2016
no edit summary
If you need to create an exact copy of an existing VE, these are the steps to make.
Execute these commands as root.
# <source lang="bash">OLDVE=222 NEWVE=333 # Just an example # vzctl stop $OLDVE # mkdir /vz/root/$NEWVE # cp /etc/vz/conf/$OLDVE.conf /etc/vz/conf/$NEWVE.conf # mkdir /vz/private/$NEWVE # pushd /vz/private/$OLDVE; tar c --numeric-owner * | tar x --numeric-owner -C /vz/private/$NEWVE; popd # nano /etc/vz/conf/$NEWVE.conf # Change the all CTIDs from the old CT to the cloned one. And change the IP. # vzctl start $NEWVE; vzctl start $OLDVE</source>
In case you are making bridge don't forget, before start the VEs, to change host_ifname=veth$OLDVE by host_ifname=veth$NEWVE in the /etc/vz/conf/$NEWVE.conf file
Anonymous user