From cf555faef78b64e3e3c71e1a59f7655c53d75821 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 15 Dec 2014 13:10:25 +1100 Subject: [PATCH] dashboard/coordinator: add SSD disk option, turn off auto-update Change-Id: I4d2dfe34a6c2fde8603704e716b7c91ad285ecec Reviewed-on: https://go-review.googlesource.com/1561 Reviewed-by: Andrew Gerrand --- dashboard/coordinator/buildongce/create.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dashboard/coordinator/buildongce/create.go b/dashboard/coordinator/buildongce/create.go index 5a39ac08..95dc2781 100644 --- a/dashboard/coordinator/buildongce/create.go +++ b/dashboard/coordinator/buildongce/create.go @@ -32,6 +32,7 @@ var ( sshPub = flag.String("ssh_public_key", "", "ssh public key file to authorize. Can modify later in Google's web UI anyway.") staticIP = flag.String("static_ip", "", "Static IP to use. If empty, automatic.") reuseDisk = flag.Bool("reuse_disk", true, "Whether disk images should be reused between shutdowns/restarts.") + ssd = flag.Bool("ssd", false, "use a solid state disk (faster, more expensive)") writeObject = flag.String("write_object", "", "If non-empty, a VM isn't created and the flag value is Google Cloud Storage bucket/object to write. The contents from stdin.") ) @@ -62,6 +63,9 @@ var config = &oauth.Config{ const baseConfig = `#cloud-config coreos: + update: + group: alpha + reboot-strategy: off units: - name: gobuild.service command: start @@ -266,6 +270,11 @@ func instanceDisk(svc *compute.Service) *compute.AttachedDisk { } } + diskType := "" + if *ssd { + diskType = "https://www.googleapis.com/compute/v1/projects/" + *proj + "/zones/" + *zone + "/diskTypes/pd-ssd" + } + return &compute.AttachedDisk{ AutoDelete: !*reuseDisk, Boot: true, @@ -274,6 +283,7 @@ func instanceDisk(svc *compute.Service) *compute.AttachedDisk { DiskName: diskName, SourceImage: imageURL, DiskSizeGb: 50, + DiskType: diskType, }, } }