MIgration question

Nov 12, 2010
54
0
6
Hi,

I am wanting to know more about how openVZ containers are migrated in Proxmox.

From what I can see the CTID is removed from the source server during the migration process and I want to know if I can stop that from happening.

I was told in here before that vzmigrate uses rsync to do the migration, so I am hoping that somewhere there is a script or settings we can change to tell it to leave the source folder where it is, and sync the data only?

Cheers
MM
 
At first you can not take such action that the VMID at nodes must be unique.

But you can launch a Rsync rsync-avz /var/lib/vz/private/VMID tarjetserver:/var/lib/vz/private/VMID

And one for the. Conf

rsync-avz /var/etc/vz/conf/vmid.conf TARGET_SERVER:/var/etc/vz/conf/
 
Thanks for the reply

However that command is for manual rsync of a the container when it is shutdown. Also moving the config file will resolve what you mentioned and doing that for a <1kb file is not going to cause any impact.

What I want to know is if there is a way to either edit the scripts being run when the web interface migrates openvz containers to stop it deleting the source CTID folder for the container being migrated and therefore reducing the amount of data that is being replicated each time.

That would then allow running the command you mentioned above as a scheduled job regularly (afterhours or in the middle of the night or whenever is the least busiest time for the servers) to ensure each server has an as up-to-date copy of data as possible without having to shut them down.

This would only be for those virtual machines that might be candidates for 'frequent' migration
 
Great thanks for that

So is there a particular file i can change in Proxmox to set the vmigrate options manually? So when i click migrate in proxmox it's done with my custom switches etc?
 
i would try running

rsync -avrP --numeric-ids --delete root@<host>:/vz/private/<ctid>/ /vz/private/<ctid>

then shutdown the vm, run the rsync again and fire it up.
I use this frequently when upgrading a server. same id's on both sides, just 2 quick rsync's/vz and fire up on the other side. (unfortunately this cane be done with the UI, as it complains about that CTID existing on both nodes.)
 
Hi,

Sorry about the late reply - but yes that is what we have been doing now also.

The vzmigrate script can be edited to change certain default behaviour and therefore allow this to be done through the gui - but it's a freaking complicated script :p So we just run a manual script that accepts the CTID and to host as variables and then it does the rest (run locally on whatever host the CTID is currently running on of course).

Cheers :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!