Sha256: 7cf701a35a68df4389125ab666a6f36213f3afaea22be1daa427d25574c55fd6

Contents?: true

Size: 807 Bytes

Versions: 44

Compression:

Stored size: 807 Bytes

Contents

# OpenStack Compute (Nova) Example

require 'fog/openstack'

auth_url = "https://example.net/v2.0/tokens"
username = 'admin@example.net'
password = 'secret'
tenant   = 'My Compute Tenant' # String

compute_client ||= ::Fog::Compute::OpenStack.new(
  :openstack_api_key  => password,
  :openstack_username => username,
  :openstack_auth_url => auth_url,
  :openstack_tenant   => tenant
)

_vm = compute_client.servers.create(
  :name                    => name,
  :flavor_ref              => flavor,
  :block_device_mapping_v2 => [
    {
      :boot_index            => 0,
      :device_name           => "vda",
      :source_type           => "volume", # Or "snapshot"
      :destination_type      => "volume",
      :delete_on_termination => false,
      :uuid                  => cinder_uddi,
    }
  ]
)

Version data entries

44 entries across 42 versions & 3 rubygems

Version Path
fog-openstack-0.1.31 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.10 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.1.30 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.1.29 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.9 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.1.28 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.8 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.7 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.6 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.5 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.4 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.3 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.2 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.3.0 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.2.4 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.2.3 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.2.2 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.2.1 examples/compute/block_device_mapping_v2.rb
fog-openstack-0.2.0 examples/compute/block_device_mapping_v2.rb
fog-zj-0.1.28 examples/compute/block_device_mapping_v2.rb