1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:08:33 -06:00

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 <adg@golang.org>
This commit is contained in:
Brad Fitzpatrick 2014-12-15 13:10:25 +11:00 committed by Brad Fitzpatrick
parent c6dbbb5857
commit cf555faef7

View File

@ -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,
},
}
}