How to Unlink a Slave Server in Virtualizor: A Complete Guide

How to Unlink a Slave Server in Virtualizor: A Complete Guide

Managing a multi-server virtualization environment with Virtualizor often involves a master-slave configuration, where a master node controls one or more slave nodes. This setup is powerful for centralized management, but you may need to decommission, re-purpose, or troubleshoot a slave server. In these cases, you’ll need to properly unlink it from the master.

This guide provides a comprehensive walkthrough of the two primary methods for unlinking a slave server: the recommended GUI method and a manual, command-line approach for more stubborn situations.

The safest and cleanest way to remove a slave server is through the master server’s web interface. This process ensures that Virtualizor correctly updates its database and configurations, preventing orphaned entries.

  1. Log in to Your Master Server: Open your web browser and navigate to the Virtualizor Admin Panel for your master node. Log in with your administrator credentials.
  2. Navigate to Server Management: On the left-hand menu, go to Servers and then click on List Servers. This will display all the servers in your cluster, including the master and all connected slaves.
  3. Locate and Delete the Slave Server: Find the slave server you wish to remove from the list. On the right-hand side of the server’s entry, you will see several icons. Click the Delete icon, which typically looks like a trash can 🗑️.
  4. Confirm the Action: Virtualizor will prompt you with a confirmation dialog to prevent accidental deletion. Review the details to ensure you’re removing the correct server and then confirm the action.

Virtualizor will now handle the unlinking process automatically. It will remove the server from the cluster, delete the necessary API credentials, and clean up the database entries on the master.

Manual Unlinking: A Fix for Stubborn Connections ⚠️

Sometimes, the GUI method may fail, especially if the master server can’t communicate with the slave server (e.g., due to network issues or a downed slave). In this scenario, the master cannot send the “delete” command, and you’ll need to intervene manually.

Warning: This is an advanced method. Proceed with caution, as incorrect modifications can disrupt your Virtualizor installation. Always create backups of files before editing them.

This process involves editing key configuration files on the master server to forcefully remove all traces of the slave server’s connection.

Step 1: Connect to the Master Server via SSH

First, you need to access your master server’s command line.

ssh root@your_master_server_ip

Step 2: Navigate to the Virtualizor Configuration Directory

All the relevant files are located in the main Virtualizor directory.

cd /usr/local/virtualizor/

Step 3: Identify and Edit the Core Configuration Files

The master-slave link is defined in a few key files. By removing the slave server’s information from them, you effectively sever the connection. The primary files you need to edit are universal.php, universal.copy.php, and novnc.vnc.

First, find the exact lines containing the slave server’s IP address. Replace SLAVE_IP_ADDRESS with the actual IP.

grep -r 'SLAVE_IP_ADDRESS' /usr/local/virtualizor/

This command will show you all occurrences of the IP in the configuration files. Now, open each file with a text editor like nano or vim and remove the entire configuration block related to the slave server.

  • universal.php and universal.copy.php: These files contain the main configuration array, including the keys and IPs for all slave servers. The data is stored in a serialized PHP array. You must carefully remove the entire entry for the slave server without breaking the array’s structure.
  • novnc.vnc: This file maps VMs to their VNC proxy details. Removing the slave server’s entries from this file ensures that VNC connection attempts for its old VMs are no longer routed.

Step 4: Restart the Virtualizor Service

After you have saved your changes to the files, you must restart the Virtualizor service for the new configuration to take effect. This rereads the modified files and finalizes the unlinking process on the master’s end.

# For SystemD systems (CentOS 7+, Ubuntu 16+)
systemctl restart virtualizor

# For older systems
service virtualizor restart

At this point, the slave server should no longer appear in your master server’s control panel. The connection has been successfully broken. ✅

Finalizing the Cleanup

After unlinking, the old slave server still has Virtualizor installed and is configured in “slave mode.” To re-purpose it, you have two main options:

  1. Re-install the OS: This is the cleanest method to ensure no old configuration files are left behind.
  2. Convert to a Master: You can run the Virtualizor installation script again on the old slave machine to set it up as a standalone master node.

By following these steps, you can confidently manage your server infrastructure and ensure your Virtualizor cluster remains clean and efficient.