Skip to content

Instantly share code, notes, and snippets.

@jk0
Created May 21, 2012 15:30
Show Gist options
  • Save jk0/2762925 to your computer and use it in GitHub Desktop.
Save jk0/2762925 to your computer and use it in GitHub Desktop.
Boot a DevStack instance through the BOSH OpenStack CPI.
os = openstack
flavor = os.flavors.find { |f| f.name == "m1.tiny" }
image = os.images.find { |i| i.name == "cirros-0.3.0-x86_64-uec" }
# Boot instance using Fog
# server = os.servers.create(:name => agent_id, :image_ref => image.id, :flavor_ref => flavor.id)
server = cpi.create_vm("cpi-test", image.name, { "instance_type" => flavor.name }, {"default" => { "type" => "dynamic" }})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment