vCloud Plugin
Get the latest docs
You are looking at documentation for an older release. Not what you want? Go to the current release documentation.
Cloudify vCloud plugin description and configuration
Description
The vCloud plugin allows users to use a vCloud based infrastructure for deploying services and applications.
Plugin Requirements:
- Python versions:
- 2.7.x
Types
Tip
Each type has property vcloud_config. It can be used to pass parameters for authenticating. Overriding of this property is not required, and by default the authentication will take place with the same credentials that were used for the Cloudify bootstrap process.
cloudify.vcloud.nodes.Server
Derived From: cloudify.nodes.Compute
Properties:
serverkey-value server configuration.nameserver name.templateVApp template from which server will be spawned. For more information, see the Misc section - VApp template.catalogVApp templates catalog.guest_customizationguest customization sectionpublic_keyspublic keys to inject; list of key-value configurationskeypublic ssh keyuseruser name
computer_namevm hostnameadmin_passwordroot passwordpre_scriptpre-customization scriptpost_scriptpost-customization scriptscript_executorscript executor, ‘/bin/bash’ by default
hardwarekey-value hardware customization sectioncpuvm cpu countmemoryvm memory size, in MB
management_networkmanagement network namevcloud_configsee the vCloud Configuration.
Mapped Operations:
cloudify.interfaces.lifecycle.createcreates the VApp.cloudify.interfaces.lifecycle.startstarts the VApp, if it’s not already started.cloudify.interfaces.lifecycle.stopstops the VApp, if it’s not already stopped.cloudify.interfaces.lifecycle.deletedeletes the VApp and waits for termination.cloudify.interfaces.lifecycle.creation_validationvalidates Server node parameters before creation.
Attributes:
vcloud_vapp_namecreated VApp name
Two additional runtime-properties are available on node instances of this type once the cloudify.interfaces.host.get_state operation succeeds:
networksserver networks information.ipthe private IP (ip on the internal network) of the server.
cloudify.vcloud.nodes.Network
Derived From: cloudify.nodes.Network
Properties:
networkkey-value network configuration.edge_gatewayedge gateway namenamenetwork namestatic_rangestatic ip allocation pool rangenetmasknetwork netmaskgateway_ipnetwork gatewaydnslist of dns ip addressesdns_suffixdns suffixdhcpdhcp settingsdhcp_rangeDHCP pool rangedefault_leasedeault lease in secondsmax_leasemaximum lease in seconds
use_external_resourcea boolean for setting whether to create the resource or use an existing one. Defaults tofalse.resource_idname to give to the new resource or the name or ID of an existing resource when theuse_external_resourceproperty is set totrue. Defaults to''(empty string).vcloud_configsee the vCloud Configuration.
Mapped Operations:
cloudify.interfaces.lifecycle.createcreates the networkcloudify.interfaces.lifecycle.deletedeletes the networkcloudify.interfaces.lifecycle.creation_validationvalidates Network node parameters before creation
Attributes:
vcloud_network_namenetwork name
cloudify.vcloud.nodes.Port
Derived From: cloudify.nodes.Port
Properties:
portkey-value server network port configuration.networknetwork name.ip_allocation_modeip allocation mode. Can be ‘dhcp’, ‘pool’ or ‘manual’.ip_addressip address if ip allocation mode is ‘manual’.mac_addressinterface MAC address.primary_interfaceis interface primary (true or false).
vcloud_configsee the vCloud Configuration.
Mapped Operations:
cloudify.interfaces.lifecycle.creation_validationvalidates Port node parameters
cloudify.vcloud.nodes.FloatingIP
Derived From: cloudify.nodes.VirtualIP
Properties:
floatingipkey-value floating ip configuration.edge_gatewayvCloud gateway namepublic_ippublic ip. If not specified public ip will be allocated from the pool of free public ips.
vcloud_configsee the vCloud Configuration.
Mapped Operations:
cloudify.interfaces.lifecycle.creation_validationvalidates FloatingIP node parameters
Attributes:
public_ippublic ip address
cloudify.vcloud.nodes.PublicNAT
Derived From: cloudify.nodes.VirtualIP
Properties:
natkey-value NAT configuration.edge_gatewayvCloud gateway namepublic_ippublic ip. If not specified public ip will be allocated from the pool of free public ips.
ruleskey-value NAT rules configuration.protocolnetwork protocol. Can be ‘tcp’, ‘udp’ or ‘any’. Applies only for ‘DNAT’.original_portoriginal port. Applies only for ‘DNAT’.translated_porttranslated port. Applies only for ‘DNAT’.typelist of NAT types. Can be ‘SNAT’, ‘DNAT’ or both.
use_external_resourcea boolean for setting whether to create the resource or use an existing one. Defaults tofalse.vcloud_configsee the vCloud Configuration.
Mapped Operations:
cloudify.interfaces.lifecycle.creation_validationvalidates PublicNAT node parameters
Attributes:
public_ippublic ip address
cloudify.vcloud.nodes.KeyPair
Derived From: cloudify.nodes.Root
Properties:
private_key_pathpath to private ssh key file.public_keykey-value public key configurationkeyssh public keyuseruser name
private_keykey-value private key configurationcreate_file: whether to save the file or not, use with auto_generate: true.
auto_generate: use if you want to auto-generate the key.
Mapped Operations:
cloudify.interfaces.lifecycle.creation_validationvalidates KeyPair node parameters
cloudify.vcloud.nodes.SecurityGroup
Derived From: cloudify.nodes.SecurityGroup
Properties:
security_groupkey-value SecurityGroup configurationedge_gatewayvCloud gateway name
rulessecurity group rules; list of key-value configurationsprotocol‘tcp’, ‘udp’, ‘icmp’ or ‘any’sourcesource of traffic to apply firewall rule on. Can be ‘internal’, ‘external’, ‘host’, ‘any’, ip address or ip range.source_portport number or ‘any’destinationdestination of traffic to apply firewall rule on. Can be ‘internal’, ‘external’, ‘host’, ‘any’, ip address or ip range.destination_portport number or ‘any’action‘allow’ or ‘deny’log_trafficcapture traffic, ‘true’ or ‘false’descriptionrule description
vcloud_configsee the vCloud Configuration.
Mapped Operations:
cloudify.interfaces.lifecycle.creation_validationvalidates SecurityGroup node parameters
Relationships
cloudify.vcloud.server_connected_to_floating_ip
Description: A relationship for associating FloatingIP node with Server node.
Mapped Operations:
cloudify.interfaces.relationship_lifecycle.establish: associates FloatingIP with Server.cloudify.interfaces.relationship_lifecycle.unlink: dissociates FloatingIP from Server.
cloudify.vcloud.server_connected_to_port
Description: A relationship for connecting Server to Port. Note: This relationship has no operations associated with it; The server will use this relationship to connect to the port upon server creation.
cloudify.vcloud.port_connected_to_network
Description: A relationship for connecting Port to Network. Note: This relationship has no operations associated with it.
cloudify.vcloud.server_connected_to_network
Description: A relationship for connecting Server to Network. Note: This relationship has no operations associated with it; The server will use this relationship to connect to the network upon server creation. It will use DHCP for ip allocation.
cloudify.vcloud.server_connected_to_public_nat
Description: A relationship for associating PublicNAT and Server.
Mapped Operations:
cloudify.interfaces.relationship_lifecycle.establish: associates PublicNAT with Server.cloudify.interfaces.relationship_lifecycle.unlink: dissociates PublicNAT from Server.
cloudify.vcloud.server_connected_to_security_group
Description: A relationship for associating SecurityGroup and Server.
Mapped Operations:
cloudify.interfaces.relationship_lifecycle.establish: associates SecurityGroup with Server.cloudify.interfaces.relationship_lifecycle.unlink: dissociates SecurityGroup from Server.
cloudify.vcloud.net_connected_to_public_nat
Description: A relationship for associating PublicNAT and Network.
Mapped Operations:
cloudify.interfaces.relationship_lifecycle.establish: associates PublicNAT with Network.cloudify.interfaces.relationship_lifecycle.unlink: dissociates PublicNAT from Network.
Examples
Example I
This example will show how to use some of the types of this plugin.
The following is an excerpt from the blueprint’s blueprint.node_templates section:
example_server:
type: cloudify.vcloud.nodes.Server
properties:
server:
name: example-server
catalog: example-catalog
template: example-vapp-template
hardware:
cpu: 2
memory: 4096
guest_customization:
public_keys:
- key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCi64cS8ZLXP9xgzscr+m7bKBDdnhTxXaarJ8hIVgG5C7FHkF1Yj9Za+JIMqGjlwsOugFt09ZTvR1kQcIXdZQhs5HWhnG8UY7RkuUwO4FOFpL2VtMAleP/ZNXSZIGwwy4Sm/wtYOo8V5GPrJNbQnVtsW2NJNt6mB1geJzlshbl9wpshHlFSOz6jV2L8k2kOq32nt/Wa3qpDk20IbKnO9wJYWHVzvyJ4bTOyHowStAABFEj8O7XmoQp8jdUuTj+qAOgCROTAQh93XbS3PJjaQYBhxLOOreYYeqjKG/8IUlFxtRdUn7MLS6Rd15AP2HnjhjKad2KqnOuFZqiTLBu+CGWf
user: ubuntu
computer_name: { get_input: manager_server_name }
management_network: existing-network
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
relationships:
- target: example_port
type: cloudify.vcloud.server_connected_to_port
- target: example_port2
type: cloudify.vcloud.server_connected_to_port
- target: manager_floating_ip
type: cloudify.vcloud.server_connected_to_floating_ip
manager_floating_ip:
type: cloudify.vcloud.nodes.FloatingIP
properties:
floatingip:
edge_gateway: M000000000-1111
public_ip: 24.44.244.44
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
example_port:
type: cloudify.vcloud.nodes.Port
properties:
port:
network: existing-network
ip_allocation_mode: dhcp
primary_interface: true
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
relationships:
- target: example_network
type: cloudify.vcloud.port_connected_to_network
example_network:
type: cloudify.vcloud.nodes.Network
properties:
use_external_resource: true
resource_id: existing-network
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
example_port2:
type: cloudify.vcloud.nodes.Port
properties:
port:
network: new-network
ip_allocation_mode: manual
ip_address: 10.10.0.2
mac_address: 00:50:56:01:01:49
primary_interface: false
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
relationships:
- target: example_network2
type: cloudify.vcloud.port_connected_to_network
example_network2:
type: cloudify.vcloud.nodes.Network
properties:
network:
edge_gateway: M000000000-1111
name: new-network
static_range: 10.10.0.2-10.10.0.64
netmask: 255.255.255.0
gateway_ip: 10.10.0.1/24
dns: ['10.0.0.1', '8.8.8.8']
dns_suffix: test
dhcp:
dhcp_range: 10.0.0.65-10.0.0.254
default_lease: 3600
max_lease: 7200
vcloud_config: { get_property: [vcloud_configuration, vcloud_config] }
vcloud_configuration:
type: vcloud_configuration
properties:
vcloud_config:
username: user
password: pw
url: https://vchs.vmware.com
service_type: subscription
service: M000000000-1111
vdc: M000000000-1111
org: M000000000-1111
vCloud Configuration
The vCloud plugin requires credentials in order to authenticate and interact with vCloud.
This information will be gathered by the plugin from the following sources, each source possibly partially or completely overriding values gathered from previous ones:
- JSON file at
~/vcloud_config.jsonor at a path specified by the value of an environment variable namedVCLOUD_CONFIG_PATH - values specified in the
vcloud_configproperty for the node whose operation is currently getting executed (in the case of relationship operations, thevcloud_configproperty of either the source or target nodes will be used if available, with the source’s one taking precedence).
The structure of the JSON file in section (1), as well as of the vcloud_config property in section (2), is as follows:
{
"username": "",
"password": "",
"url": "",
"org": "",
"vdc": "",
"service": "",
"service_type": "",
"api_version": "",
"instance": "",
"org_url": "",
"ssl_verify": ""
}
usernamevCloud account username.passwordvCloud account password.urlvCloud url.orgOrganization name. Required only forondemandandsubscriptionservice types.instanceInstance uuid. Required only forondemandservice type.vdcVirtual Datacenter name.servicevCloud Service name.service_typeservice type. Can besubscription,ondemand,vcdorprivate.Privateis alias forvcdand both of this types can be used with private vcloud environment without any differences. Defaults tosubscription.api_versionvCloud API version. For Subscription defaults to5.6, for OnDemand - to5.7.regionregion name. Applies for OnDemand.org_urlorganization url. Required only forprivateservice type.edge_gatewayedge gateway name.ssl_verifyboolean flag for disable ssl certificate checks, have sense only forprivatecloud service with selfsigned certificates. Defaults toTrue
Tip
The vCloud manager blueprint stores the vCloud configuration used for the bootstrap process in a JSON file as described in (1) at ~/vcloud_config.json. Therefore, if they’ve been used for bootstrap, the vCloud configuration for applications isn’t mandatory as the plugin will default to these same settings.
Misc
VApp template
Template should have:
- one VM with root disk with OS, SSH server and VMware Tools installed.
Template should not have:
- any networks connected.