Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion manifests/guestcluster/1.32/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ data:
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
"block-volume-snapshot": "true"
"tkgs-ha": "true"
"cnsmgr-suspend-create-volume": "true"
"csi-windows-support": "true"
"workload-domain-isolation": "true"
"sv-pvc-snapshot-protection-finalizer": "false"
Expand Down
1 change: 0 additions & 1 deletion manifests/guestcluster/1.33/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@ data:
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
"block-volume-snapshot": "true"
"tkgs-ha": "true"
"cnsmgr-suspend-create-volume": "true"
"csi-windows-support": "true"
"workload-domain-isolation": "true"
"sv-pvc-snapshot-protection-finalizer": "false"
Expand Down
1 change: 0 additions & 1 deletion manifests/guestcluster/1.34/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ data:
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
"block-volume-snapshot": "true"
"tkgs-ha": "true"
"cnsmgr-suspend-create-volume": "true"
"csi-windows-support": "true"
"workload-domain-isolation": "true"
"sv-pvc-snapshot-protection-finalizer": "false"
Expand Down
1 change: 0 additions & 1 deletion manifests/supervisorcluster/1.30/cns-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ data:
"block-volume-snapshot": "true"
"tkgs-ha": "true"
"list-volumes": "true"
"cnsmgr-suspend-create-volume": "true"
"storage-quota-m2": "true"
"vdpp-on-stretched-supervisor": "true"
"cns-unregister-volume": "false"
Expand Down
1 change: 0 additions & 1 deletion manifests/supervisorcluster/1.31/cns-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ data:
"block-volume-snapshot": "true"
"tkgs-ha": "true"
"list-volumes": "true"
"cnsmgr-suspend-create-volume": "true"
"storage-quota-m2": "true"
"vdpp-on-stretched-supervisor": "true"
"cns-unregister-volume": "false"
Expand Down
1 change: 0 additions & 1 deletion manifests/supervisorcluster/1.32/cns-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,6 @@ data:
"block-volume-snapshot": "true"
"tkgs-ha": "true"
"list-volumes": "true"
"cnsmgr-suspend-create-volume": "true"
"storage-quota-m2": "true"
"vdpp-on-stretched-supervisor": "true"
"cns-unregister-volume": "false"
Expand Down
1 change: 0 additions & 1 deletion pkg/common/unittestcommon/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func GetFakeContainerOrchestratorInterface(orchestratorType int) (commonco.COCom
"csi-windows-support": "true",
"use-csinode-id": "true",
"pv-to-backingdiskobjectid-mapping": "false",
"cnsmgr-suspend-create-volume": "true",
"topology-preferential-datastores": "true",
"multi-vcenter-csi-topology": "true",
"listview-tasks": "true",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ func getReleasedVanillaFSS() map[string]struct{} {
common.BlockVolumeSnapshot: {},
common.CSIWindowsSupport: {},
common.ListVolumes: {},
common.CnsMgrSuspendCreateVolume: {},
common.TopologyPreferentialDatastores: {},
common.MultiVCenterCSITopology: {},
common.CSIInternalGeneratedClusterID: {},
Expand Down
2 changes: 0 additions & 2 deletions pkg/csi/service/common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,6 @@ const (
ListVolumes = "list-volumes"
// PVtoBackingDiskObjectIdMapping is the feature to support pv to backingDiskObjectId mapping on vSphere CSI driver.
PVtoBackingDiskObjectIdMapping = "pv-to-backingdiskobjectid-mapping"
// Block Create Volume for datastores that are in suspended mode
CnsMgrSuspendCreateVolume = "cnsmgr-suspend-create-volume"
// TopologyPreferentialDatastores is the feature gate for preferential
// datastore deployment in topology aware environments.
TopologyPreferentialDatastores = "topology-preferential-datastores"
Expand Down
29 changes: 11 additions & 18 deletions pkg/csi/service/common/vsphereutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ type VanillaCreateBlockVolParamsForMultiVC struct {

// CreateBlockVolumeOptions defines the FSS required to create a block volume.
type CreateBlockVolumeOptions struct {
FilterSuspendedDatastores,
UseSupervisorId,
IsVdppOnStretchedSvFssEnabled bool
IsByokEnabled bool
Expand Down Expand Up @@ -101,7 +100,6 @@ func CreateBlockVolumeUtil(

var clusterMorefs []vim25types.ManagedObjectReference
var datastoreInfoList []*vsphere.DatastoreInfo

var containerClusterArray []cnstypes.CnsContainerCluster
clusterID := manager.CnsConfig.Global.ClusterID
if opts.UseSupervisorId {
Expand Down Expand Up @@ -146,12 +144,10 @@ func CreateBlockVolumeUtil(
createSpec.ActiveClusters = clusterMorefs
} else {
var datastores []vim25types.ManagedObjectReference
if opts.FilterSuspendedDatastores {
sharedDatastores, err = vsphere.FilterSuspendedDatastores(ctx, sharedDatastores)
if err != nil {
log.Errorf("Error occurred while filter suspended datastores, err: %+v", err)
return nil, csifault.CSIInternalFault, err
}
sharedDatastores, err = vsphere.FilterSuspendedDatastores(ctx, sharedDatastores)
if err != nil {
log.Errorf("Error occurred while filter suspended datastores, err: %+v", err)
return nil, csifault.CSIInternalFault, err
}

var datastoreObj *vsphere.Datastore
Expand All @@ -177,7 +173,7 @@ func CreateBlockVolumeUtil(
continue
}

if opts.FilterSuspendedDatastores && vsphere.IsVolumeCreationSuspended(ctx, datastoreInfoObj) {
if vsphere.IsVolumeCreationSuspended(ctx, datastoreInfoObj) {
continue
}
datastoreObj = datastoreInfoObj.Datastore
Expand Down Expand Up @@ -223,7 +219,7 @@ func CreateBlockVolumeUtil(
continue
}

if opts.FilterSuspendedDatastores && vsphere.IsVolumeCreationSuspended(ctx, datastoreInfoObj) {
if vsphere.IsVolumeCreationSuspended(ctx, datastoreInfoObj) {
continue
}
datastoreObj = datastoreInfoObj.Datastore
Expand Down Expand Up @@ -585,7 +581,7 @@ func CreateBlockVolumeUtilForMultiVC(ctx context.Context, reqParams interface{},
func CreateFileVolumeUtil(ctx context.Context, clusterFlavor cnstypes.CnsClusterFlavor,
vc *vsphere.VirtualCenter, volumeManager cnsvolume.Manager, cnsConfig *config.Config, spec *CreateVolumeSpec,
datastores []*vsphere.DatastoreInfo, vSphereClusterMorefs []string,
filterSuspendedDatastores, useSupervisorId bool, extraParams interface{}) (
useSupervisorId bool, extraParams interface{}) (
*cnsvolume.CnsVolumeInfo, string, error) {
log := logger.GetLogger(ctx)
var err error
Expand All @@ -600,15 +596,12 @@ func CreateFileVolumeUtil(ctx context.Context, clusterFlavor cnstypes.CnsCluster
return nil, csifault.CSIInternalFault, err
}
}

var datastoreMorefs []vim25types.ManagedObjectReference
if len(datastores) != 0 {
if filterSuspendedDatastores {
datastores, err = vsphere.FilterSuspendedDatastores(ctx, datastores)
if err != nil {
log.Errorf("Error occurred while filter suspended datastores, err: %+v", err)
return nil, csifault.CSIInternalFault, err
}
datastores, err = vsphere.FilterSuspendedDatastores(ctx, datastores)
if err != nil {
log.Errorf("Error occurred while filter suspended datastores, err: %+v", err)
return nil, csifault.CSIInternalFault, err
}
if spec.ScParams.DatastoreURL == "" {
datastoreMorefs = getDatastoreMoRefs(datastores)
Expand Down
14 changes: 5 additions & 9 deletions pkg/csi/service/vanilla/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var (

// The following variables hold feature states for multi-vcenter-csi-topology, CSI Migration
// and authorisation check.
multivCenterCSITopologyEnabled, csiMigrationEnabled, filterSuspendedDatastores,
multivCenterCSITopologyEnabled, csiMigrationEnabled,
isTopologyAwareFileVolumeEnabled, isCSITransactionSupportEnabled bool

// variables for list volumes
Expand Down Expand Up @@ -132,8 +132,6 @@ func (c *controller) Init(config *cnsconfig.Config, version string) error {
multivCenterCSITopologyEnabled = commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
common.MultiVCenterCSITopology)
csiMigrationEnabled = commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CSIMigration)
filterSuspendedDatastores = commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
common.CnsMgrSuspendCreateVolume)
isTopologyAwareFileVolumeEnabled = commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
common.TopologyAwareFileVolume)
isCSITransactionSupportEnabled = commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CSITranSactionSupport)
Expand Down Expand Up @@ -782,9 +780,7 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum

volumeInfo, faultType, err = common.CreateBlockVolumeUtil(ctx, cnstypes.CnsClusterFlavorVanilla,
c.manager, &createVolumeSpec, sharedDatastores, []string{},
common.CreateBlockVolumeOptions{
FilterSuspendedDatastores: filterSuspendedDatastores,
},
common.CreateBlockVolumeOptions{},
nil)
if err != nil {
return nil, faultType, logger.LogNewErrorCodef(log, codes.Internal,
Expand Down Expand Up @@ -1909,7 +1905,7 @@ func (c *controller) createFileVolume(ctx context.Context, req *csi.CreateVolume
// moving unto next VC. Need to throw a custom error for such scenarios.
volumeInfo, faultType, err = common.CreateFileVolumeUtil(ctx, cnstypes.CnsClusterFlavorVanilla,
vcenter, c.managers.VolumeManagers[vcHost], c.managers.CnsConfig, &createVolumeSpec,
fsEnabledCandidateDatastores, []string{}, filterSuspendedDatastores, false, nil)
fsEnabledCandidateDatastores, []string{}, false, nil)
if err != nil {
log.Error(err)
combinedErrMssgs = append(combinedErrMssgs, err.Error())
Expand Down Expand Up @@ -1967,7 +1963,7 @@ func (c *controller) createFileVolume(ctx context.Context, req *csi.CreateVolume
}
volumeInfo, faultType, err = common.CreateFileVolumeUtil(ctx, cnstypes.CnsClusterFlavorVanilla,
vcenter, c.managers.VolumeManagers[vcHost], c.managers.CnsConfig, &createVolumeSpec,
filteredDatastores, []string{}, filterSuspendedDatastores, false, nil)
filteredDatastores, []string{}, false, nil)
if err != nil {
return nil, faultType, logger.LogNewErrorCodef(log, codes.Internal,
"failed to create volume. Error: %+v", err)
Expand All @@ -1981,7 +1977,7 @@ func (c *controller) createFileVolume(ctx context.Context, req *csi.CreateVolume
}
volumeInfo, faultType, err = common.CreateFileVolumeUtil(ctx, cnstypes.CnsClusterFlavorVanilla,
vcenter, c.manager.VolumeManager, c.manager.CnsConfig, &createVolumeSpec,
filteredDatastores, []string{}, filterSuspendedDatastores, false, nil)
filteredDatastores, []string{}, false, nil)
if err != nil {
return nil, faultType, logger.LogNewErrorCodef(log, codes.Internal,
"failed to create volume. Error: %+v", err)
Expand Down
7 changes: 2 additions & 5 deletions pkg/csi/service/wcp/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
}
// Fetch the accessibility requirements from the request.
topologyRequirement = req.GetAccessibilityRequirements()
filterSuspendedDatastores := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CnsMgrSuspendCreateVolume)
isTKGSHAEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.TKGsHA)
isCSITransactionSupportEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CSITranSactionSupport)
isMultipleClustersPerVsphereZoneEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
Expand Down Expand Up @@ -804,7 +803,6 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
volFromSnapshotOnTargetDs := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
common.VolFromSnapshotOnTargetDs)
createVolumeOpts := common.CreateBlockVolumeOptions{
FilterSuspendedDatastores: filterSuspendedDatastores,
UseSupervisorId: isTKGSHAEnabled,
IsVdppOnStretchedSvFssEnabled: isVdppOnStretchedSVEnabled,
IsByokEnabled: isByokEnabled,
Expand Down Expand Up @@ -1328,7 +1326,6 @@ func (c *controller) createFileVolume(ctx context.Context, req *csi.CreateVolume
VolumeType: common.FileVolumeType,
}

filterSuspendedDatastores := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CnsMgrSuspendCreateVolume)
isTKGSHAEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.TKGsHA)
topoSegToDatastoresMap := make(map[string][]*cnsvsphere.DatastoreInfo)

Expand Down Expand Up @@ -1469,7 +1466,7 @@ func (c *controller) createFileVolume(ctx context.Context, req *csi.CreateVolume
if isPodVMOnStretchSupervisorFSSEnabled {
volumeInfo, faultType, err = common.CreateFileVolumeUtil(ctx, cnstypes.CnsClusterFlavorWorkload, vc,
c.manager.VolumeManager, c.manager.CnsConfig, &createVolumeSpec, candidateDatastores, vSphereClusterMorefs,
filterSuspendedDatastores, isTKGSHAEnabled, &cnsvolume.CreateVolumeExtraParams{
isTKGSHAEnabled, &cnsvolume.CreateVolumeExtraParams{
VolSizeBytes: volSizeBytes,
StorageClassName: req.Parameters[common.AttributeStorageClassName],
Namespace: req.Parameters[common.AttributePvcNamespace],
Expand All @@ -1479,7 +1476,7 @@ func (c *controller) createFileVolume(ctx context.Context, req *csi.CreateVolume
} else {
volumeInfo, faultType, err = common.CreateFileVolumeUtil(ctx, cnstypes.CnsClusterFlavorWorkload, vc,
c.manager.VolumeManager, c.manager.CnsConfig, &createVolumeSpec, candidateDatastores, []string{},
filterSuspendedDatastores, isTKGSHAEnabled, nil)
isTKGSHAEnabled, nil)
}
if err != nil {
return nil, faultType, logger.LogNewErrorCodef(log, codes.Internal,
Expand Down
5 changes: 1 addition & 4 deletions pkg/syncer/storagepool/migrationController.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import (
"sigs.k8s.io/vsphere-csi-driver/v3/pkg/common/cns-lib/volume"
cnsvsphere "sigs.k8s.io/vsphere-csi-driver/v3/pkg/common/cns-lib/vsphere"
"sigs.k8s.io/vsphere-csi-driver/v3/pkg/common/config"
"sigs.k8s.io/vsphere-csi-driver/v3/pkg/csi/service/common"
"sigs.k8s.io/vsphere-csi-driver/v3/pkg/csi/service/common/commonco"
"sigs.k8s.io/vsphere-csi-driver/v3/pkg/csi/service/logger"
"sigs.k8s.io/vsphere-csi-driver/v3/pkg/syncer/k8scloudoperator"
)
Expand Down Expand Up @@ -79,8 +77,7 @@ func (m *migrationController) relocateCNSVolume(ctx context.Context, volumeID st
return fmt.Errorf("failed to get datastore corresponding to URL %v", datastoreURL)
}

filterSuspendedDatastores := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CnsMgrSuspendCreateVolume)
if filterSuspendedDatastores && cnsvsphere.IsVolumeCreationSuspended(ctx, dsInfo) {
if cnsvsphere.IsVolumeCreationSuspended(ctx, dsInfo) {
return fmt.Errorf("datastore corresponding to URL %v is suspended and not available for relocating volumes",
datastoreURL)
}
Expand Down