From baf46325b85744d8e662f9c5c2d711af03468e4d Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Tue, 10 May 2016 10:22:30 -0700 Subject: [PATCH] Updating compute engine sample to use image families. Fixes #276 Change-Id: Ie839037d935330f9042ab3dc3521dc91844594de --- compute/api/create_instance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compute/api/create_instance.py b/compute/api/create_instance.py index 681b76e1a09c..59d1b6257fcc 100644 --- a/compute/api/create_instance.py +++ b/compute/api/create_instance.py @@ -42,8 +42,12 @@ def list_instances(compute, project, zone): # [START create_instance] def create_instance(compute, project, zone, name, bucket): - source_disk_image = \ - "projects/debian-cloud/global/images/debian-7-wheezy-v20150320" + # Get the latest Debian Jessie image. + image_response = compute.images().getFromFamily( + project='debian-cloud', family='debian-8').execute() + source_disk_image = image_response['selfLink'] + + # Configure the machine machine_type = "zones/%s/machineTypes/n1-standard-1" % zone startup_script = open( os.path.join(