The VMware vSphere cloud and Juju

This document describes details specific to using your existing VMware vSphere cloud with Juju.

See more: VMware vSphere

When using this cloud with Juju, it is important to keep in mind that it is a (1) machine cloud and (2) not some other cloud.

As the differences related to (1) are already documented generically in the rest of the docs, here we record just those that follow from (2).

Requirements

In order to add a vSphere cloud you will need to have an existing vSphere installation which supports, or has access to, the following:

- VMware Hardware Version 8 (or greater)

- ESXi 5.0 (or greater)

- Internet access

- DNS and DHCP

Juju supports both high-availability vSAN deployments as well and standard deployments.

Notes on juju add-cloud

Type in Juju: vsphere

Name in Juju: User-defined.

Notes on juju add-credential

Authentication types

userpass

Attributes:

  • user: The username to authenticate with. (required)

  • password: The password to authenticate with. (required)

  • vmfolder: The folder to add VMs from the model. (optional)

Notes on juju bootstrap

Recommended: Bootstrap with the following cloud-specific model-configuration keys: datastore and primary-network. See more below.

Pro tip: When creating a controller with vSphere, a cloud image is downloaded to the client and then uploaded to the ESX host. This depends on your network connection and can take a while. Using templates can speed up bootstrap and machine deployment.

Cloud-specific model configuration keys

datastore

The datastore in which to create VMs. If this is not specified, the process will abort unless there is only one datastore available.

type

string

default value

schema.omit{}

immutable

false

mandatory

false

primary-network

The primary network that VMs will be connected to. If this is not specified, Juju will look for a network named “VM Network”.

type

string

default value

schema.omit{}

immutable

false

mandatory

false

force-vm-hardware-version

The HW compatibility version to use when cloning a VM template to create a VM. The version must be supported by the remote compute resource, and greater or equal to the template’s version.

type

int

default value

0

immutable

false

mandatory

false

enable-disk-uuid

Expose consistent disk UUIDs to the VM, equivalent to disk.EnableUUID. The default is True.

type

bool

default value

true

immutable

false

mandatory

false

disk-provisioning-type

Specify how the disk should be provisioned when cloning the VM template. Allowed values are: thickEagerZero (default), thick and thin.

type

string

default value

“thick”

immutable

false

mandatory

false

external-network

An external network that VMs will be connected to. The resulting IP address for a VM will be used as its public address.

type

string

default value

“”

immutable

false

mandatory

false

Supported constraints

CONSTRAINT

conflicting:

supported?

- allocate-public-ip

- arch


Valid values: {ref}amd64]`.

- container

- cores

- cpu-power

- image-id

- instance-role

- instance-type

- mem

- root-disk

- root-disk-source


root-disk-source is the datastore for the root disk

- spaces

- tags

- virt-type

- zones

Use to specify resurce pools within a host or cluster, e.g.

juju deploy myapp --constraints zones=myhost

juju deploy myapp --constraints zones=myfolder/myhost

juju deploy myapp --constraints zones=mycluster/mypool

juju deploy myapp --constraints zones=mycluster/myparent/mypool

Supported placement directives

PLACEMENT DIRECTIVE

<machine>

subnet=<subnet>

system-id=<system ID>

zone=<zone>


Valid values: <cluster|host>.

:warning: If your topology has a cluster without a host, Juju will see this as an availability zone and may fail silently. To solve this, either make sure the host is within the cluster, or use a placement directive: juju bootstrap vsphere/<datacenter> <controllername> --to zone=<cluster|host>.

Other notes

Using templates

To speed up bootstrap and deploy, you can use VM templates, already created in your vSphere. Templates can be created by hand on your vSphere, or created from an existing VM.

Examples assume that the templates are in directory $DATA_STORE/templates.

Via simplestreams:

mkdir -p $HOME/simplestreams
juju-metadata generate-image -d $HOME/simplestreams/ -i "templates/juju-focal-template" --base [email protected] -r $DATA_STORE -u $CLOUD_ENDPOINT
juju-metadata generate-image -d $HOME/simplestreams/ -i "templates/juju-noble-template" --base [email protected] -r $DATA_STORE -u $CLOUD_ENDPOINT
juju bootstrap --metadata-source $HOME/image-streams vsphere

Bootstrap juju with the controller on a VM running focal:

juju bootstrap vsphere --bootstrap-image="templates/focal-test-template"  --bootstrap-base [email protected] --bootstrap-constraints "arch=amd64"

Using add-image:

juju metadata add-image templates/bionic-test-template --base [email protected]