VMware

The VMware provider manages a single resource, vmware_guest.

vmware_guest

VMware VMs can be provisioned using this resource

  • docs1.7

    Topology Example <workspace/topologies/vmware.yml>

  • Ansible module https://docs.ansible.com/ansible/latest/modules/vmware_guest_module.html

Topology Schema

Within Linchpin, the vmware_guest supports all the Ansible module options with the same schema structure. All the limitation of the module apply too.

Additional Dependencies

The vmware resources group requires additional dependency, the following must be installed:

  • PyVmomi

$ pip install linchpin[vmware]

Credentials Management

Environment Variables

Linchpin honors the following environment variables:

Environment variable

Credentials variable

Description

VMWARE_PASSWORD

password

The password of the vSphere vCenter or ESXi server

VMWARE_USER

username

The username of the vSphere vCenter or ESXi server.

VMWARE_HOST

hostname

The hostname or IP address of the vSphere vCenter or ESXi server.

VMWARE_PORT

port

The port number of the vSphere vCenter or ESXi server.

VMWARE_VALIDATE_CERTS

validate_certs

Allows connection when SSL certificates are not valid.

Credentials File

An example credentials file may look like this for vmware.

$ cat vmware.key
  [default]
  username=root
  password=VMware1!
  hostname=192.168.122.125
  validate_certs=false

See also

Examples for all Providers for provider-specific credentials examples.

To use these credentials, the user must tell LinchPin two things. The first is which credentials to use. The second is where to find the credentials data.

Using Credentials

In the topology, a user can specific credentials. The credentials are described by specifying the file, then the profile. As shown above, the filename is ‘vmware.key’. The user could pick either profile in that file.

---
topology_name: vmware-new
resource_groups:
  - resource_group_name: vmware-new
    resource_group_type: vmware
    resource_definitions:
      - role: vmware_guest
        name: vmware-node
        cdrom:
          type: iso
          iso_path: "[ha-datacenter] tc_vmware4.iso"
        folder: /
        datastore: ha-datacenter
        disk:
          - size_mb: 10
            type: thin
        hardware:
          num_cpus: 1
          memory_mb: 256
        networks:
          - name: VM Network
        wait_for_ip_address: yes
    credentials:
      filename: vmware.key
      profile: default

The important part in the above topology is the credentials section. Adding credentials like this will look up, and use the credentials provided.

Credentials Location

By default, credential files are stored in the default_credentials_path, which is ~/.config/linchpin.

Hint

The default_credentials_path value uses the interpolated :dirs1.5:`default_config_path <workspace/linchpin.conf#L22>` value, and can be overridden in the :docs1.5:`linchpin.conf`.

The credentials path (or creds_path) can be overridden in two ways.

It can be passed in when running the linchpin command.

$ linchpin -vvv --creds-path /dir/to/creds up vmware-new

Note

The vmware.key file could be placed in the default_credentials_path. In that case passing --creds-path would be redundant.

Or it can be set as an environment variable.

$ export CREDS_PATH=/dir/to/creds
$ linchpin -v up vmware-new