Duplicate OpenVZ container

From vpsget wiki
Revision as of 18:38, 3 February 2016 by Ndi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to duplicate container

It's not critical but better to pause or turn off original container before backup/copy

for example original CT ID = 111 and we'll dublicate it in CT ID 222

mkdir /vz/private/222
cp -avr /vz/private/111/* /vz/private/222/
cp /etc/vz/conf/111.conf /etc/vz/conf/222.conf

now edit 222.conf and change IP address and you can start it after.


In case you get any quota related issues try to run this command:

lsof 2> /dev/null | egrep '/vz/root/222|/vz/private/222'

if you see output like:

cp          94846     root    4w      REG                9,2       14540    4863092 /vz/private/3030/epel-release-6-8.noarch.rpm

simply kill PID:

kill -9 94846


""