Difference between revisions of "Cloning VE"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(See also)
(Change copy to use tar - keeps permissions intact, add change ip address)
Line 1: Line 1:
 
If you need to create an exact copy of an existing VE, these are the steps to make.
 
If you need to create an exact copy of an existing VE, these are the steps to make.
  
<pre>
+
# OLDVE=222 NEWVE=333 # Just an example
# OLDVE=222 NEWVE=333 # Just an example
+
# vzctl stop $OLDVE
# vzctl stop $OLDVE
+
# mkdir /vz/root/$NEWVE
# mkdir /vz/root/$NEWVE
+
# cp /etc/vz/conf/$OLDVE.conf /etc/vz/conf/$NEWVE.conf
# cp /etc/vz/conf/$OLDVE.conf /etc/vz/conf/$NEWVE.conf
+
# mkdir /vz/private/$NEWVE
# cp -a /vz/private/$OLDVE /vz/private/$NEWVE
+
# pushd /vz/private/$OLDVE; tar c --numeric-owner * | tar x --numeric-owner -C /vz/private/$NEWVE; popd
# vzctl start $NEWVE; vzctl start $OLDVE
+
# vi /etc/vz/conf/$NEWVE.conf # Change the IP_ADDRESS
</pre>
+
# vzctl start $NEWVE; vzctl start $OLDVE
  
 
== See also ==
 
== See also ==

Revision as of 03:38, 18 April 2007

If you need to create an exact copy of an existing VE, these are the steps to make.

# 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
# vi /etc/vz/conf/$NEWVE.conf # Change the IP_ADDRESS
# vzctl start $NEWVE; vzctl start $OLDVE

See also

The relevant services, particularly when the mySQLd encounters timeout errors, follow the following thread: