Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Reserved Internal IP for Marketplace VMs?

There doesn't appear to be an option to select a reserved & available Internal IP for VMs created from Marketplace images - is this intentional? The dialog option does not show up; I can select an External IP, but not an Internal one despite being in the correct Region:

no_int_ip.png

I also can't add a Network Interface (as the limit is 1) to see if the option appears there.

TIA!

0 1 116
1 REPLY 1

Hi @kibbles

Welcome to Google Cloud Community! 

Here’s how to reserve static internal IP addresses which allows you to guarantee a consistent IP address for your resources. This means that even if you delete and recreate a resource, it will retain its original IP. Please note that there is a limitation on reserving Internal IP address, for more information check here the documentation.

Most likely the workaround involves completing the VM creation with the available options in the GCP interface and then adjusting the network configuration afterwards:

  1. Complete the Initial VM Creation using the current configuration, accepting the default "Ephemeral" external IP configuration in your Network Interface.

  2. After the VM is created, try to modify its network interface to use the reserved internal IP:
  • Change External IP - Optionally, you may be able to change the ephemeral external IP or configure no external IP at all.
  • Remove External IP - After the Reserved Internal IP has been assigned, you may need to Remove the external IP associated with this interface if the VM should only use a private/internal IP.
  • Save and Apply Changes - Once you have assigned the reserved internal IP address and made the necessary changes, save and apply the new configuration.
  • Reboot/Restart VM - You may need to restart the VM to ensure the network changes have been applied.

Optional, modify existing instance using cli command:

gcloud compute instances network-interfaces create [INSTANCE_NAME]  --network-interface "network=projects/[PROJECT_ID]/global/networks/[VPC_NAME],subnet=projects/[PROJECT_ID]/regions/[REGION]/subnetworks/[SUBNET_NAME],no-address=true" --zone=[ZONE_NAME] --stack-type=IPV4_ONLY --internal-ip=[RESERVED_IP_ADDRESS]
  • Replace [INSTANCE_NAME] with the name of your instance.
  • Replace [PROJECT_ID] with the id of your gcp project.
  • Replace [VPC_NAME] with the name of your VPC.
  • Replace [REGION] with the region of your subnet.
  • Replace [SUBNET_NAME] with the name of the subnet where your reserved IP resides.
  • Replace [ZONE_NAME] with the zone where the instance is located.
  • Replace [RESERVED_IP_ADDRESS] with your reserved internal IP.

Additionally, to help you create a machine image for your product to run on Compute Engine this is a recommended guide.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.