@@ -551,7 +551,6 @@ func (c *controller) createBlockVolumeWithPlacementEngineForMultiVC(ctx context.
551
551
// Check if requested volume size and source snapshot size matches.
552
552
volumeSource := req .GetVolumeContentSource ()
553
553
var contentSourceSnapshotID , snapshotDatastoreURL string
554
- var vCenterWithTransactionSupport bool
555
554
if volumeSource != nil {
556
555
sourceSnapshot := volumeSource .GetSnapshot ()
557
556
if sourceSnapshot == nil {
@@ -582,13 +581,6 @@ func (c *controller) createBlockVolumeWithPlacementEngineForMultiVC(ctx context.
582
581
"VC %q does not support snapshot operations" , vCenterHost )
583
582
}
584
583
585
- vCenterWithTransactionSupport , err = c .managers .VcenterManager .IsCnsTransactionSupported (ctx , vCenterHost )
586
- if err != nil {
587
- return nil , csifault .CSIUnimplementedFault , logger .LogNewErrorCodef (log , codes .Internal ,
588
- "failed to check if cns transaction APIs are supported on VC %q due to error: %v" ,
589
- vCenterHost , err )
590
- }
591
-
592
584
// Query capacity in MB and datastore url for block volume snapshot.
593
585
volumeIds := []cnstypes.CnsVolumeId {{Id : cnsVolumeID }}
594
586
cnsVolumeDetailsMap , err := utils .QueryVolumeDetailsUtil (ctx , volumeManager , volumeIds )
@@ -650,8 +642,6 @@ func (c *controller) createBlockVolumeWithPlacementEngineForMultiVC(ctx context.
650
642
}
651
643
break
652
644
}
653
-
654
- isTransactionAPIsSupported := vCenterWithTransactionSupport && isCSITransactionSupportEnabled
655
645
volumeOperationDetails , err := operationStore .GetRequestDetails (ctx , req .Name )
656
646
if err != nil {
657
647
if apierrors .IsNotFound (err ) {
@@ -661,7 +651,7 @@ func (c *controller) createBlockVolumeWithPlacementEngineForMultiVC(ctx context.
661
651
"error occurred while getting CreateVolume task details for block volume %q. Error: %+v" ,
662
652
req .Name , err )
663
653
}
664
- } else if ! isTransactionAPIsSupported && volumeOperationDetails .OperationDetails != nil {
654
+ } else if ! isCSITransactionSupportEnabled && volumeOperationDetails .OperationDetails != nil {
665
655
if volumeOperationDetails .OperationDetails .TaskStatus ==
666
656
cnsvolumeoperationrequest .TaskInvocationStatusSuccess &&
667
657
volumeOperationDetails .VolumeID != "" {
@@ -689,7 +679,7 @@ func (c *controller) createBlockVolumeWithPlacementEngineForMultiVC(ctx context.
689
679
},
690
680
}
691
681
volTaskAlreadyRegistered = true
692
- } else if ! isTransactionAPIsSupported && cnsvolume .IsTaskPending (volumeOperationDetails ) {
682
+ } else if ! isCSITransactionSupportEnabled && cnsvolume .IsTaskPending (volumeOperationDetails ) {
693
683
// If task is already created in CNS for this volume but task is in progress,
694
684
// we need to monitor the task to check if volume creation is complete or not.
695
685
log .Infof ("Volume with name %s has CreateVolume task %s pending on VC %q." ,
@@ -883,7 +873,7 @@ func (c *controller) createBlockVolumeWithPlacementEngineForMultiVC(ctx context.
883
873
ClusterFlavor : cnstypes .CnsClusterFlavorVanilla ,
884
874
},
885
875
common.CreateBlockVolumeOptions {
886
- IsCSITransactionSupportEnabled : isTransactionAPIsSupported ,
876
+ IsCSITransactionSupportEnabled : isCSITransactionSupportEnabled ,
887
877
})
888
878
if err != nil {
889
879
if cnsvolume .IsNotSupportedFaultType (ctx , faultType ) {
@@ -968,7 +958,7 @@ func (c *controller) createBlockVolumeWithPlacementEngineForMultiVC(ctx context.
968
958
ClusterFlavor : cnstypes .CnsClusterFlavorVanilla ,
969
959
},
970
960
common.CreateBlockVolumeOptions {
971
- IsCSITransactionSupportEnabled : isTransactionAPIsSupported ,
961
+ IsCSITransactionSupportEnabled : isCSITransactionSupportEnabled ,
972
962
})
973
963
if err != nil {
974
964
if cnsvolume .IsNotSupportedFaultType (ctx , faultType ) {
@@ -2570,15 +2560,9 @@ func (c *controller) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshot
2570
2560
// VolumeID and SnapshotID as the input, while corresponding snapshot APIs in upstream CSI require SnapshotID.
2571
2561
// So, we need to bridge the gap in vSphere CSI driver and return a combined SnapshotID to CSI Snapshotter.
2572
2562
2573
- vCenterWithTransactionSupport , err := vCenterManager .IsCnsTransactionSupported (ctx , vCenterHost )
2574
- if err != nil {
2575
- return nil , logger .LogNewErrorCodef (log , codes .Internal ,
2576
- "failed to check if cns transaction APIs are supported on VC %q due to error: %v" ,
2577
- vCenterHost , err )
2578
- }
2579
2563
snapshotID , cnsSnapshotInfo , err := common .CreateSnapshotUtil (ctx , volumeManager ,
2580
2564
volumeID , req .Name , & cnsvolume.CreateSnapshotExtraParams {
2581
- IsCSITransactionSupportEnabled : isCSITransactionSupportEnabled && vCenterWithTransactionSupport ,
2565
+ IsCSITransactionSupportEnabled : isCSITransactionSupportEnabled ,
2582
2566
})
2583
2567
if err != nil {
2584
2568
return nil , logger .LogNewErrorCodef (log , codes .Internal ,
0 commit comments