Difference between revisions of "Ovz container live migration"

From vpsget wiki
Jump to: navigation, search
Line 36: Line 36:
  
 
  /scripts/vm-migrate [VSERVERID] [NEWNODEID]
 
  /scripts/vm-migrate [VSERVERID] [NEWNODEID]
 +
 +
RUN this command on the SolusVM master server!
  
 
Example:
 
Example:
Line 41: Line 43:
 
   Virtual server information updated!
 
   Virtual server information updated!
  
Please NOTE: container ID and VSERVERID could be differ to get VSERVERID you should simply take a look on it in SolusVM CP or in WHMCS panel.
+
Please NOTE: container ID (CTID) and VSERVERID are differ (in most cases) to get VSERVERID you should simply take a look on it in SolusVM CP or in WHMCS panel or from solusvm database:
 +
select vserverid from vservers where ctid=892;
 +
 
  
 
As you can see in our example the VSERVERID and container_ID are differ.
 
As you can see in our example the VSERVERID and container_ID are differ.
 
 
  
  

Revision as of 11:48, 9 July 2014

Here we'll shortly describe how to migrate container from one node to another.

using openvz and solusvm CP.

For more details please refer to the next links:

http://docs.solusvm.com/migrating_openvz_containers

https://openvz.org/Migration_from_one_HN_to_another


We are assuming that the ssh keys are already configured.

you need to find the container ID. you can find it by name or by ip. For example let's find it by ip:

vzlist -a | grep <IP>

After that we can use vzmigrate with --live option to make migration w/o container stops:

vzmigrate --live --ssh="-p <port_number>" <destination_node_ip> <container_ID>

Example:

vzmigrate --live --ssh="-p 7822" 192.168.1.1 892

Note if you are using differ ssh port please change it. if you are using standart ssh port - you can simply remove ssh section from the current command.

You will see output :

Starting live migration of CT 892 to 192.168.1.1
Preparing remote node
Initializing remote quota
Syncing private
Live migrating container...
Syncing 2nd level quota
Cleaning up

After that you will need to update your SolusVM master so it knows where the VPS has been moved to:

/scripts/vm-migrate [VSERVERID] [NEWNODEID]

RUN this command on the SolusVM master server!

Example:

/scripts/vm-migrate 885 2
 Virtual server information updated!

Please NOTE: container ID (CTID) and VSERVERID are differ (in most cases) to get VSERVERID you should simply take a look on it in SolusVM CP or in WHMCS panel or from solusvm database:

select vserverid from vservers where ctid=892;


As you can see in our example the VSERVERID and container_ID are differ.



""