skip to Main Content

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

Answers


  1. 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.

    Login or Signup to reply.
  2. As you want to deploy the image, it seems the framework is TensorFlow Enterprise 2.1 (CUDA 10.1).

    As the documentation, 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, we could have the image name as required.

    I hope documentation and this other one also informative for you.

    Login or Signup to reply.
  3. 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      
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search