This topic describes cloud properties for different resources created by the OpenStack CPI.

AZs

Schema for cloud_properties section:

  • availability_zone [String, required]: Availability zone to use for creating instances. Example: east.

Example:

azs:
- name: z1
  cloud_properties:
    availability_zone: east

Networks

Schema for cloud_properties section used by dynamic network or manual network subnet:

  • net_id [String, required]: Network ID containing the subnet in which the instance will be created. Example: net-b98ab66e-6fae-4c6a-81af-566e630d21d1.
  • security_groups [Array, optional]: Array of security groups to apply for all VMs that are placed on this network. Defaults to security groups specified by default_security_groups in the global CPI settings unless security groups are specified on a resource pool for a VM. Security groups can be specified either on a resource pool or on a network.

Example of manual network:

networks:
- name: default
  type: manual
  subnets:
  - range: 10.10.0.0/24
    gateway: 10.10.0.1
    cloud_properties:
      net_id: net-b98ab66e-6fae-4c6a-81af-566e630d21d1
      security_groups: [my-sec-group]

Example of dynamic network:

networks:
- name: default
  type: dynamic
  cloud_properties:
    net_id: net-b98ab66e-6fae-4c6a-81af-566e630d21d1

Example of vip network:

networks:
- name: default
  type: vip

Resource Pools / VM Types

Schema for cloud_properties section:

  • instance_type [String, required]: Type of the instance. Example: m1.small.
  • availability_zone [String, required]: Availability zone to use for creating instances. Example: east.
  • security_groups [Array, optional]: Array of security groups to apply for all VMs that are in this resource pool. Defaults to security groups specified by default_security_groups in the global CPI settings unless security groups are specified on one of the VM networks. Security groups can be specified either on a resource pool or on a network. Available in v16+.
  • key_name [String, optional]: Key pair name. Defaults to key pair name specified by default_key_name in the global CPI settings. Example: bosh.
  • scheduler_hints [Hash, optional]: Data passed to the OpenStack Filter scheduler to influence its decision where new VMs can be placed. See VM Anti-Affinity for a detailed example. Example: { group: af09abf2-2283... }
  • root_disk [Hash, optional]: Custom root disk properties. Requires boot_from_volume: true to enable cinder-backed boot volumes. Available in v25+.
    • size [Integer, required]: Specifies the disk size in gigabytes.

Example of an m1.small instance:

resource_pools:
- name: default
  network: default
  stemcell:
    name: bosh-openstack-kvm-ubuntu-trusty-go_agent
    version: latest
  cloud_properties:
    instance_type: m1.small
    availability_zone: east

Example of an m1.small instance locked down by specific security groups:

resource_pools:
- name: web-workers
  network: default
  stemcell:
    name: bosh-openstack-kvm-ubuntu-trusty-go_agent
    version: latest
  cloud_properties:
    instance_type: m1.small
    availability_zone: east
    security_groups: [web-workers]

Example of an m1.small instance with custom root disk size of 50GB:

resource_pools:
- name: default
  network: default
  stemcell:
    name: bosh-openstack-kvm-ubuntu-trusty-go_agent
    version: latest
  cloud_properties:
    instance_type: m1.small
    availability_zone: east
    root_disk:
      size: 50

Disk Pools / Disk Types

Schema for cloud_properties section:

  • type [String, optional]: Volume type as configured in your OpenStack installation. Example: SSD

Cinder volumes are created in the availability zone of an instance that volume will be attached.

Example of 10GB SSD disk:

disk_pools:
- name: default
  disk_size: 10_240
  cloud_properties:
    type: SSD

Global Configuration

See CPI job configuration for details.

Schema:

  • defaultvolumetype [String, optional]: sets volume type for persistent disks unless overridden in resource pool/VM Type. cinder type-list will return the available volume types. Example: SSD.

Example with Keystone V3:

properties:
  openstack:
    auth_url: http://pistoncloud.com:5000/v3
    username: christopher
    api_key: QRoqsenPsNGX6
    project: Bosh
    domain: sample-domain
    region: RegionOne
    default_key_name: bosh
    default_security_groups: [bosh]

Example with Keystone V2 and default volume type ceph:

properties:
  openstack:
    auth_url: http://pistoncloud.com:5000/v2.0
    username: christopher
    api_key: QRoqsenPsNGX6
    tenant: Bosh
    region: RegionOne
    default_key_name: bosh
    default_security_groups: [bosh]
    default_volume_type: ceph

Example Cloud Config

azs:
- name: z1
  cloud_properties:
    availability_zone: east1
- name: z2
  cloud_properties:
    availability_zone: east2

vm_types:
- name: default
  cloud_properties:
    instance_type: small
- name: large
  cloud_properties:
    instance_type: large

disk_types:
- name: default
  disk_size: 3000
- name: large
  disk_size: 50_000

networks:
- name: default
  type: manual
  subnets:
  - range: 10.10.0.0/24
    gateway: 10.10.0.1
    az: z1
    dns: [8.8.8.8]
    cloud_properties:
      net_id: net-b98ab66e-6fae-4c6a-81af-566e630d21d1
  - range: 10.10.1.0/24
    gateway: 10.10.1.1
    az: z2
    dns: [8.8.8.8]
    cloud_properties:
      net_id: net-85940t48-8ffe-3c3a-81af-27d499ff9842
- name: vip
  type: vip

compilation:
  workers: 5
  reuse_compilation_vms: true
  az: z1
  vm_type: large
  network: default

Errors

Command 'deploy' failed:
  Deploying:
    Creating instance 'bosh/0':
      Waiting until instance is ready:
        Starting SSH tunnel:
          Parsing private key file './bosh.pem':
            asn1: structure error: superfluous leading zeros in length

If you’re using OpenStack Liberty or Mitaka, you cannot use ssh keys generated by nova with bosh-init due to an OpenStack bug. OpenStack versions before Liberty and after Mitaka are not affected. As a workaround, generate your ssh key manually and import it to nova.

Bosh::Clouds::VMCreationFailed

This error is raised if OpenStack is unable to create a VM. That may happen because:

  • not enough resources (vCPUs, RAM, disk) to run the VM. For example if you have selected m1.xlarge flavor that uses 10 vCPUs and you have 4 hypervisors and each one of them only has 3 vCPUs available, OpenStack is unable to start the VM anywhere even though, total vCPUs across all hypervisors is more than enough.
Image `4c1d6840-6ac7-4b42-bf29-c95fef6d986e' not found

It’s possible that image was deleted from OpenStack directly and BOSH is not aware of it. You can recover with bosh upload stemcell X --fix to reupload the stemcell.


Back to Table of Contents

Next: Using Keystone v2 API


Contribute changes to this page