Google Cloud Deployment Manager SourceImage Property Question

195 views
Skip to first unread message

Charles Moore

unread,
Mar 16, 2016, 7:35:55 PM3/16/16
to gce-discussion
Hello,

Currently for my instance deployment I have the following set as my source image:


Is there an option to always use the most current version of Ubuntu so I don't have to manually change it every time a new one is released? I saw that it has an Alias, can that be used somehow?

Thanks,

Charles

Kamran (Google Cloud Support)

unread,
Mar 16, 2016, 10:52:37 PM3/16/16
to gce-discussion

Hello Charles,

The gcloud compute images list command lists all standard Google Compute images and their aliases. However, the aliases are good as long as you use them with gcloud command to create your VM instances, as described in this article

You can use the following command in your script to get the link of the latest Ubuntu image build and then populate sourceImage value of your template with it:

gcloud compute images list --uri | grep ubuntu | tail -1

I hope this helps.

Sincerely,

Charles Moore

unread,
Mar 17, 2016, 4:21:28 PM3/17/16
to gce-discussion
Hey Kamran,

It would be nice if I was able to point to the most recent version of Ubuntu from the template itself without having to do a little workaround but yes this solution can work.

Thanks again,

Charles

Kamran (Google Cloud Support)

unread,
Mar 17, 2016, 6:34:28 PM3/17/16
to gce-discussion

Charles, 

I can see how pointing to the most recent version of Ubuntu image directly from the template is more efficient. I encourage you to open a feature request for this particular use case on the Google Compute Engine issue tracker

Sincerely,

Max Illfelder

unread,
Mar 18, 2016, 5:27:42 AM3/18/16
to gce-discussion
Hi Charles,

We are rolling out a feature called image families that you might find useful. The feature is currently part of the beta API (which it looks like you are already using!), and will allow you to use the latest image for a given "family". When you perform a "get" on the source image you mentioned:

curl "https://www.googleapis.com/compute/beta/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20160314" -H "Authorization: Bearer ${ACCESS_TOKEN}" --header "Content-Type:application/json"

{

 "kind": "compute#image",

 "selfLink": "https://www.googleapis.com/compute/beta/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20160314",

 "id": "7515001840279892044",

 "creationTimestamp": "2016-03-14T21:25:07.759-07:00",

 "name": "ubuntu-1404-trusty-v20160314",

 "description": "Canonical, Ubuntu, 14.04 LTS, amd64 trusty image built on 2016-03-14",

 "sourceType": "RAW",

 "rawDisk": {

  "source": "",

  "containerType": "TAR"

 },

 "status": "READY",

 "archiveSizeBytes": "1729916368",

 "diskSizeGb": "10",

 "licenses": [

  "https://www.googleapis.com/compute/beta/projects/ubuntu-os-cloud/global/licenses/ubuntu-1404-trusty"

 ],

 "family": "ubuntu-1404-lts",

 "labelFingerprint": "42WmSpB8rSM="


The family is "ubuntu-1404-lts".

We've rolled out functionality that lets get the latest image from family and you can view the beta API documentation here.

We are also in the process of adding support for creating a disk (currently rolled out) or instance (not yet rolled out) from an image family.


Please let us know if you run into any troubles!
Max
Reply all
Reply to author
Forward
0 new messages