Difference between revisions of "Cloning VE"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(moved from cat.)
 
Line 6: Line 6:
 
# 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
# cp -r /vz/private/$OLDVE /vz/private/$NEWVE
+
# cp -a /vz/private/$OLDVE /vz/private/$NEWVE
 
# vzctl start $NEWVE; vzctl start $OLDVE
 
# vzctl start $NEWVE; vzctl start $OLDVE
 
</pre>
 
</pre>

Revision as of 20:41, 20 November 2006

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
# cp -a /vz/private/$OLDVE /vz/private/$NEWVE
# vzctl start $NEWVE; vzctl start $OLDVE

See also