List of supported clouds > VMware vSphere
This document describes details specific to using your existing VMware vSphere cloud with Juju.
See more: VMware vSphere
When using the VMware vSphere cloud with Juju, it is important to keep in mind that it is a (1) machine cloud and (2) not some other cloud.
See more: Cloud differences in Juju
As the differences related to (1) are already documented generically in our Tutorial, How-to guides, and Reference docs, here we record just those that follow from (2).
Juju points of variation | Notes for the VMware vSphere cloud |
---|---|
setup (chronological order): | |
CLOUD | |
supported versions: | |
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. |
definition: | Cloud type: vsphere . You will need to provide a name for your cloud, the IP adress of your cluster’s vCenter, and the name(s) of any datacenter(s) that you want to enable Juju to be able to deploy to. If you want to use a YAML file: |
CREDENTIAL | |
definition: |
auth-type: userpass. You will have to provide your username, password and, optionally, the vmfolder. |
CONTROLLER | |
notes on 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. |
other (alphabetical order:) | |
CONFIGURATION (model) | |
cloud-specific: |
datastore The datastore in which to create VMs. If this is not specified, the process will abort unless there is only one datastore available. - thin - Sparse provisioning, only written blocks will take up disk space on the datastore - thick - The entire size of the virtual disk will be deducted from the datastore, but unwritten blocks will not be zeroed out. This adds 2 potential pitfalls. See comments in provider/vsphere/internal/vsphereclient/client.go regarding DiskProvisioningType. - thickEagerZero (default) - The entire size of the virtual disk is deducted from the datastore, and unwritten blocks are zeroed out. Improves latency when committing to disk, as no extra step needs to be taken before writing data. |
CONSTRAINT | |
conflicting: | |
allocate-public-id |
![]() |
arch |
![]() Valid values: [amd64, i386] . |
container |
![]() |
cores |
![]() |
cpu-power |
![]() |
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 |
![]() |
PLACEMENT DIRECTIVE | |
<machine> |
TBA |
subnet=... |
![]() |
system-id=... |
![]() |
zone=... |
![]() |
RESOURCE (cloud) Consistent naming, tagging, and the ability to add user-controlled tags to created instances. |
![]() |
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" -s focal -r $DATA_STORE -u $CLOUD_ENDPOINT
juju-metadata generate-image -d $HOME/simplestreams/ -i "templates/juju-bionic-template" -s bionic -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-series=focal --bootstrap-constraints "arch=amd64"
Using add-image:
juju metadata add-image templates/bionic-test-template --series bionic
Levels of placement
When creating a controller, there are three levels of placement that Juju understands: cloud, region, and availability zone. In vSphere, these are mapped in two different ways depending on your topology:
- cloud (vSphere endpoint), region (Datacenter), availability zone (host)
- cloud (vSphere endpoint), region (Datacenter), availability zone (cluster)
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>
To create a controller using Datacenter ‘dc1’ you would enter the following:
juju bootstrap vsp-cloud/dc1 vsp-controller
Specify a datastore when deploying an application
There is a constraint called ‘root-disk-source’ that can stipulate the name of a vSphere datastore to house the root disk:
juju deploy myapp --constraints root-disk-source=mydatastore
Deploy applications to a specific host or cluster
Resource pools within a host or cluster can be specified with the ‘zones’ constraint:
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