Move VMmanager between servers

From ISPWiki
Jump to: navigation, search

This article is out of date  

Please refer to VM import

Preliminary steps

Before you start, order the same license on VMmanager as installed on the source server. Cluster nodes must have the same number of add-ons + 1.

Complete the steps described in the article Cluster node configuration to prepare a new server.

Install VMmanager of the same version as on the old server

To learn the version of VMmanager, browse to COREmanager


Update your VMmanager to the latest release or beta version. On the new server install VMmanager of the corresponding version as described in the article:

VMmanager installation guide

On the old server running VMmanager, learn the database name, username ans password to the MySQL database

Default name of the database - vmmgr. Default username vmmgr.

grep DBName /usr/local/mgr5/etc/vmmgr.conf
grep DBUser /usr/local/mgr5/etc/vmmgr.conf
grep DBPassword /usr/local/mgr5/etc/vmmgr.conf

Make database dump on the old server

mysqldump -u<DBUser> -p<DBPassword> --all-databases > /root/vmmgr.sql; 

Move the database dump into the new server and restore the data

The commands are executed on the new server. Move the dump into the new server:

scp root@<ip_старого_сервера>:/root/vmmgr.sql /root/

Learn MySQL access details:

grep DBName /usr/local/mgr5/etc/vmmgr.conf
grep DBUser /usr/local/mgr5/etc/vmmgr.conf
grep DBPassword /usr/local/mgr5/etc/vmmgr.conf

Restore data from the damp:

mysql -u<DBUser> -p<DBPassword> < /root/vmmgr.sql

Move the remaining directories and files

The below operations are performed on the old server.

By default COREmanager and VMmanager are installed into the /usr/local/mgr5 directories. Use the rsync command. You won't need old logs and license files on the new server, however you should not delete the VMmanager configuration file as it may contain the database password:

rsync -rvz /usr/local/mgr5/ --exclude="var/*.log" --exclude="var/logs/*" --exclude="etc/vmmgr.conf" --exclude="etc/vmmgr.lic"

The OS templates are located by default in the /nfsshare directory. Check and move that directory:

grep ostemplatedir /usr/local/mgr5/etc/vmmgr.conf
scp -r /nfsshare root@<ip_нового_сервера>:/nfsshare

Move the directory with keys:

scp -r /root/.ssh root@<new_server_ip>:/root/.ssh

Possible issues:

root@vm:~# rsync -rvz /usr/local/mgr5/ --exclude="var/*.log" --exclude="var/logs/*" --exclude="etc/vmmgr.conf" --exclude="etc/vmmgr.lic"   
root@<new_server_ip>'s password: 
bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(605) [sender=3.0.9]

This error indicates that rsync is not installed on the new server. Install it from standard repositories and try to move again.

Modify ihttpd settings on the new server

As we transferred the /usr/local/mgr5 directory from the old server, we should modify the ihttpd settings.

Edit the ihttpd configuration file:

vim vim /usr/local/mgr5/etc/ihttpd.conf

Change the old IP address into a new one. You can also execute in vim:

:1,$s/ <old_ip>/ <new_ip>/g

Restart ihttpd:

service ihttpd stop
service ihttpd start

For more information about the ihttpd settings please refer to the article: Configuring built-in web-server

Make sure all of the data were transferred to the new VMmanager

Restart COREmanager to apply the changes.

killall core

Start VMmanager. All the data have been transferred (users, VM templates, OS templates and so on). Assign all the nodes of the old server as cluster nodes. You can see a list of virtual machines.

Connect а new cluster node

If virtual machines we located on the local storage-file system, transfer them to the new server, add the cluster node with the IO of our new sever.

Cluster settings -> Cluster nodes -> button "Add".

After the new cluster node is added, in the Virtual machines module you will see the icon "Migration". Use this function to transfer virtual containers from the old cluster node to a new one.

Once you completed the transfer, you may disable the old cluster node.

Make sure all of the virtual machines are up and running.