Unassign a static external IP address from a VM instance on google cloud.

0 votes
I have to unassign a static external IP address so that I can reassign the static external IP address to another resource. What's the process for unassigning?
Nov 11 by anonymous
• 4,330 points
68 views

1 answer to this question.

0 votes

You can unassign a static external IP address by deleting the instance or deleting the access config attached to the instance that is using the address. Unassigning an IP address removes it from the resource but keeps the IP address reserved to your project.

To delete an instance's access config and unassign a static external IP address, follow these steps:

  1. Get the name of the access config to delete. To get the name, perform a gcloud compute instances describe request:

    gcloud compute instances describe [INSTANCE_NAME]

    where [INSTANCE_NAME] is the name of the instance.

    The access config appears in the following format:

    networkInterfaces:
    - accessConfigs:
     - kind: compute#accessConfig
       name: external-nat
       natIP: 130.211.181.55
       type: ONE_TO_ONE_NAT
  2. Delete the access config.

    Use the instances delete-access-config sub-command:

    gcloud compute instances delete-access-config [INSTANCE_NAME] \
        --access-config-name "[ACCESS_CONFIG_NAME]"

    where:

    • [INSTANCE_NAME] is the name of the instance.

    • [ACCESS_CONFIG_NAME] is the name of the access config to delete. Make sure to include the full name between quotes.

  3. Check that your static external IP address is now available and marked as RESERVED instead of IN_USE.

    gcloud compute addresses list

    For example:

    NAME                 REGION      ADDRESS            STATUS
    example-address      [REGION]    130.211.160.207    RESERVED
    example-address-new  [REGION]    130.211.114.137    RESERVED
  4. Now that your static external IP address is available, you can choose to assign it to another instance.

answered Nov 11 by Sirajul
• 40,980 points

Related Questions

0 votes
1 answer

Creating a SQL Server instance using Google Compute engine.

Google Compute Engine provides public images preconfigured with ...READ MORE

answered Sep 23 in GCP by Sirajul
• 40,980 points
55 views
0 votes
1 answer

How do i install gcloud compute?

The gcloud compute command-line tool enables you to easily ...READ MORE

answered Sep 23 in GCP by Sirajul
• 40,980 points
72 views
0 votes
1 answer
0 votes
1 answer

How to assign a static IP address to a new VM instance?

When you create a VM instance, it ...READ MORE

answered Nov 11 in GCP by anonymous
• 40,980 points
26 views
0 votes
1 answer

“403 Insufficient Permission” while creating a Kubernetes Cluster on Google Cloud instance

To run ./cluster/kube-up.sh, you most likely need compute scope ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 45,780 points
187 views
0 votes
1 answer

Create a custom image of windows VM on Google Cloud.

Before you create the image, run GCESysprep ...READ MORE

answered Sep 24 in GCP by Sirajul
• 40,980 points
131 views