0
votes

I'm trying to learn terraform, how do i change image name in the terraform script?

For example, in the below script the default linux image given is debian-cloud/debian-9, how to change the image, say something from marketplace https://console.cloud.google.com/marketplace/details/click-to-deploy-images/deeplearning?q=deep%20learning%20vm&id=8857b4a3-f60f-40b2-9b32-22b4428fd256

gcp terraform link - https://www.terraform.io/docs/providers/google/r/compute_instance_template.html

3

3 Answers

1
votes

As you want to deploy the image [1], it seems the framework is TensorFlow Enterprise 2.1 (CUDA 10.1).

As the documentation [2], we have listed the most recent versions of image families, organized by framework type. Creating an instance by referencing an image family with the “latest” in the name ensures that you always get the most recent version of that image. So from the documentation [2], we could have the image name as required.

I hope documentation [3] and [4] also informative for you.

[1] https://pantheon.corp.google.com/marketplace/details/click-to-deploy-images/deeplearning?q=deep+learning+vm&id=8857b4a3-f60f-40b2-9b32-22b4428fd256

[2] https://cloud.google.com/ai-platform/deep-learning-vm/docs/images#images

[3] https://cloud.google.com/ai-platform/deep-learning-vm/docs/concepts-images

[4] https://cloud.google.com/ai-platform/deep-learning-vm/docs/cli

1
votes

if you are looking for standard images available from GCP run following command and grep the type of image.

gcloud compute images list | grep ubuntu

it will list something like following. First column is NAME second is PROJECT and third is FAMILY. In script you can mention the Project/Family (ubuntu-os-cloud/ubuntu-1804-lts)

ubuntu-1604-xenial-v20210329a      ubuntu-os-cloud      ubuntu-1604-lts        
ubuntu-1804-bionic-v20210325       ubuntu-os-cloud      ubuntu-1804-lts      
0
votes

Here you are referring to a marketplace image. You can change it in the main.tf

initialize_params {
  image = "debian-cloud/debian-9"

You can list images using #gcloud compute images list redhat It will list all the image references to redhat releases.