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’
done
OfflineManagement CT#4466 …
done
Stopping CT#4466 …

Message from syslogd@vzhost0** at Mar 22 04:17:31 …
ack finished successfully
done
Syncing tracked files from ‘/vz/private/4466/fs’ to ‘/vz/private/4465/fs’
done
Copying/modifying config scripts of CT#4466 …
OfflineManagement CT#4466 …
done
Starting CT#4466 …
vzctl : Hostname of the Container set: server.renjith.com
done
ExecAction CT#4465 …
done
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 :-
http://download.swsoft.com/virtuozzo/virtuozzo4.0/docs/en/lin/VzLinuxUG/16260.htm
http://download.swsoft.com/virtuozzo/virtuozzo4.0/docs/en/VZAgent_ProgGuide/21033.htm

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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