vzmigrate command for VPS migration

The vzmigrate command is used to migrate the one VPS from node to the new or another node.

For example, we want to migrate the VPS which is currently having id 110 on new node and its ip is 192.168.0.1

server@linux[~]# vzmigrate 192.168.0.1  110

or

server@linux[~]# vzmigrate -r no 192.168.0.1 110

Some time node on which,we are trying to migrate the VPS we are receiving the following error message

110 already exists on the destination node.

To resolve the above error we can assign new id to the VPS

server@linux[~]#vzmigrate -r no 192.168.0.1 110:120

The new id on the new node will be 120 for VPS

We can also do online migration of VPS from one to another node.

server@linux[~]#vzmigrate --online 192.168.0.1 110
or
server@linux[~]#vzmigrate --online 192.168.1.130 110:120

If you want to migrate all the running VPS from one node to another node then refer to following command

for CT in $(vzlist -H -o veid);
do vzmigrate --remove-area no --keep-dst $1 $CT; done

	
About Anant 384 Articles
Senior technical writer