To use the vSphere provider in the Shturval platform, you must have a service account and service roles in the virtualization platform with VMware vSphere 6.7 update 3 or 7.0 and higher.
Create a resource pool and prepare account credentials.
Note! Enter the service account in username@domain format.
Assign the following roles to the vSphere provider account:
custom role with service role #1 permissions;
system role Read only ;
if CSI is required, additionally assign a second custom role with service role #2 permissions. This is an auxiliary role; an account with only this role will not have all required permissions.
If separate CSI permissions are required, for example when the cluster does not use the vSphere provider, create a new account and custom roles for vSphere CSI.
Note! For correct connection, configure service account permissions as recommended. If you grant full permissions to the service account, every Datacenter the account can access must have a Datastore
Rights assignment scheme
Object
Role
Propagation (inheritance)
Comment
vCenter
Service role #2
No
vCenter where client cluster VMs run. Required for CSI
Datacenter
Read only
No
Datacenter for client cluster VMs
Cluster
Service role #1
No
Cluster for client cluster VMs
Host
Read only
No
On all hosts in the cluster where client cluster VMs run. Required for CSI
Resource pool
Service role #1
Yes (optional)
Resource pool for client cluster VMs
Folder
Service role #1
Yes
Folder for client cluster VMs and the template they are created from
Datastore
Service role #1
Yes
Datastore for client cluster VM disks
Distributed Switch
Read only
No
Distributed switch for client cluster VM network interfaces
Distributed Port Group
Service role #1
Yes
Distributed port group for client cluster VM network interfaces. Permissions must include the port group connected to the VM template network interface
When a cluster (not using the vSphere provider) needs vSphere cloud storage, create a separate account with the required roles. Use such an account, for example, in a cluster with the Shturval v2 provider when installing vSphere CSI.
Rights assignment scheme for vSphere CSI
Object
Role
Propagation (inheritance)
Comment
Datastore
CNS-DATASTORE
No
Datastore for client cluster VM disks
vCenter
CNS-SEARCH-AND-SPBM
No
vCenter where client cluster VMs run
Folder
CNS-VM
Yes
Folder containing client cluster VMs
Datacenter
CNS-HOST-CONFIG-STORAGE
No
Datacenter containing client cluster VMs
Cluster
CNS-HOST-CONFIG-STORAGE
No
Cluster containing client cluster VMs
Permissions for CNS-DATASTORE role
Category
Permission
Datastore
Low level file operations
Permissions for CNS-SEARCH-AND-SPBM roleHTML Table
Category
Permission
CNS
Searchable
Profile-driven storage
Profile-driven storage view
Permissions for CNS-VM roleHTML Table
Category
Permission
Virtual machine
Change Configuration:
Add existing disk
Add or remove device
Add new disk
Extend virtual disk
Remove disk
Permissions for CNS-HOST-CONFIG-STORAGE roleHTML Table
Category
Permission
Host
Configuration:
Storage partition configuration
Example role creation commands
# Role for read, write, delete, and rename in datastoregovc role.create CNS-DATASTORE Datastore.FileManagement
# Role for viewing host, cluster, volume, and VM informationgovc role.create CNS-SEARCH-AND-SPBM Cns.Searchable StorageProfile.View
# Role to add/remove VM disks and non-disk devicesgovc role.create CNS-VM VirtualMachine.Config.AddExistingDisk VirtualMachine.Config.AddRemoveDevice VirtualMachine.Config.AddNewDisk VirtualMachine.Config.DiskExtend VirtualMachine.Config.RemoveDisk
# Role for VMFS and iSCSI host configurationgovc role.create CNS-HOST-CONFIG-STORAGE Host.Config.Storage
Note! These roles let you split access in vSphere, granting permissions:
on a specific Datastore;
to manage VMs in a specific k8s folder;
to configure hosts in the required cluster.
Example commands for split access permissions
# Grant permissions on Datastore named Cluster01-vSANgovc permissions.set -principal <username>@vsphere.local -propagate=false -role CNS-DATASTORE /Datacenter/datastore/Cluster01-vSAN
# Search information from rootgovc permissions.set -principal <username>@vsphere.local -propagate=false -role CNS-SEARCH-AND-SPBM /
# Grant VM management permissions in k8s foldergovc permissions.set -principal <username>@vsphere.local -propagate=true -role CNS-VM /Datacenter/vm/k8s/
# Grant host configuration permissions on Cluster01 and Datacentergovc permissions.set -principal <username>@vsphere.local -propagate=false -role CNS-HOST-CONFIG-STORAGE /Datacenter /Datacenter/host/Cluster01
You can skip splitting permissions in vSphere. Create one combined role with the required permissions and assign it to your account.