Module openstack

Typedefs

typedef openstack::admin_state
  • Base type string
  • Type constraint ((self == 'up') or (self == 'down'))
typedef openstack::direction
  • Base type string
  • Type constraint ((self == 'ingress') or (self == 'egress'))

Entities

entity openstack::AddressPair

Parents: std::Entity

An address pair that is added to a host port

attribute ip::cidr address

The address range that is allowed on this port (network interface)

attribute net::mac_addr mac

The following implements statements select implementations for this entity:

entity openstack::EndPoint

Parents: openstack::OpenStackResource

attribute string internal_url
attribute string region
attribute string admin_url
attribute string public_url
attribute string service_id
relation openstack::Provider provider [1]

other end: openstack::Provider.endpoints [0:*]

relation openstack::Service service [1]

other end: openstack::Service.endpoint [0:1]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity openstack::FloatingIP

Parents: openstack::OpenStackResource

attribute bool force_ip=False
attribute string name
attribute ip::ip address
relation openstack::HostPort port [1]

other end: openstack::HostPort.floating_ips [0:*]

relation openstack::Provider provider [1]

other end: openstack::Provider.floating_ips [0:*]

relation openstack::Network external_network [1]

other end: openstack::Network.floating_ips [0:*]

relation openstack::Project project [1]

other end: openstack::Project.floating_ips [0:*]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity openstack::GroupRule

Parents: openstack::SecurityRule

relation openstack::SecurityGroup remote_group [1]

other end: openstack::SecurityGroup.remote_group_rules [0:*]

The following implements statements select implementations for this entity:

entity openstack::Host

Parents: ip::Host, openstack::VMAttributes

attribute bool purged=False
relation ssh::Key key_pair [1]
relation openstack::Subnet subnet [0:1]
relation openstack::VirtualMachine vm [1]

other end: openstack::VirtualMachine.host [0:1]

relation openstack::Provider provider [1]
relation openstack::SecurityGroup security_groups [0:*]
relation openstack::Project project [1]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity openstack::HostPort

Parents: openstack::Port

A port attached to a VM

attribute number port_index=0

The index of the port. This determines the order of the interfaces on the virtual machine. 0 means no specific order.

attribute bool portsecurity=True

Enable or disable port security (security groups and spoofing filters)

attribute number wait=5

The number of seconds to wait between retries.

attribute number retries=20

A hostport can only be attached to a VM when it is in an active state. The handler will skip this port when the VM is not ready. To speed up deployments, the handler can retry this number of times before skipping the resource.

attribute bool dhcp=True

Enable dhcp for this port or not for this port

attribute string name

The name of the host port.

relation openstack::Subnet subnet [1]

other end: openstack::Subnet.host_ports [0:*]

relation openstack::VirtualMachine vm [1]

other end: openstack::VirtualMachine.ports [0:*]

relation openstack::FloatingIP floating_ips [0:*]

other end: openstack::FloatingIP.port [1]

The following implements statements select implementations for this entity:

entity openstack::IPrule

Parents: openstack::SecurityRule

attribute ip::cidr remote_prefix

The following implements statements select implementations for this entity:

entity openstack::Network

Parents: openstack::OpenStackResource

A neutron network owned by a project

attribute bool external=False
attribute string name
attribute number segmentation_id=0
attribute bool shared=False
attribute string network_type=''
attribute string physical_network=''
relation openstack::FloatingIP floating_ips [0:*]

other end: openstack::FloatingIP.external_network [1]

relation openstack::Project project [1]

other end: openstack::Project.networks [0:*]

relation openstack::Router routers [0:*]

other end: openstack::Router.ext_gateway [0:1]

relation openstack::Subnet subnets [0:*]

other end: openstack::Subnet.network [1]

relation openstack::Provider provider [1]

other end: openstack::Provider.networks [0:*]

The following implements statements select implementations for this entity:

entity openstack::OpenStackResource

Parents: std::PurgeableResource, std::ManagedResource

The following implementations are defined for this entity:

entity openstack::Port

Parents: openstack::OpenStackResource

A port on a network

attribute ip::ip address
relation openstack::Project project [1]

other end: openstack::Project.ports [0:*]

relation openstack::Provider provider [1]

other end: openstack::Provider.ports [0:*]

relation openstack::AddressPair allowed_address_pairs [0:*]
entity openstack::Project

Parents: openstack::OpenStackResource

A project / tenant in openstack

attribute string description=''
attribute bool enabled=True
attribute string name
relation openstack::FloatingIP floating_ips [0:*]

other end: openstack::FloatingIP.project [1]

relation openstack::Network networks [0:*]

other end: openstack::Network.project [1]

relation openstack::Subnet subnets [0:*]

other end: openstack::Subnet.project [1]

relation openstack::Router routers [0:*]

other end: openstack::Router.project [1]

relation openstack::Role roles [0:*]

Each user can have multiple roles

