interestedparty333
interestedparty333

Reputation: 2536

How to create google compute engine template with a custom disk and an external ip

How do I create a google compute engine template, named my-template, with a custom disk named my-disk, an external ip, that's preemptible, and with the tags necessary to open the http server ports?

Can I use the a managed template group to automatically restart these preemptible instances?

Upvotes: 0

Views: 67

Answers (1)

interestedparty333
interestedparty333

Reputation: 2536

Something like the following command will work. Note that I set it up to use a highmem machine with 8 cores.

gcloud compute instance-templates create my-template \
 --disk=boot=yes,auto-delete=no,name=my-disk \
 --machine-type=n1-highmem-8 \
 --preemptible \
 --network-interface=address=35.238.XXX.YYY \
 --tags=http-server,https-server

As of Nov 2018, the following link is where you can setup your external IP: https://console.cloud.google.com/networking/addresses/list

Yes, you'll be able to use a managed instance group to automatically restart the preemptible instance once compute resources are available.

Upvotes: 0

Related Questions