0

I'm working on a migration plan in GCP where we have some VMs in a project that has its own VPC. We are setting up a Shared VPC and want to move the VMs to the new VPC. However, the system owners want to maintain the existing IPs (i.e. the VPCs each have the same subnet IP ranges). There are about 30 machines that need to be migrated so shutting everything off and migrating them would be challenging. The owners want us to migrate some of the VMs each day.

Of course, the current project has a VPN configured to connect the On-prem. When we stand up the VPN in the Shared VPC I believe that, alone, will cause problems, because the routes that are exchanged will cause the On-Prem to have two routes to the same subnet IP range.

Are there ways to configure the routes to tightly restrict this? For example, define routes for each IP as we move it from one VPC to another?

John Hanley
  • 74,467
  • 6
  • 95
  • 159

1 Answers1

1

Scenario: The VMs are located in a Shared VPC.

Shared VPCs cannot have overlapping subnets. Therefore, you cannot migrate VMs between subnets and maintain the same private IP address.

Scenario: The VMs are located in independent VPCs.

You can allocate a private IP address when creating a new VM instance. Shut down the existing VM, create an image of the VM. Then create a new VM, reserve a static private IP address (under Primary Internal IP), and specify the image for the source boot disk.

However, you cannot specify overlapping or duplicate addresses for your VPN. This means that the migrated VMs will not be accessible to the VPN until you reconfigure the VPN.

My recommendation is to not even try to maintain the same private IP address. Migrate the VMs to the new VPC and reconfigure name resolution to use the new IP addressses.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
  • Thanks, your suggestion makes complete sense. Unfortunately, the systems were configured without DNS and applications hard-coded the IPs. Sounds like some pain is coming! – Terry Chambers - Onix Nov 23 '21 at 21:42