Skip to content

Moving the Control Server

Existing control server preparation and backup

Stop the scheduler process

systemctl stop vf-schedule.timer

Put the system into maintenance mode

vfcli-ctrl down

Make a copy of the main configuration file

cat /opt/virtfusion/app/control/.env

Which should output something similar to this:

APP_KEY=base64:vBJSynHOLyOwTVP+MGk7wy0E4CVM/5do/UDB5Ij0qtk=

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE="vf_d_H2aJvrdwS6A67g62cGRw"
DB_USERNAME="vf_u_SAZJ8WOZt5cZpy3VdTtN"
DB_PASSWORD="PB4oFYFc7ucs07I7bwXTi"

WSS_STORE_TYPE=push
JWT_SIGNING_TYPE=RS256
JWT_EXPIRE_SECONDS=60
JWT_SECRET_KEY="vtw5pfOZfU2O1ljukJ31oK8yVxh7SC"
JWT_PRIVATE_KEY=/opt/virtfusion/app/control/store/jwt_rs256_signing.key
JWT_PUBLIC_KEY=/opt/virtfusion/app/control/store/jwt_rs256_signing.key.pub
WSS_LISTEN_HOST=127.0.0.1
WSS_LISTEN_PORT=6001
WSS_SECRET_KEY="P4wTuVC8BOYeOgLjcJ5FPAV4wmys8M"
WSS_REDIS_HOST=127.0.0.1
WSS_REDIS_PASSWORD=null
WSS_REDIS_PORT=6379

The APP_KEY is the most vital part of the configuration file. Without the correct key, the database will be of no use.

Backup the database

Using the database settings from the main configuration file /opt/virtfusion/app/control/.env

mysqldump --user=root DB_DATABASE > /tmp/database.sql  

Which would translate to:

mysqldump --user=root vf_d_H2aJvrdwS6A67g62cGRw > /tmp/database.sql 

Once the command has completed, a database backup called database.sql will be placed in the /tmp folder.

New control server preparation and restore

Installation

Install the control software on the new server as normal but don't log in and configure it.

Replace the app key

Edit /opt/virtfusion/app/control/.env:

nano /opt/virtfusion/app/control/.env

Replace APP_KEY with the APP_KEY from the old installation and save the configuration.

Restore the database backup

Copy the database backup you made earlier to the new server and place it in /tmp.

Use the new database credentials from /opt/virtfusion/app/control/.env to restore the backup.

mysql --user=root DB_DATABASE < /tmp/database.sql

Log in

Once logged in, you may receive a license error. You must re-issue the license to work on the new server. You may do this by logging in at account.virtfusion.com and ticking the re-issue box under your license.

Hypervisors

Communication between the control server and hypervisors will be lost due to the ip change from the old server to the new one. You will need to update the authentication file on each hypervisor.

Edit the file /opt/virtfusion/app/hypervisor/conf/auth.json:

nano -w /opt/virtfusion/app/hypervisor/conf/auth.json

It will look similar to this:

{
    "ip": "192.168.100.19",
    "token": "CqlsVq6zS4vwLQEZqlVo5tHmkgBzvdZYQ2NJnr5qyB1s2JjgYjSqR72wUYmjGcQbnTf8EWQgHnsqaUU8d8TxhPvaad2fz0zyKMxb5wmfJ9IulHQARYvqHFAabL9I56q7eMQtYSFhtRvNp4K4AmEXYUfW7HiD41fQSHgyIFpaAwP8n1TZVX59AwvIxVAvmlGYnghvvCrt",
    "hash": "bc1a53dd974e54c903399fcbe8d05550b35842ca052bc583ecb7b0fe4cf64b86"
}

Replace the ip with the new ip of the control server and save the file.

Back to top