CSI vSphere module (VMWare vSphere Provisioner)
In the Shturval platform, the vSphere Container Storage Interface driver module allows you to use cloud storage of the vSphere virtualization platform. The module is a Container Storage Interface (CSI) driver and is responsible for:
- allocation of a permanent volume (PersistentVolume);
- mounting and unmounting a volume from a virtual machine.
Installing a chart in a cluster
The CSI vSphere module is not a critical service for the operation of the Shturval platform.
If CSI integration was enabled when creating a cluster with a vSphere provider, the vSphere CSI Module will be installed and no manual configuration will be required.
To install a module in the created cluster, in the graphical interface:
- go to the cluster;
- in the side menu, open the Services and Repositories section;
- go to the page Available charts;
- on the “shturval” tab, find the
shturval-capvs-csichart and click “Install”.
Select the required chart version. After selecting the chart version, the available “Service Configuration Options” (values) will be displayed on the right side of the screen. In the “Service Specification” block you must specify the following as customvalues:
- global parameters (
global); - access parameters to the vCenter server (
vcenter); - configuration of the used StorageClass for PersistentVolume (
storageclass).
Customvalues example
global:
config:
global:
insecure-flag: true
cluster-id: <your-parameter-value>
storageclass:
expansion: true
datastoreurl: <your-parameter-value>
vcenter:
<your-vCenter-value>:
server: <your-parameter-value>
user: <your-parameter-value>
password: <your-parameter-value>
datacenters:
- <your-parameter-value>
| Parameter | Description | Data type | Example |
|---|---|---|---|
global.insecure-flag | Enable security check. If vCenter uses a self-signed certificate the value should be true | boolean | true |
global.cluster-id | Unique cluster name | string | shturval-cluster |
storageclass.expansion | Defines the ability to dynamically expand PersistentVolumeClaim (PVC) | boolean | true |
storageclass.datastoreurl | vSphere datastore URL. In the vSphere virtualization platform, you can find the URL under Summary of the datastore | string | ds:///vmfs/volumes/5f9ae8c0-e4bedd20-8f0c-0894ef5d8f68/ |
vcenter.<your-vCenter-value> | vCenter name | string | 11/10/12/13 |
vcenter.server | vCenter IP or URL | string | 11/10/12/13 |
vcenter.user | Username to connect to vCenter. Must be specified with domain | string | shturval@domain.local |
vcenter.password | User password for connecting to vCenter | string | K8s_admin |
vcenter.datacenters | List of data centers | array | /DC03 |
Complete the chart installation by saving the settings.
Upon completion of installation, the cluster will receive additionalA StorageClass named vsphere-csi has been created. To further allocate PersistentVolumes in vsphere-csi, you must change the default StorageClass settings.
To do this in the graphical interface:
- go to the StorageClasses page of the Storage section;
- open the StorageClass named local-path and go to the Labels and Annotations tab;
- remove the
storageclass.kubernetes.io/is-default-class:trueannotation and save the changes.
New PersistentVolumeClaim (PVC) will now be allocated a PersistentVolume owned by vsphere-csi.
vCenter account
To configure vCenter service account access rights, go to page.
If the access account for the vCenter server has changed and the Vsphere Container Storage Interface driver is installed in the cluster, you need to adjust the module settings:
- Prepare a ShturvalServicePatch for application to the specification (ssc) CSI vSphere Module (
shturval-capvs-csi), where you specify valid account information in theuserandpasswordparameters.
Example ShturvalServicePatch
apiVersion: ops.shturval.tech/v1beta2
kind: ShturvalServicePatch
metadata:
name: <resource-name>
spec:
shturvalServiceConfigName: shturval-capvs-csi
customvalues:
global:
config:
vcenter:
<your-vCenter-value>:
user: <your-parameter-value>
password: <your-parameter-value>
| Parameter | Description | Data type | Example |
|---|---|---|---|
vcenter.user | Username to connect to vCenter. Must be specified with domain | string | shturval@domain.local |
vcenter.password | User password for connecting to vCenter | string | K8s_admin |
vcenter.<your-vCenter-value> | vCenter name | string | 11/10/12/13 |
- Load the prepared ShturvalServicePatch into the cluster using import manifests. Changes may take time to apply.
Migrating disks to vSphere
If necessary, in vSphere Client you can transfer disks (PVC) between datastores.
Migration may be required, for example, if there is no free space on the current datastore, load rebalancing across datastores, or decommissioning of the datastore.
Requirements and restrictions
- The source and destination datastores must be accessible to all nodes in the cluster.
- The target datastore must have enough free space to accommodate the migrated disk. The Datastore will not be available for selection if it does not have enough free space.
- Only 1 disk (PVC) can be moved at a time.
- If the disk is attached to the VM, then during the migration the VM will be blocked for other operations. It is not possible to attach/detach other disks to a VM, migrate a VM to another datastore, changeChange any VM configuration.
- Disk migration to PMEM datastore is not available because Cloud Native Storage does not support PMEM storage.
- A target datastore with an incompatible policy may be selected for migration.
- After migration, the disk may be located in one of the following folders on the target datastore:
- FCD (First Class Disk) directory;
- VM folder, if the disk is attached to the VM.
Before proceeding with the transfer steps:
- Make sure that the target datastore has enough free space to accommodate the disk being migrated.
- Make sure you have rights to the target datastore.
To perform a migration:
Navigate to a vCenter Server instance: data center, datastore, or cluster.
Open the Monitor tab and in the Cloud Native Storage section select Container Volumes. Please note! The Cloud Native Storage section is displayed if CNS disks exist.
Select a disk from the list and click Migrate on the top panel.
In the Migrate volume modal window, select the target datastore.
The target datastore may display a warning. You can continue with the migration if you receive the following two warnings:
- Policy incompatible—the storage policy of the target datastore does not coincide with the storage policy;
- Inaccessible volume—the disk is transferred from a datastore that is accessible from some nodes to a datastore that is not accessible from all nodes.
Select the consent checkbox and click Migrate to complete the migration.
Once the migration is complete, go to the target datastore and verify that the disk has been migrated.
Using vSphereCSI in a cluster with the Shturval v2 provider
Please note! Using vSphere CSI in a cluster with the Shturval v2 provider is only possible using hosts deployed on the vSphere virtualization platform.
Installation when creating a cluster
If you install the Vsphere Container Storage Interface driver when creating a cluster with the Shturval v2 provider, then on each host you must first make the following settings:
- For the management cluster before installation;
- For a client cluster - before adding hosts to the provider.
Enable the disk.EnableUUID option using the vSphere client.
- In the vSphere client, click on the VM, select “Edit Settings”.
- Go to the “VM Options” tab and expand the “Advanced” menu.
- Click “Edit Configuration” next to the item"Configuration Parameters".
- Configure the disk.EnableUUID parameter.
- If the parameter exists, make sure its value is set to “True”. If the parameter is not there, add it and set the value to “True”.
Disk.EnableUUID parameter
Name Value
disk.EnableUUID True
Upgrade your VM hardware version to version 15 or higher.
- In the vSphere client, navigate to the VM.
- Select “Actions” > “Compatibility” > “Upgrade VM Compatibility”.
- Click “Yes” to confirm the update.
- Select compatibility and click “OK”.
Add VMware Paravirtual SCSI storage controller to the VM.
- In the vSphere client, click on the VM and select “Edit Settings”.
- On the “Virtual Hardware” tab, click “Add New Device”.
- Select “SCSI Controller” from the drop-down menu.
- Expand “New SCSI controller” and in the “Change Type” menu select “VMware Paravirtual”.
- Click “OK”.
Installation in a deployed cluster
If you have deployed a cluster with the Shturval v2 provider on vSphere virtualization platform hosts and want to add vSphere CSI to a running cluster, you must:
- Edit the cluster node VM, make the settings:
Enable the disk.EnableUUID option using the vSphere client.
- In the vSphere client, click on the VM, select “Edit Settings”.
- Go to the “VM Options” tab and expand the “Advanced” menu.
- Click “Edit Configuration” next to “Configuration Parameters”.
- Configure the disk.EnableUUID parameter.
- If the parameter exists, make sure its value is set to “True”. If the parameter is not there, add it and set the value to “True”.
Disk.EnableUUID parameter
Name Value
disk.EnableUUID True
Upgrade your VM hardware version to version 15 or higher.
- In the vSphere client, navigate to the VM.
- Select “Actions” > “Compatibility” > “Upgrade VM Compatibility”.
- Click “Yes” to confirm the update.
- Select compatibility and click “OK”.
Add VMware Paravirtual SCSI storage controller to the VM.
- In the vSphere client, click on the VM and select “Edit Settings”.
- On the “Virtual Hardware” tab, click “Add New Device”.
- Select “SCSI Controller” from the drop-down menu.
- Expand “New SCSI controller” and in the “Change Type” menu select “VMware Paravirtual”.
- Click “OK”.
Execute sequentially:
Drain the node, and reboot the edited VM.
After loading the node, execute uncordon, wait for the load to returnI’m on a node, move to drain the next node.
Execute on all required nodes.
If vSphere CSI was previously installed, remove it.
Install the new vSphere CSI in the shturval-capvs-csi namespace.
Add a config to customvalues, filling it with your data.
Customvalues example
global:
config:
global:
insecure-flag: true
cluster-id: <your-parameter-value>
storageclass:
expansion: true
datastoreurl: <your-parameter-value>
vcenter:
<your-vCenter-value>:
server: <your-parameter-value>
user: <your-parameter-value>
password: <your-parameter-value>
datacenters:
- <your-parameter-value>
| Parameter | Description | Data type | Example |
|---|---|---|---|
global.insecure-flag | Enable security check. If vCenter uses a self-signed certificate the value should be true | boolean | true |
global.cluster-id | Unique cluster name | string | shturval-cluster |
storageclass.expansion | Defines the ability to dynamically expand PersistentVolumeClaim (PVC) | boolean | true |
storageclass.datastoreurl | vSphere datastore URL. In the vSphere virtualization platform, you can find the URL under Summary of the datastore | string | ds:///vmfs/volumes/5f9ae8c0-e4bedd20-8f0c-0894ef5d8f68/ |
vcenter.<your-vCenter-value> | vCenter name | string | 11/10/12/13 |
vcenter.server | vCenter IP or URL | string | 11/10/12/13 |
vcenter.user | Username to connect to vCenter. Must be specified with domain | string | shturval@domain.local |
vcenter.password | User password for connecting to vCenter | string | K8s_admin |
vcenter.datacenters | List of data centers | array | /DC03 |
StorageClass will be created automatically as default. Remove the default flag from one of the StorageClass (local path or vSphere).