chef-boneyard / chef-provisioning-google

Chef Provisioning driver for the Google Cloud Platform
Apache License 2.0
8 stars 8 forks source link

Creating VMs should support machine types (including custom sizes) #10

Closed erjohnso closed 8 years ago

erjohnso commented 8 years ago

Ensure users can specify machine types including GCE's newish custom machine type feature.

erjohnso commented 8 years ago

This is already supported by passing in valid params/vars with machine_options. For instance, this was used to create a custom machine type:

require "chef/provisioning/google_driver"

with_driver "google:us-central1-f:graphite-demos",
  :google_credentials => {
    :json_key_path => "/home/erjohnso/chef-prov-sa.json",
    :google_client_email => "chef-prov-sa@graphite-demos.iam.gserviceaccount.com"
  }

google_key_pair "chef_default" do
  private_key_path "chef_test"
  public_key_path "chef_test.pub"
end

machine "test01" do
  machine_options insert_options: {
    :machineType => "zones/us-central1-f/machineTypes/custom-4-5120",
    :tags => {
      :items => ["tag1", "tag2"]
    }
  }, key_name: "chef_test"
  action [:converge]
end

Closing this issue as "working as intended". 👍