other end: openstack::Role.project [1]

relation openstack::SecurityGroup security_groups [0:*]

other end: openstack::SecurityGroup.project [1]

relation openstack::Provider provider [1]

other end: openstack::Provider.projects [0:*]

relation openstack::Port ports [0:*]

other end: openstack::Port.project [1]

The following implements statements select implementations for this entity:

entity openstack::Provider

Parents: std::Entity

The configuration for accessing an Openstack based IaaS

attribute string token=''
attribute string tenant
attribute string admin_url=''
attribute string name
attribute bool auto_agent=True
attribute string password
attribute string connection_url
attribute string username
relation openstack::Subnet subnets [0:*]

other end: openstack::Subnet.provider [1]

relation openstack::Project projects [0:*]

other end: openstack::Project.provider [1]

relation openstack::Network networks [0:*]

other end: openstack::Network.provider [1]

relation openstack::User users [0:*]

other end: openstack::User.provider [1]

relation openstack::FloatingIP floating_ips [0:*]

other end: openstack::FloatingIP.provider [1]

relation openstack::Service services [0:*]

other end: openstack::Service.provider [1]

relation openstack::Router routers [0:*]

other end: openstack::Router.provider [1]

relation openstack::Port ports [0:*]

other end: openstack::Port.provider [1]

relation openstack::SecurityGroup security_groups [0:*]

other end: openstack::SecurityGroup.provider [1]

relation openstack::Role roles [0:*]

other end: openstack::Role.provider [1]

relation openstack::EndPoint endpoints [0:*]

other end: openstack::EndPoint.provider [1]

relation openstack::VirtualMachine virtual_machines [0:*]

other end: openstack::VirtualMachine.provider [1]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity openstack::Role

Parents: openstack::OpenStackResource

A role in openstack. A role defines membership of a user in a project. This entity is used to connect users to projects. With this, it implicitly defines the role.

attribute string role
attribute string role_id
relation openstack::User user [1]

other end: openstack::User.roles [0:*]

relation openstack::Provider provider [1]

other end: openstack::Provider.roles [0:*]

relation openstack::Project project [1]

Each user can have multiple roles

other end: openstack::Project.roles [0:*]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity openstack::Route

Parents: std::Entity

A routing rule to add

attribute ip::cidr destination
attribute ip::ip nexthop
relation openstack::Router router [0:1]

other end: openstack::Router.routes [0:*]

The following implements statements select implementations for this entity:

entity openstack::Router

Parents: openstack::OpenStackResource

A router

attribute bool ha=False
attribute openstack::admin_state admin_state='up'
attribute string name
attribute bool distributed=False
relation openstack::Route routes [0:*]

other end: openstack::Route.router [0:1]

relation openstack::Network ext_gateway [0:1]

other end: openstack::Network.routers [0:*]

relation openstack::Subnet subnets [0:*]

other end: openstack::Subnet.router [0:1]

relation openstack::Project project [1]

other end: openstack::Project.routers [0:*]

relation openstack::Provider provider [1]

other end: openstack::Provider.routers [0:*]

relation openstack::RouterPort ports [0:*]

other end: openstack::RouterPort.router [0:1]

The following implements statements select implementations for this entity:

entity openstack::RouterPort

Parents: openstack::Port

A port attached to a router

attribute string name
relation openstack::Subnet subnet [0:1]

other end: openstack::Subnet.routers [0:*]

relation openstack::Router router [0:1]

other end: openstack::Router.ports [0:*]

The following implements statements select implementations for this entity:

entity openstack::SecurityGroup

Parents: openstack::OpenStackResource

attribute string description=''
attribute number retries=10

A security group can only be deleted when it is no longer in use. The API confirms the delete of a virtual machine for example, but it might still be in progress. This results in a failure to delete the security group. To speed up deployments, the handler can retry this number of times before skipping the resource.

attribute string name
attribute number wait=5

The number of seconds to wait between retries.

attribute bool manage_all=True
relation openstack::VirtualMachine virtual_machines [0:*]

other end: openstack::VirtualMachine.security_groups [0:*]

relation openstack::Project project [1]

other end: openstack::Project.security_groups [0:*]

relation openstack::Provider provider [1]

other end: openstack::Provider.security_groups [0:*]

relation openstack::GroupRule remote_group_rules [0:*]

other end: openstack::GroupRule.remote_group [1]

relation openstack::SecurityRule rules [0:*]

other end: openstack::SecurityRule.group [1]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity openstack::SecurityRule

Parents: std::Entity

A filter rule in the a security group

attribute ip::protocol ip_protocol

The type of ip protocol to allow. Currently this support tcp/udp/icmp/sctp or all

attribute openstack::direction direction
attribute ip::port port=0
attribute ip::port port_max=0
attribute ip::port port_min=0
relation openstack::SecurityGroup group [1]

other end: openstack::SecurityGroup.rules [0:*]

entity openstack::Service

