Types¶
Node Types¶
-
cloudify.openstack.nodes.Server
¶ An OpenStack server.
Derived from: cloudify.nodes.Compute
Properties:
- openstack_config
default:
{}
see Openstack Configuraion
- resource_id
- name to give to the new resource or the name or ID of an existing resource when the
use_external_resource
property is set totrue
(see the using existing resources section). Defaults to ‘’ (empty string). - image
- The image for the server. May receive either the ID or the name of the image. note: This property is currently optional for backwards compatibility, but will be modified to become a required property in future versions (Default: ‘’).
- management_network_name
- Cloudify’s management network name. Every server should be connected to the management network. If the management network’s name information is available in the Provider Context, this connection is made automatically and there’s no need to override this property (See the Misc section for more information on the Openstack Provider Context). Otherwise, it is required to set the value of this property to the management network name as it was set in the bootstrap process. Note: When using Nova-net Openstack (see the Nova-net Support section), don’t set this property. Defaults to ‘’ (empty string).
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- server
default:
{}
key-value server configuration as described in OpenStack compute create server API. (DEPRECATED - Use the args input in create operation instead)
- flavor
- The flavor for the server. May receive either the ID or the name of the flavor. note: This property is currently optional for backwards compatibility, but will be modified to become a required property in future versions (Default: ‘’).
- use_password
default:
False
A boolean describing whether this server image supports user-password authentication. Images that do should post the administrator user’s password to the Openstack metadata service (e.g. via cloudbase); The password would then be retrieved by the plugin, decrypted using the server’s keypair and then saved in the server’s runtime properties.
- use_external_resource
type:
boolean
default:False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
-
cloudify.openstack.nodes.WindowsServer
¶ This type has the same properties and operations-mapping as the type above (as it derives from it), yet it overrides some of the agent and plugin installations operations-mapping derived from the built-in cloudify.nodes.Compute type. Use this type when working with a Windows server.
Additionally, the default value for the use_password property is overridden for this type, and is set to true. When using an image with a preset password, it should be modified to false.
Derived from: cloudify.openstack.nodes.Server
Properties:
- agent_config
type:
cloudify.datatypes.AgentConfig
default:{'port': 5985}
(updates the defaults for the agent_config for Windows)
- use_password
default:
True
Default changed for derived type because Windows instances need a password for agent installation
- os_family
default:
windows
(updates the os_family default as a convenience)
-
cloudify.openstack.nodes.KeyPair
¶ Derived from: cloudify.nodes.Root
Properties:
- openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- resource_id
- the name that will be given to the resource on Openstack (excluding optional prefix). If not provided, a default name will be given instead. If use_external_resource is set to “true”, this exact value (without any prefixes applied) will be looked for as either the name or id of an existing keypair to be used.
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- keypair
default:
{}
the keypair object as described by Openstack. This parameter can be used to override and pass parameters directly to Nova client. Note that in the case of keypair, the only nested parameter that can be used is “name”.
- private_key_path
required
the path (on the machine the plugin is running on) to where the private key should be stored. If use_external_resource is set to “true”, the existing private key is expected to be at this path.
- use_external_resource
type:
boolean
default:False
a boolean describing whether this resource should be created or rather that it already exists on Openstack and should be used as-is.
-
cloudify.openstack.nodes.Image
¶ Derived from: cloudify.nodes.Root
Properties:
- openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- resource_id
- name to give to the new resource or the name or ID of an existing resource when the
use_external_resource
property is set totrue
(see the using existing resources section). Defaults to ‘’ (empty string). - image
default:
{}
Required parameters are (container_format, disk_format). Accepted types are available on http://docs.openstack.org/developer/glance/formats.html To create an image from the local file its path should be added in data parameter.
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- image_url
- The openstack resource URL for the image.
- use_external_resource
default:
False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
-
cloudify.openstack.nodes.SecurityGroup
¶ Derived from: cloudify.nodes.SecurityGroup
Properties:
- openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- resource_id
- name to give to the new resource or the name or ID of an existing resource when the
use_external_resource
property is set totrue
(see the using existing resources section). Defaults to ‘’ (empty string). - rules
default:
[]
key-value security_group_rule configuration as described in http://developer.openstack.org/api-ref-networking-v2.html#security_groups
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- security_group
default:
{}
key-value security_group configuration as described in http://developer.openstack.org/api-ref-networking-v2-ext.html#createSecGroup. (DEPRECATED - Use the `args` input in create operation instead)
- disable_default_egress_rules
default:
False
a flag for removing the default rules which https://wiki.openstack.org/wiki/Neutron/SecurityGroups#Behavior. If not set to true, these rules will remain, and exist alongside any additional rules passed using the rules property.
- use_external_resource
type:
boolean
default:False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
- description
type:
string
SecurityGroup description.
-
cloudify.openstack.nodes.Router
¶ Derived from: cloudify.nodes.Router
Properties:
- openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- resource_id
- name to give to the new resource or the name or ID of an existing resource when the
use_external_resource
property is set totrue
(see the using existing resources section). Defaults to ‘’ (empty string). - create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- default_to_managers_external_network
default:
True
A boolean which determines whether to use the Cloudify Manager’s external network if no other external network was given (whether by a relationship, by the external_network property or by the nested external_gateway_info key in the router property). This is only relevant if the manager’s external network appears in the Provider-context. Defaults to true.
- router
default:
{}
key-value router configuration as described in http://developer.openstack.org/api-ref-networking-v2.html#layer3. (DEPRECATED - Use the `args` input in create operation instead)
- external_network
- An external network name or ID. If given, the router will use this external network as a gateway.
- use_external_resource
type:
boolean
default:False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
-
cloudify.openstack.nodes.Port
¶ Derived from: cloudify.nodes.Port
Properties:
- openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- resource_id
- name to give to the new resource or the name or ID of an existing resource when the
use_external_resource
property is set totrue
(see the using existing resources section). Defaults to ‘’ (empty string). - fixed_ip
- may be used to request a specific fixed IP for the port. If the IP is unavailable (either already taken or does not belong to a subnet the port is on) an error will be raised.
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- use_external_resource
type:
boolean
default:False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
- port
default:
{}
key-value port configuration as described in http://developer.openstack.org/api-ref-networking-v2.html#ports. (DEPRECATED - Use the `args` input in create operation instead)
-
cloudify.openstack.nodes.Network
¶ Derived from: cloudify.nodes.Network
Properties:
- resource_id
- name to give to the new resource or the name or ID of an existing resource when the
use_external_resource
property is set totrue
(see the using existing resources section). Defaults to ‘’ (empty string). - openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- network
default:
{}
key-value network configuration as described in http://developer.openstack.org/api-ref-networking-v2.html#networks. (DEPRECATED - Use the `args` input in create operation instead)
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- use_external_resource
type:
boolean
default:False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
-
cloudify.openstack.nodes.Subnet
¶ Derived from: cloudify.nodes.Subnet
Properties:
- subnet
default:
{}
key-value subnet configuration as described at http://developer.openstack.org/api-ref-networking-v2.html#subnets. (DEPRECATED - Use the `args` input in create operation instead)
- use_external_resource
type:
boolean
default:False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
- openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- resource_id
- name to give to the new resource or the name or ID of an existing resource when the
use_external_resource
property is set totrue
(see the using existing resources section). Defaults to ‘’ (empty string).
-
cloudify.openstack.nodes.FloatingIP
¶ Derived from: cloudify.nodes.VirtualIP
Properties:
- resource_id
- IP address of the floating IP
- openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- use_external_resource
type:
boolean
default:False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- floatingip
default:
{}
key-value floatingip configuration as described in http://developer.openstack.org/api-ref-networking-v2.html#layer3. (DEPRECATED - Use the `args` input in create operation instead)
-
cloudify.openstack.nodes.Volume
¶ Derived from: cloudify.nodes.Volume
Properties:
- openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- resource_id
- name to give to the new resource or the name or ID of an existing resource when the
use_external_resource
property is set totrue
(see the using existing resources section). Defaults to ‘’ (empty string). - boot
type:
boolean
default:False
If a Server instance is connected to this Volume by a relationship, this volume will be used as the boot volume for that Server.
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- device_name
default:
auto
The device name this volume will be attached to. Default value is auto, which means openstack will auto-assign a device. Note that if you do explicitly set a value, this value may not be the actual device name assigned. Sometimes the device requested will not be available and openstack will assign it to a different device, this is why we recommend using auto.
- volume
default:
{}
key-value volume configuration as described in http://developer.openstack.org/api-ref-blockstorage-v1.html#volumes-v1. (DEPRECATED - Use the `args` input in create operation instead)
- use_external_resource
type:
boolean
default:False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
-
cloudify.openstack.nodes.Project
¶ Derived from: cloudify.nodes.Root
Properties:
- openstack_config
default:
{}
endpoints and authentication configuration for Openstack. Expected to contain the following nested fields: username, password, tenant_name, auth_url, region.
- resource_id
- name to give to the new resource or the name or ID of an existing resource when the
use_external_resource
property is set totrue
(see the using existing resources section). Defaults to ‘’ (empty string). - quota
default:
{}
A dictionary mapping service names to quota definitions for a proejct
e.g:
quota: neutron: <quota> nova: <quota>
- create_if_missing
default:
False
If use_external_resource is
true
and the resource is missing, create it instead of failing.- project
default:
{}
key-value project configuration.
- use_external_resource
default:
False
a boolean for setting whether to create the resource or use an existing one. See the using existing resources section.
- users
default:
[]
- List of users assigned to this project in the following format:
- { name: string, roles: [string] }
Types’ Common Behaviors¶
Validations¶
All types offer the same base functionality for the cloudify.interfaces.validation.creation
interface operation:
- If it’s a new resource (
use_external_resource
is set tofalse
), the basic validation is to verify there’s enough quota to allocate a new resource of the given type.- When [using an existing resource](#using-existing-resources), the validation ensures the resource indeed exists.
Runtime Properties¶
Node instances of any of the types defined in this plugin get set with the following runtime properties during the cloudify.interfaces.lifecycle.create
operation:
external_id
the Openstack ID of the resourceexternal_type
the Openstack type of the resourceexternal_name
the Openstack name of the resource
The only exceptions are the two floating-ip types - Since floating-ip objects on Openstack don’t have a name, the external_name
runtime property is replaced with the floating_ip_address
one, which holds the object’s actual IP address.
Default Resource Naming Convention¶
When creating a new resource (i.e. use_external_resource
is set to false
), its name on Openstack will be the value of its resource_id
property. However, if this value is not provided, the name will default to the following schema:
<openstack-resource-type>_<deployment-id>_<node-instance-id>
For example, if a server node is defined as so:
node_templates:
myserver:
type: cloudify.openstack.nodes.Server
...
Yet without setting the resource_id
property, then the server’s name on Openstack will be server_my-deployment_myserver_XXXXX
(where the XXXXX is the autogenerated part of the node instance’s ID).
Using Existing Resources¶
It is possible to use existing resources on Openstack - whether these have been created by a different Cloudify deployment or not via Cloudify at all.
All Cloudify Openstack types have a property named use_external_resource
, whose default value is false
. When set to true
, the plugin will apply different semantics for each of the operations executed on the relevant node’s instances. Specifically, in the case of the cloudify.interfaces.lifecycle.create
operation, rather than creating a new resource on Openstack of the given type, the plugin will behave as follows:
- Try to find an existing resource on Openstack whose name (or IP, in the case of one of the floating-ip types) is the value specified for the
resource_id
property. If more than one is found, an error is raised. - If no resource was found, the plugin will use the value of the
resource_id
property to look for the resource by ID instead. If a resource still isn’t found, an error is raised. - If a single resource was found, the plugin will use that resource, and set the node instance with the appropriate runtime properties according to the resource’s data.
The semantics of other operations are affected as well:
- The
cloudify.interfaces.lifecycle.start
operation, where applicable, will only validate that the resource is indeed started, raising an error if it isn’t. - The
cloudify.interfaces.lifecycle.stop
operation, where applicable, won’t have any effect. - The
cloudify.interfaces.lifecycle.delete
operation will not actually delete the resource from Openstack (but will clear the runtime properties from the node instance). - The
cloudify.interfaces.validation.creation
operation will verify that a resource with the given name or ID indeed exists, or otherwise print a list of all available resources of the given type. - The
cloudify.interfaces.relationship_lifecycle.establish
operation will behave as normal if the related node is not set withuse_external_resource
astrue
; However if both nodes have this property set totrue
, the operation will only attempt to verify that they’re indeed “connected” on Openstack as well (“connected” in this case also refers to a security-group imposed on a server, floating-ip associated with a server, etc.).
Notes¶
- As mentioned in the [Relationships section](#relationships), some relationships take effect in non-relationship operations. When
use_external_resource
is set totrue
, the existence of such connections is validated as well. - Using an existing resource only makes sense for single-instance nodes.
Relationships¶
Not all relationships have built-in types (i.e., some types may simply get connected using standard Cloudify relationships such as
cloudify.relationships.connected_to
).Some relationships take effect in non-relationship operations, e.g. a subnet which is connected to a network actually gets connected on subnet’s creation (in the
cloudify.interfaces.lifecycle.create
operation) and not in acloudify.interfaces.relationship_lifecycle.establish
operation - this occurs whenever the connection information is required on resource creation.
-
cloudify.openstack.server_connected_to_port
¶ A relationship for connecting a server to a port. The server will use this relationship to automatically connect to the port upon server creation.
Derived from: cloudify.relationships.connected_to
-
cloudify.openstack.port_connected_to_security_group
¶ A relationship for a port to a security group.
Derived from: cloudify.relationships.connected_to
-
cloudify.openstack.server_connected_to_keypair
¶ Derived from: cloudify.relationships.connected_to
-
cloudify.openstack.port_connected_to_subnet
¶ A relationship for connecting a port to a subnet. This is useful when a network has multiple subnets, and a port should belong to a specific subnet on that network. The port will then receive some IP from that given subnet.
Note that when using this relationship in combination with the port type’s property fixed_ip, the IP given should be on the CIDR of the subnet connected to the port.
Note: This relationship has no operations associated with it; The port will use this relationship to automatically connect to the subnet upon port creation.
Derived from: cloudify.relationships.connected_to
-
cloudify.openstack.server_connected_to_security_group
¶ A relationship for setting a security group on a server.
Derived from: cloudify.relationships.connected_to
-
cloudify.openstack.subnet_connected_to_router
¶ A relationship for connecting a subnet to a router.
Derived from: cloudify.relationships.connected_to
-
cloudify.openstack.port_connected_to_floating_ip
¶ A relationship for associating a floating ip with a port. If that port is later connected to a server, the server will be accessible via the floating IP.
Derived from: cloudify.relationships.connected_to
-
cloudify.openstack.server_connected_to_floating_ip
¶ A relationship for associating a floating ip with a server.
Derived from: cloudify.relationships.connected_to
-
cloudify.openstack.volume_attached_to_server
¶ A relationship for attaching a volume to a server.
Derived from: cloudify.relationships.connected_to