vSphere Plugin

The vSphere plugin enables you to use a vSphere-based infrastructure for deploying services and applications.

Plugin Requirements

vSphere Environment

vSphere Plugin Configuration

The vSphere plugin requires credentials and endpoint setup information in order to authenticate and interact with vSphere.

Accessing Secrets

It is recommended that you store your credentials as secrets. You can do this using the CLI. Secrets can then be accessed inside your blueprints, as follows:

 external_network:
    type: cloudify.vsphere.nodes.Network
    properties:

      connection_config:
        username: { get_secret: vsphere_username }
        password: { get_secret: vcenter_password }
        host: { get_secret: vcenter_hostname_or_ip }
        datacenter_name: { get_secret: datacenter_name }            
 

Providing Credentials as Environment Variables that are not Stored as Secrets

If you do not use secret storage, you must provide the following credentials as environment variables:

       connection_config:
        username: { vsphere_username }
        password: { vcenter_password }
        host: { vcenter_hostname_or_ip }
        datacenter_name: { datacenter_name }        
 

SSH Keys

ssh-keygen -b2048 -N "" -q -f ~/.ssh/cloudify-manager-kp.pem
ssh-keygen -b2048 -N "" -q -f ~/.ssh/cloudify-agent-kp.pem

OS Templates

Types

Tip

Each type has a connection_config property. It can be used to pass parameters for authentication.

cloudify.vsphere.nodes.Server

Derived From: cloudify.nodes.Compute

Interfaces

Properties:

Runtime Properties:

NOTE: Cloudify VSphere Plugin versions before 2.18.7 created the server during the start operation. 2.18.7 introduced the create operation. Usage of the start operation for Server creation will be disabled in a future version.

cloudify.vsphere.nodes.WindowsServer

Derived From: cloudify.nodes.Compute

Properties:

Runtime Properties:

cloudify.vsphere.nodes.Network

Derived From: cloudify.nodes.Network

Properties:

Runtime Properties:

cloudify.vsphere.nodes.Storage

Derived From: cloudify.nodes.Volume

Properties:

Runtime Properties:

Examples

Example I

example_server:
    type: cloudify.vsphere.nodes.Server
    properties:
        networking:
            domain: example.com
            dns_servers: ['8.8.8.8']
            connected_networks:
                -   name: example_management_network
                    management: true
                    switch_distributed: false
                    use_dhcp: true
                -   name: example_external_network
                    external: true
                    switch_distributed: true
                    use_dhcp: false
                    network: 10.0.0.0/24
                    gateway: 10.0.0.1
                    ip: 10.0.0.2
                -   name: example_network
                    switch_distributed: false
                    use_dhcp: true
            server:
                name: example_server
                template: example_server_template
                cpus: 1
                memory: 512
    relationships:
        - type: cloudify.relationships.depends_on
          target: example_network

example_network:
    type: cloudify.vsphere.nodes.Network
    properties:
        network:
            name: example_network
            vlan_id: 101
            vSwitch_name: vSwitch0
            switch_distributed: false

example_storage:
    type: cloudify.vsphere.nodes.Storage
    properties:
        storage:
            storage_size: 1
    relationships:
        - target: example_server
          type: cloudify.vsphere.storage_connected_to_server

Node by Node Explanation

  1. Creates a server. In the server, the networking property domain name is specified as example.com. In addition, the DNS server 8.8.8.8, and three existing networks to which to connect example_management_network, example_external_network and example_network are specified. In the server property, the server name as is specified as example_server, and the vm template name as example_server_template. The number of CPUs is specified as 1, and the RAM as 512 MB.

  2. Creates a network. The network name is specified as example_network, the network vLAN ID as 101, and an existing vSwitch name to connect to as example_vSwitch.

  3. Creates a virtual hard disk. The required storage size is specified as 1 GB and this storage is added to the example_server vm.