Articles in this section

How to migrate VPS to a new IP block (subnet) in SolusVM 2?

Applicable to:

  • SolusVM 2

Question

How to move VPS from the current IP block (subnet) to a new IP block on a Compute Resource in SolusVM 2 with minimal downtime?

Answer

SolusVM 2 has no single "change subnet" action. The migration is done per VPS: add an IP from the new IP block, make it the main IP, then remove the old IP.

Prerequisites
  • The new subnet is routed to the Compute Resource at the datacenter/network level, and its gateway, netmask and name servers are known.
  • SolusVM 2 is updated to the latest version. Older versions could fail to change the main IP when the old and new IP blocks have different gateways (SIO-4087, fixed in 1.1.23509).
  • The plan of every VPS being migrated has Offer additional IP addresses enabled (Compute Resources > Plans > Edit Plan). It is required to add an IP to a VPS and can be disabled again afterwards (feature request SIO-4096).
Step 1. Add the new IP block to the Compute Resource
  1. Go to Network > Add IP Block.
  2. Specify the name, the first and last IP addresses, gateway, netmask and primary/secondary name servers.
  3. Select the Compute Resource(s) to assign the block to and click Save.

SVM_WARN: See also: How to add an IP block in SolusVM 2.

If the IP address of the Compute Resource itself belongs to the new range, see Unable to add an IP block to a Compute Resource when the Compute Resource's IP address falls within the specified IP block.

Step 2. Add an IP from the new block to the VPS
  1. Go to Virtual Servers > the necessary VPS > Networking.
  2. Click Add IP and then Create. The next available IP address is assigned to the VPS.

Note: The VPS is temporarily unavailable while the IP is being added. The IP cannot be changed on a running VPS: if the task fails with "failed to update network for virtual server", stop the VPS, add the IP again and start the VPS (article).
The IP is taken from an IP block available on the Compute Resource. SolusVM 2 does not support IP block priority (SIO-5140) or selecting the IP block when adding an IP. If the old block still has free IP addresses, verify that the new IP is taken from the new block before proceeding. See "Step 6" for how to avoid mixing blocks.

Step 3. Make the new IP the main IP
  1. Open Virtual Servers > the necessary VPS > Networking.
  2. Select the new IP and click Change in the pop-up window.

SVM_WARN: See also: How to change main IP address for a virtual machine in SolusVM 2.

Step 4. Reboot the VPS, verify, and remove the old IP
  1. Reboot the VPS so that the guest OS picks up the new network configuration (recommended).
  2. Verify that the VPS is reachable through the new IP, and that services and DNS/rDNS (PTR) records use it.
  3. In Networking, click the trash icon next to the old IP and confirm.

Removing an IP can break software configured to use it (for example, web server virtual hosts), so reconfigure such services first.

Step 5. Repeat for every VPS

Repeat Steps 2-4 for each VPS on the Compute Resource. Migrating in batches helps to limit the impact if something is wrong with the new subnet routing.

Step 6. Retire the old IP block

It is not possible to set the new IP block as the default for new VPS: IP block priority (SIO-5140) and locking an IP block (SIO-5141) are not supported in SolusVM 2. To make sure new VPS and newly added IPs do not use the old block:

  1. Make sure no VPS uses IPs from the old block.
  2. Delete the old IP block in Network, or unassign it from the Compute Resource by editing the block.

If the Delete button is greyed out because of the reserved gateway IP inside the range, change the gateway of the block to an address outside of the range first (article).

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.