@@ -462,9 +462,7 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
462
462
isLinkedCloneRequest bool
463
463
linkedCloneSupportEnabled bool
464
464
)
465
- isVdppOnStretchedSVEnabled := commonco .ContainerOrchestratorUtility .IsFSSEnabled (ctx , common .VdppOnStretchedSupervisor )
466
465
linkedCloneSupportEnabled = commonco .ContainerOrchestratorUtility .IsFSSEnabled (ctx , common .LinkedCloneSupport )
467
-
468
466
// Support case insensitive parameters.
469
467
for paramName := range req .Parameters {
470
468
param := strings .ToLower (paramName )
@@ -480,7 +478,7 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
480
478
storageTopologyType = req .Parameters [paramName ]
481
479
val := strings .ToLower (storageTopologyType )
482
480
if val != "zonal" {
483
- if isVdppOnStretchedSVEnabled && val == "hostlocal" {
481
+ if val == "hostlocal" {
484
482
log .Debugf ("StorageTopologyType HostLocal is accepted." )
485
483
} else {
486
484
return nil , csifault .CSIInvalidArgumentFault , logger .LogNewErrorCodef (log , codes .InvalidArgument ,
@@ -557,17 +555,12 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
557
555
// keys as topology requirement during volume provisioning.
558
556
hostnameLabelPresent , zoneLabelPresent = checkTopologyKeysFromAccessibilityReqs (topologyRequirement )
559
557
if zoneLabelPresent && hostnameLabelPresent {
560
- if isVdppOnStretchedSVEnabled {
561
- if IsMultipleClustersPerVsphereZoneFSSEnabled && c .topologyMgr .ZonesWithMultipleClustersExist (ctx ) {
562
- return nil , csifault .CSIInternalFault , logger .LogNewErrorCode (log , codes .Internal ,
563
- "Creating volume with both zone and hostname in topology requirement is not " +
564
- "supported on deployment with multiple vSphere Clusters per zone" )
565
- }
566
- log .Infof ("Host Local volume provisioning with requirement: %+v" , topologyRequirement )
567
- } else {
568
- return nil , csifault .CSIUnimplementedFault , logger .LogNewErrorCodef (log , codes .Unimplemented ,
569
- "support for topology requirement with both zone and hostname labels is not yet implemented." )
558
+ if IsMultipleClustersPerVsphereZoneFSSEnabled && c .topologyMgr .ZonesWithMultipleClustersExist (ctx ) {
559
+ return nil , csifault .CSIInternalFault , logger .LogNewErrorCode (log , codes .Internal ,
560
+ "Creating volume with both zone and hostname in topology requirement is not " +
561
+ "supported on deployment with multiple vSphere Clusters per zone" )
570
562
}
563
+ log .Infof ("Host Local volume provisioning with requirement: %+v" , topologyRequirement )
571
564
} else if zoneLabelPresent {
572
565
if ! isWorkloadDomainIsolationEnabled {
573
566
if storageTopologyType == "" {
@@ -671,7 +664,7 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
671
664
log .Infof ("Active vSphere clusters: %v for the namespace: %q" , vSphereClusterMorefs , pvcNamespace )
672
665
}
673
666
}
674
- } else if hostnameLabelPresent && isVdppOnStretchedSVEnabled {
667
+ } else if hostnameLabelPresent {
675
668
log .Infof ("Host Local volume provisioning with requirement: %+v" , topologyRequirement )
676
669
} else {
677
670
// No topology labels present in the topologyRequirement
@@ -734,14 +727,12 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
734
727
"too many accessible nodes" )
735
728
}
736
729
737
- if isVdppOnStretchedSVEnabled {
738
- selectedDatastoreURL , err = getDatastoreURLFromStoragePool (ctx , storagePool )
739
- if err != nil {
740
- return nil , csifault .CSIInternalFault , logger .LogNewErrorCodef (log , codes .Internal ,
741
- "error in specified StoragePool %s. Error: %+v" , storagePool , err )
742
- }
743
- log .Infof ("Will select datastore %s as per the provided storage pool %s" , selectedDatastoreURL , storagePool )
730
+ selectedDatastoreURL , err = getDatastoreURLFromStoragePool (ctx , storagePool )
731
+ if err != nil {
732
+ return nil , csifault .CSIInternalFault , logger .LogNewErrorCodef (log , codes .Internal ,
733
+ "error in specified StoragePool %s. Error: %+v" , storagePool , err )
744
734
}
735
+ log .Infof ("Will select datastore %s as per the provided storage pool %s" , selectedDatastoreURL , storagePool )
745
736
746
737
hostMoid , err := getHostMOIDFromK8sCloudOperatorService (ctx , accessibleNodes [0 ])
747
738
if err != nil {
@@ -753,14 +744,12 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
753
744
log .Debugf ("Setting the affineToHost value as %s" , affineToHost )
754
745
}
755
746
756
- if isVdppOnStretchedSVEnabled {
757
- datastore , err := cnsvsphere .GetDatastoreInfoByURL (ctx , vc , clusterMoIds , selectedDatastoreURL )
758
- if err != nil {
759
- return nil , csifault .CSIInternalFault , logger .LogNewErrorCodef (log , codes .Internal ,
760
- "failed to find the datastore from the selected datastore URL %s. Error: %v" , selectedDatastoreURL , err )
761
- }
762
- candidateDatastores = []* cnsvsphere.DatastoreInfo {datastore }
747
+ datastore , err := cnsvsphere .GetDatastoreInfoByURL (ctx , vc , clusterMoIds , selectedDatastoreURL )
748
+ if err != nil {
749
+ return nil , csifault .CSIInternalFault , logger .LogNewErrorCodef (log , codes .Internal ,
750
+ "failed to find the datastore from the selected datastore URL %s. Error: %v" , selectedDatastoreURL , err )
763
751
}
752
+ candidateDatastores = []* cnsvsphere.DatastoreInfo {datastore }
764
753
}
765
754
766
755
// Volume Size - Default is 10 GiB.
@@ -847,7 +836,6 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
847
836
createVolumeOpts := common.CreateBlockVolumeOptions {
848
837
FilterSuspendedDatastores : filterSuspendedDatastores ,
849
838
UseSupervisorId : isTKGSHAEnabled ,
850
- IsVdppOnStretchedSvFssEnabled : isVdppOnStretchedSVEnabled ,
851
839
IsByokEnabled : isByokEnabled ,
852
840
IsCSITransactionSupportEnabled : isCSITransactionSupportEnabled ,
853
841
VolFromSnapshotOnTargetDs : volFromSnapshotOnTargetDs ,
@@ -933,18 +921,7 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
933
921
if hostnameLabelPresent {
934
922
// Configure the volumeTopology in the response so that the external
935
923
// provisioner will properly sets up the nodeAffinity for this volume.
936
- if isVdppOnStretchedSVEnabled {
937
- resp .Volume .AccessibleTopology = topologyRequirement .GetPreferred ()
938
- } else {
939
- for _ , hostName := range accessibleNodes {
940
- volumeTopology := & csi.Topology {
941
- Segments : map [string ]string {
942
- v1 .LabelHostname : hostName ,
943
- },
944
- }
945
- resp .Volume .AccessibleTopology = append (resp .Volume .AccessibleTopology , volumeTopology )
946
- }
947
- }
924
+ resp .Volume .AccessibleTopology = topologyRequirement .GetPreferred ()
948
925
} else if zoneLabelPresent {
949
926
if IsMultipleClustersPerVsphereZoneFSSEnabled && len (volumeInfo .Clusters ) > 0 {
950
927
// Calculate Volume Accessible Topology from Clusters returned in CreateVolume Response
0 commit comments