If you have a container that you want to move to another hardware node to help load balance your servers, this walk-through will explain how.
The first thing you need to do is setup SSH keys.
On the server that you are going to move a container FROM, run the following command:
wget http://files.soluslabs.com/solusvm/scripts/keyput.sh chmod a+x keyput.sh ./keyput.sh destination_node_ipdestination_node_port
- NOTE: The above command might be word wrapped. But it is all one single command.
- <destination_node_ip> This is the IP address of the server you are moving the container to
- <destination_node_port> This is the SSH port of the server you are moving the container to
Next, you need to find the container id (CTID). To do this, on the hardware node that the container is currently on, run the following:
vzlist -a | grep host.someserver.com
You should see an output similar to this:
228 103 running 123.123.123.123 host.someserver.com
In this case, the CTID is 228. Now that you have this number, from the server you are moving the domain from, run the following:
vzmigrate -v--ssh="-p destination_node_port"destination_node_ip 228
/scripts/vm-migrate[vserverid] [newnodeid]
- <vserverid>This is the virtual server id. To find this, login to your SolusVM, click on virtual servers -> list virtual servers -> search for the hostname. It will be the number listed under the ID column (not to be confused with the CID/XID or CTID numbers)
- <newnodeid>This is the ID number of the new hardware node you are putting it on. To find this, login to your SolusVM, click on Nodes then list. It will be the ID number listed beside the servername you moved the account to.
Example command:
/scripts/vm-migrate 155 4
This tells SolusVM that the container with an ID of 155 is now located on the hardware node with an ID of 4.