Minimum required permissions in vCenter/VMware
The vCenter account a resource handler authenticates as needs a role with the privileges below
11 minute read
Cloud Management Platform (CMP) supports vCenter versions 6.5 through 9.x. A CMP environment is created for each imported cluster. The VMware Cloud on AWS resource handler is deprecated — use this handler for VMware Cloud on AWS virtual machines.
Go to Admin > Resource Handlers, select Add, then select VMware vCenter under Private Cloud.
Fill in the credentials dialog and select Continue.
Enter a name and an optional description, choose clusters under Import VMware Clusters, set any remaining options, then select Done.
You must select at least one cluster. CMP creates an environment per cluster and runs a Sync Resource Handler metadata job to import the clusters, datastores, datastore tiers, networks, and templates.
| Field | Description |
|---|---|
| IP address | The host name or IP address of the vCenter server. |
| Port | The API port. Defaults to 443. |
| Account username | The vCenter account CMP authenticates as. CMP uses it for every management action, including creating servers, power operations, and syncing. |
| Password | The password for that account. If the password vault feature is enabled, this field offers Locally Stored or Vault Managed. Select Vault Managed to read the secret from a configured vault provider. See Use password vaults. |
| SSL Verification | Whether CMP verifies the vCenter server’s SSL certificate. |
The settings dialog also includes Virtual folder path, remote console options, VM sync filters, and Split by cluster, which splits sync jobs so each one covers a single cluster. To change them later, open the handler’s Overview tab and select Edit Settings.
An environment cannot be used until a template is imported and attached to it; the Templates tab shows a warning icon until this is done.
Select Sync templates to pick up templates added in vCenter since the last import.
Import networks from the handler’s Networks tab, and datastores from its Storage tab with Import datastores.
The network adapter type set on a template in CMP overrides the adapter type of the virtual machines provisioned from it in vCenter. It may also override the adapter type on the template in vCenter.
If your vCenter supports advanced network configurations such as VXLANs and edge appliances, configure them on the handler’s NSX tab.
Defines the NSX Manager connection used to create VXLANs and edge appliances. See Network virtualization.
Sets the defaults used when creating an NSX Edge Services Gateway appliance, such as Provider Network, Cluster, Datastore, and CLI Credentials.
The provider network specified in the NSX Edge Configuration must be associated with an IP Pool; otherwise, CMP cannot determine the IP address for the gateway’s uplink interface. That network also needs a gateway and netmask configured in CMP.
The following parameters are imported, with options populated by CMP from what it discovers in vCenter.
| Parameter | Description |
|---|---|
| VMware Datastore | Required. The datastore where a server’s disks are placed. |
| VMware Disk Provisioning Type | Required. How the disk is provisioned. |
| VMware Resource Pool | The resource pool a server is created in. |
| NSX Transport Zone | The NSX transport zone to use. Applies only when the handler has an NSX endpoint. |
| NSX Edge | The NSX edge appliance to use. Applies only when the handler has an NSX endpoint. |
VMware Cluster is not a parameter you set: CMP records it in the environment on import. VMware Adapter Type is set per network interface rather than per server. You can add VMware Datastore Free Space to an environment as described below.
Give this parameter a single option on the environment. It matters most when adding a disk to an existing server.
If the server has no value for it, because it was discovered or built before the parameter was configured, CMP falls back to the environment and takes the first option it finds, so a single option is the safer configuration. If neither the server nor the environment has a value, CMP uses the global default. Global options and options set on a group are not consulted when adding a disk.
vCenter needs a datastore and a disk provisioning type whenever a disk is added. The modification API accepts these parameters:
disk_size: the new size for the original disk.new_disk_size: the size of a disk being added.vmware_datastore: the datastore to provision the disk to.vmware_disk_type: the provisioning type for the disk.By default, CMP uses the guest customization tools in a vCenter template to set the host name, IP address, DNS servers, WINS servers, domain membership, and similar values on a new virtual machine.
For finer control over Windows, add the Sysprep Answer File parameter to a vCenter-backed environment and set its value to the contents of an unattend.xml file. CMP treats the file as a template, so values such as {{ server.hostname }} resolve at build time. See Using Windows Sysprep with resource handlers.
When a Sysprep answer file is supplied, CMP ignores every other customization parameter. The answer file must specify all of them.
CMP treats every VMware tag as having single cardinality: one tag value per category per virtual machine. If a VMware category allows several tags, only one of their values appears in CMP. Changing the value of a parameter linked to a tag in CMP removes the other values from the virtual machine.
Tags are synchronized only with vCenter 6.5 or later.
vCenter tags do not sync both ways. Tags added in vCenter are synced to CMP, but tags removed in vCenter remain in CMP.
To limit which virtual machines CMP syncs by tag, see VM sync filters.
VM sync filters limit which virtual machines CMP imports on sync. Set them on the handler’s Overview tab under Edit Settings. Leave a field blank to disable that filter. To sync, a virtual machine must pass every filter you set.
| Field | Effect |
|---|---|
| VM Tags to Include | Syncs only virtual machines with a vSphere tag that matches a rule. |
| VM Names to Ignore | Skips virtual machines whose name matches a rule. |
| VM Folders To Ignore | Skips virtual machines in a folder that matches a rule. |
| VM Folders To Include | Syncs only virtual machines in a folder that matches a rule. |
These filters are separate from Tags, which brings tag values into CMP.
The next sync marks every virtual machine already in CMP that a filter leaves out as historical. Try new rules, especially include rules, on a test handler or during a maintenance window. A virtual machine that passes the filters again becomes active on the next sync.
Each field takes a comma-separated list of Python regular expressions:
.*. To match the whole string, end the rule with $..* in place of quantifiers such as {1,3}.(?i). Don’t put a space in front of (?i), even after a comma: .*cloudbolt.*,(?i).*test.*.When this field is set, CMP syncs only virtual machines with at least one vSphere tag that matches a rule. Virtual machines with no tags are left out.
CMP checks each rule against one string per tag category on the virtual machine: the category name, a colon, and the list of the virtual machine’s tags in that category. For example, the tag CB in the category managed_by_cb produces:
managed_by_cb:['CB']
In a rule, escape the square brackets with \. This rule syncs only virtual machines tagged CB in managed_by_cb:
managed_by_cb:\['CB'\]$
| Virtual machine’s tags | Strings checked | Synced |
|---|---|---|
CB in managed_by_cb |
managed_by_cb:['CB'] |
Yes |
CB in managed_by_cb, and prod in env |
managed_by_cb:['CB'] and env:['prod'] |
Yes, one string matches |
CB and Other in managed_by_cb |
managed_by_cb:['CB', 'Other'] |
No, $ rules out a second tag |
CBX in managed_by_cb |
managed_by_cb:['CBX'] |
No |
prod in env |
env:['prod'] |
No |
| No tags | None | No |
More examples:
| Goal | Rule |
|---|---|
CB in managed_by_cb, with or without other tags in that category |
managed_by_cb:.*'CB' |
Any tag in managed_by_cb |
managed_by_cb: |
CB in managed_by_cb, or prod in env |
managed_by_cb:\['CB'\]$, env:\['prod'\]$ |
Don’t write a rule that depends on the order of tags in a category. CMP lists them in the order vCenter returns them.
The tag filter depends on tag sync. If SYNC_VMWARE_TAGS = False is set in /var/opt/cloudbolt/proserv/customer_settings.py, CMP doesn’t fetch tags, skips this filter, and syncs every virtual machine.
CMP skips each virtual machine whose name matches a rule.
| Goal | Rule |
|---|---|
Name contains cloudbolt or test |
.*cloudbolt.*, .*test.* |
Same, in any case, for example CloudBolt01 or Test-01 |
(?i).*cloudbolt.*,(?i).*test.* |
Name contains both cloudbolt and test |
(?=.*cloudbolt)(?=.*test) |
Name starts with dev |
dev |
Name is exactly joetest1 |
joetest1$ |
There is no field to include virtual machines by name. To sync only some names, ignore every name that doesn’t match. This rule syncs only virtual machines whose names contain cloudbolt or test:
(?!.*(cloudbolt|test))
To sync only names that contain both words, use (?!.*cloudbolt), (?!.*test).
Set one or the other. CMP rejects the save if both have a value. Either field slows the sync, because CMP has to fetch each virtual machine’s folder.
Rules are checked against the name of the folder that directly holds the virtual machine, as shown in the VMs and Templates view in vCenter. Only the folder name counts, not its path: a virtual machine in Prod/Databases/Oracle is checked against Oracle. Folders with the same name in different places are treated alike.
A rule covers only the virtual machines directly in a matching folder. List every folder you want filtered. For example, to skip the virtual machines in Prod, Prod/Databases, and Prod/Databases/Oracle, use Prod$, Databases$, Oracle$.
This matters most for VM Folders To Include. CMP provisions virtual machines into a group subfolder of the virtual folder path, such as CloudBoltVMs/Development. If the field lists CloudBoltVMs$ but not the group folders, the next sync marks those virtual machines historical. List the group folders too, for example CloudBoltVMs$, Development$, Production$.
| Goal | Rule |
|---|---|
| One folder | Templates$ |
| Two folders | Templates$, AD Servers$ |
Folders whose names start with Secure Servers |
Secure Servers |
Folders whose names contain lab, in any case, for example QA-Lab or LAB01 |
(?i).*lab.* |
End a rule with $ to match the whole folder name. Templates also matches Templates-Old, but Templates$ doesn’t.
VM Folders To Include works the same way. For example, CloudBoltVMs$ syncs only the virtual machines directly in CloudBoltVMs, not those in its group subfolders.
The sync job’s progress shows how many virtual machines the filters left out:
Skipping 42 VMs based on exclusion rules on the resource handler.
The job log names each virtual machine left out and why, for example Excluding VM 'web01' due to it lacking an include tag.
If a tag rule leaves out a virtual machine you expected to sync, open the virtual machine in vCenter, note its tag categories and tags on the Summary tab, and build the string from them as shown in VM Tags to Include. If the tag rule has no effect at all, check that SYNC_VMWARE_TAGS is not set to False.
vCenter servers support snapshots. See Snapshots.
CMP places provisioned virtual machines in a folder on the vSphere client, and gives each group a subfolder of the same name. The default path is CloudBoltVMs/{{ group }}.
Change it with the same template syntax used for hostname templates.
CloudBoltVMs/{{ group }}
CloudBoltVMs/ is the root directory for virtual machines, and {{ group }} is the current group’s name. It produces paths such as CloudBoltVMs/Development and CloudBoltVMs/Production.
{% if group.parent %}/{{ group.parent }}/{{ group }}{% else %}/{% endif %}
This builds the path from the group hierarchy: a group with a parent gets both names, so “Subfolder” under “Parent” becomes /Parent/Subfolder, while a group with no parent becomes /Group.
The vCenter account a resource handler authenticates as needs a role with the privileges below
Reach vCenter directly from plugin code through its vSphere Web Services API or its vSphere Automation API