Choosing an existing internal IP address for an instance at the time of its creation

0 votes
I already have an IP address, How can I assign it to an instance at the time of its creation?
Nov 11, 2019 in GCP by anonymous
• 6,260 points
1,124 views

1 answer to this question.

0 votes

You can choose a specific internal IP address to assign to an instance when you create it. 

The IP address must be a valid IP address of the subnet of the instance, and the IP address must not already be in use. The IP address remains attached to the instance until you delete the instance, which releases the IP address back into the pool. If you stop and restart the instance, the instance retains the same internal IP address.

In gcloud, run:

gcloud compute instances create [INSTANCE_NAME]
     --private-network-ip [IP_ADDRESS]

where:

  • [INSTANCE_NAME] is the name of the instance you want to create.

  • [IP_ADDRESS] is the IP address you want to assign.

If you are using a custom subnet mode network, you must also specify the subnet using the --subnet [SUBNET] parameter.

answered Nov 11, 2019 by Sirajul
• 59,230 points

Related Questions In GCP

0 votes
1 answer
0 votes
1 answer

GCP - Initate a shutdown to an instance after certein time when it started (for example 3 hours after started)

You can add the contents of a ...READ MORE

answered Mar 31, 2022 in GCP by Korak
• 5,820 points
919 views
0 votes
1 answer
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,917 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,259 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