Sha256: b5ba0905874e23f135094b492c173a412cf514854ee0836963be10bf0d7db459

Contents?: true

Size: 847 Bytes

Versions: 16

Compression:

Stored size: 847 Bytes

Contents

# OpenStack Compute (Nova) Example

require 'fog'
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.new(
  :provider           => :openstack,
  :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

16 entries across 16 versions & 3 rubygems

Version Path
fog-openstack-0.1.2 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-openstack-0.1.1 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-openstack-0.1.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.37.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.36.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.35.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-2.0.0.pre.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.34.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.33.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.32.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.31.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.30.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.29.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.28.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
fog-1.27.0 lib/fog/openstack/examples/compute/block_device_mapping_v2.rb