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, 2019 by anonymous
• 6,260 points
3,518 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.

Hope this helped!!

To know more about Google Cloud, It is recommended to go for Google Cloud Certification training today.

Thank you!

answered Nov 11, 2019 by Sirajul
• 59,230 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, 2019 in GCP by Sirajul
• 59,230 points
2,997 views
0 votes
1 answer
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, 2019 in GCP by Sirajul
• 59,230 points

edited Jun 16, 2023 by Khan Sarfaraz 1,315 views
0 votes
1 answer
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, 2019 in GCP by anonymous
• 59,230 points
2,933 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
• 52,350 points
1,413 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, 2019 in GCP by Sirajul
• 59,230 points
3,809 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP