Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to clone a VPS in Virtuozzo  (Read 3451 times)

0 Members and 1 Guest are viewing this topic.

vinayakk

  • Guest
How to clone a VPS in Virtuozzo
« on: February 01, 2014, 07:00:15 pm »
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.

Code: [Select]
# 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

Code: [Select]
#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:

Code: [Select]
# 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

 :)