OpenVZ Forum


Home » General » Support » The best way to copy a VE
The best way to copy a VE [message #15211] Sat, 21 July 2007 21:35 Go to next message
logisch is currently offline  logisch
Messages: 5
Registered: July 2007
Junior Member
Hello,
what is the best way to copy a running VE with ID xxx on the same machine.
1. Stop VE xxx
2. Copying xxx.conf to yyy.conf
3. Change yyy.conf (IP and so on)
4. Copying /private/xxx to /private/yyy
5. Copying empty directory /root/xxx to /root/yyy
6. Starting old and new VE.
That was it ... it runĀ“s by me

But is this the best and most famous way to do?

Thanks.
Steve.
Re: The best way to copy a VE [message #15217 is a reply to message #15211] Sun, 22 July 2007 22:14 Go to previous message
dayid
Messages: 6
Registered: July 2007
Location: Southeast U.S.
Junior Member
I would imagine that works.

I generally copy from machine to machine (to balance multiple hardware nodes, etc) and do:

1. rsync -avzuPe 'ssh -p ####' /vz/private/$VEID master@newmachine:/vz/private/
2. vzctl stop $VEID (stopping after sync allows it to be up while moving all the files - nice if it's a bigger VE)
3. rsync -avzuPe 'ssh -p ####' --delete /vz/private/$VEID master@newmachine:/vz/private/
4. rsync -avzuPe 'ssh -p ####' /etc/sysconfig/vz-scripts/$VEID.conf master@newmachine:/etc/sysconfig/vz-scripts/
5. ssh master@newmachine
6. (set ip or iptables nat rules)
7. vzctl start $VEID
Previous Topic: *Solved* Change openVZ kernel / Downgrade
Next Topic: GRE tunnels
Goto Forum:
  


Current Time: Mon Aug 12 02:21:43 GMT 2024

Total time taken to generate the page: 0.02875 seconds