Parents: openstack::OpenStackResource

attribute string description
attribute string type
attribute string name
relation openstack::Provider provider [1]

other end: openstack::Provider.services [0:*]

relation openstack::EndPoint endpoint [0:1]

other end: openstack::EndPoint.service [1]

The following implements statements select implementations for this entity:

entity openstack::Subnet

Parents: openstack::OpenStackResource

A neutron network subnet

attribute ip::ip dns_servers=List()
attribute string name
attribute bool dhcp
attribute string allocation_end=''
attribute string allocation_start=''
attribute ip::cidr network_address
relation openstack::RouterPort routers [0:*]

other end: openstack::RouterPort.subnet [0:1]

relation openstack::Network network [1]

other end: openstack::Network.subnets [0:*]

relation openstack::Provider provider [1]

other end: openstack::Provider.subnets [0:*]

relation openstack::HostPort host_ports [0:*]

other end: openstack::HostPort.subnet [1]

relation openstack::Project project [1]

other end: openstack::Project.subnets [0:*]

relation openstack::Router router [0:1]

other end: openstack::Router.subnets [0:*]

The following implements statements select implementations for this entity:

entity openstack::User

Parents: openstack::OpenStackResource

A user in openstack. A handler for this entity type is loaded by agents.

attribute bool enabled=True

Enable or disable this user

attribute string name

The name of the user. The name of the user has to be unique on a specific IaaS. The handler will use this name to query for the exact user and its ID.

attribute string email

The email address of the user to use.

attribute string password=''

The password for this user. The handler will always reset back to this password. The handler will ignore this attribute when an empty string is set.

relation openstack::Role roles [0:*]

other end: openstack::Role.user [1]

relation openstack::Provider provider [1]

other end: openstack::Provider.users [0:*]

The following implements statements select implementations for this entity:

entity openstack::VMAttributes

Parents: platform::UserdataVM

attribute string image
attribute string flavor
attribute string user_data
attribute bool install_agent=False
attribute bool config_drive=False
entity openstack::VirtualMachine

Parents: openstack::OpenStackResource, openstack::VMAttributes

attribute string name
relation openstack::Host host [0:1]

other end: openstack::Host.vm [1]

relation ssh::Key key_pair [1]
relation openstack::HostPort eth0_port [1]
relation openstack::Provider provider [1]

other end: openstack::Provider.virtual_machines [0:*]

relation openstack::SecurityGroup security_groups [0:*]

other end: openstack::SecurityGroup.virtual_machines [0:*]

relation openstack::Project project [1]
relation openstack::HostPort ports [0:*]

other end: openstack::HostPort.vm [1]

The following implements statements select implementations for this entity:

Implementations

implementation openstack::agentConfig
implementation openstack::endPoint
implementation openstack::eth0Port
implementation openstack::fipAddr
implementation openstack::fipName
implementation openstack::openstackVM
implementation openstack::providerRequire
implementation openstack::roleImpl
implementation openstack::sg
implementation openstack::userData

Plugins

openstack.find_flavor(provider: openstack::Provider, vcpus: number, ram: number, pinned: bool=False) → string

Find the flavor that matches the closest to the resources requested.

Parameters:
  • vcpus – The number of virtual cpus in the flavor
  • ram – The amount of ram in megabyte
  • pinned – Wether the CPUs need to be pinned (#vcpu == #pcpu)
openstack.find_image(provider: openstack::Provider, os: std::OS, name: string=None) → string

Search for an image that matches the given operating system. This plugin uses the os_distro and os_version tags of an image and the name and version attributes of the OS parameter.

If multiple images match, the most recent image is returned.

Parameters:
  • provider – The provider to query for an image
  • os – The operating system and version (using os_distro and os_version metadata)
  • name – An optional string that the image name should contain

Resources

class openstack.EndPoint
An endpoint for a service
class openstack.FloatingIP
A floating ip
class openstack.HostPort
A port in a router
class openstack.Network
This class represents a network in neutron
class openstack.Project
This class represents a project in keystone
class openstack.Role
A role that adds a user to a project
class openstack.Router
This class represent a router in neutron
class openstack.RouterPort
A port in a router
class openstack.SecurityGroup
A security group in an OpenStack tenant
class openstack.Service
A service for which endpoints can be registered
class openstack.Subnet
This class represent a subnet in neutron
class openstack.User
A user in keystone
class openstack.VirtualMachine
A virtual machine managed by a hypervisor or IaaS

Handlers

class openstack.RouterPortHandler
class openstack.RoleHandler
creates roles and user, project, role assocations
class openstack.UserHandler
class openstack.HostPortHandler
class openstack.EndpointHandler
class openstack.ServiceHandler
class openstack.SecurityGroupHandler
class openstack.NetworkHandler
class openstack.ProjectHandler
class openstack.FloatingIPHandler
class openstack.VirtualMachineHandler
class openstack.SubnetHandler
class openstack.RouterHandler