How to clone a VPS in Virtuozzo

Cloning refers to a process of creating an exact copy (or multiple copies) of a Virtuozzo Container on the same Hardware Node. The new Container will have its own private area and root directories but the rest of the configuration parameters will be exactly the same. This means that even the parameters that should be unique for each individual Container (IP addresses, hostname, name) will be copied unchanged. You don’t have an option to specify new values during the cloning operation. Instead, you will have to clone the Container first and then update the configuration of the new Container(s) in a separate procedure.

In Virtuozzo-based systems, you can use the vzmlocal utility to copy a Container within the given Hardware Node.

# vzmlocal -C 4466:4465
Moving/copying CT#4466 -> CT#4465, [], [] …
Check disk space
Tracker started
Syncing private area ‘/vz/private/4466′->’/vz/private/4465’
OfflineManagement CT#4466 …
Stopping CT#4466 …

Message from syslogd@vzhost0** at Mar 22 04:17:31 …
ack finished successfully
Syncing tracked files from ‘/vz/private/4466/fs’ to ‘/vz/private/4465/fs’
Copying/modifying config scripts of CT#4466 …
OfflineManagement CT#4466 …
Starting CT#4466 …
vzctl : Hostname of the Container set:
ExecAction CT#4465 …
Successfully completed

Check the cloned VPS list

#vzlist -a

You can optionally specify custom private area and root directories for the new Container. To define custom private area and root paths for Container 4465, you can execute the following command:

# vzmlocal -C 4466:4465:/vz/private/dir_4465/:/vz/root/ct4465

Additional parameters can be used as per requirement :

-s, –fast-sid : allows to speed up cloning process
-d, –destroy-source : destroys the source container after making a clone
-l, –skiplock : allows to clone the locked containers

Reference :-


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s