If an on-premises VM uses multiple IPs, you can replicate the configuration in by adding an additional Google Cloud Alias IP Range per instance. If you enable multiple IP support, Migrate for Compute Engine adds all of the IPs in the Alias IP range to the instance's NIC in Google Cloud during VM migration.
This feature is only supported for Linux VMs.
Migrate for Compute Engine supports IP address ranges of up to 32 addresses or up to 27 CIDR ranges. Google Cloud only supports an IP address range consisting of a single CIDR mask chosen from the following list:
- x.x.x.x/32 - single IP address
- x.x.x.x/31 - 2 addresses
- x.x.x.x/30 - 4 addresses
- x.x.x.x/29 - 8 addresses
- x.x.x.x/28 - 16 addresses
- x.x.x.x/27 - 32 addresses
The CIDR range must belong to that subnet's range. The range you choose cannot already be in use, even in part, by any other resource on the Virtual Private Cloud network. For more information, see the Alias IP documentation.
Enabling multiple IP support
To enable multiple IP support, set the
apply-alias-ip-ranges key to
either the project or instance metadata. Note that changes to the instance
metadata take priority over changes to the project metadata.
After you enable multiple IP support and restart the VM, the Migrate for Compute Engine package on the instance configures multiple IP addresses allocated in the Alias IP range.
After enabling support, you must also configure additional alias IPs at the instance or project level.
Option 1: Adding an alias IP range to an instance (recommended)
- Go to the VM instances page in the Google Cloud Platform Console.
- Select your instance.
- On the VM instance details page, click Edit.
- Scroll down to the Network interfaces section.
- Click Show alias IP ranges.
- Enter a Subnet range.
- Enter an Alias IP range in CIDR notation. This range must be an unused part of the primary range.
- If you would like to add additional IP ranges for this VM, click the + Add IP range button.
- Click Done.
- Click Save.
- Click Reset on the top bar of the console to restart the VM.
Option 2: Modifying project metadata
- In the Google Cloud Platform Console, select your project and select the Metadata screen.
- Set the
Migrate for Compute Engine configures the guest VM to accept connections on multiple IP addresses. As with the single-instance option, the IP addresses or ranges are set on the instance's metadata.