vSphere Container Storage Plug-in supports volume provisioning on a preferential datastore. Preferential datastores are only supported for block volumes.
You can use this functionality in an environment with a replicated datastore that is shared across two topology domains, or sites. The datastore is active in one of the topology domains, and is passive in the other.
When a site failure occurs, the active datastore on the failed site becomes passive, and the passive datastore on the other site becomes active.
In the following diagram, the DS-1 datastore is active in Site 1 and passive in Site 2. The DS-2 datastore is active in Site 2 and passive in Site 1.
Both datastores, DS-1 and DS-2, are accessible to all nodes in both sites. A typical volume provisioning request for Site 1 would provision a volume on either DS-1 or DS-2.
You can set preference to a particular datastore for a site, so that volume provisioning is limited only to the active datastore.
In this example, the DS-1 datastore is set as a preferred datastore for Site 1 and DS-2 datastore is a preferred datastore for Site 2.
Prerequisites
- Ensure that the vSphere Container Storage Plug-in version is 2.6.1 or later.
- Preferential datastore requires a topology aware Kubernetes deployment. See Deploying vSphere Container Storage Plug-in with Topology.
Procedure
Results
site-1
ensures that the volume is allocated on the DS-1 datastore.
What to do next
To customize this interval, you can adjust or define the csi-fetch-preferred-datastores-intervalinmin
setting within the global section of the vSphere config secret.