Skip to content

Commit

Permalink
Added changes for PowerMax volume limits feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakshmi3004 authored and tssushma committed Aug 11, 2023
1 parent f28e7df commit 5b603ed
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/samples/storage_v1_csm_powermax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ spec:
# Default value: false
- name: X_CSI_TOPOLOGY_CONTROL_ENABLED
value: "false"
# X_CSI_MAX_VOLUMES_PER_NODE: Defines the maximum Powermax volumes that the controller can publish to the node
# Allowed values: Any value greater than or equal to 0
# Default value: "0"
- name: X_CSI_MAX_VOLUMES_PER_NODE
value: "0"
sideCars:
# health monitor is disabled by default, refer to driver documentation before enabling it
- name: external-health-monitor
Expand Down
2 changes: 2 additions & 0 deletions operatorconfig/driverconfig/powermax/v2.8.0/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ spec:
value: "<X_CSI_POWERMAX_PORTGROUPS>"
- name: X_CSI_HEALTH_MONITOR_ENABLED
value: "<X_CSI_HEALTH_MONITOR_ENABLED>"
- name: X_CSI_MAX_VOLUMES_PER_NODE
value: "<X_CSI_MAX_VOLUMES_PER_NODE>"
- name: X_CSI_TOPOLOGY_CONTROL_ENABLED
value: "<X_CSI_TOPOLOGY_CONTROL_ENABLED>"
- name: X_CSI_VSPHERE_ENABLED
Expand Down
8 changes: 8 additions & 0 deletions pkg/drivers/powermax.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const (
CSIPmaxVsphereHostname = "<X_CSI_VSPHERE_HOSTNAME>"
CSIPmaxVsphereHost = "<X_CSI_VCENTER_HOST>"
CSIPmaxChap = "<X_CSI_POWERMAX_ISCSI_ENABLE_CHAP>"

// CsiPmaxMaxVolumesPerNode - Maximum volumes that the controller can schedule on the node
CsiPmaxMaxVolumesPerNode = "<X_CSI_MAX_VOLUMES_PER_NODE>"
)

// PrecheckPowerMax do input validation
Expand Down Expand Up @@ -115,6 +118,7 @@ func ModifyPowermaxCR(yamlString string, cr csmv1.ContainerStorageModule, fileTy
ctrlHealthMonitor := "false"
nodeHealthMonitor := "false"
storageCapacity := "true"
maxVolumesPerNode := ""

switch fileType {
case "Node":
Expand Down Expand Up @@ -169,6 +173,9 @@ func ModifyPowermaxCR(yamlString string, cr csmv1.ContainerStorageModule, fileTy
if env.Name == "X_CSI_TOPOLOGY_CONTROL_ENABLED" {
nodeTopology = env.Value
}
if env.Name == "X_CSI_MAX_VOLUMES_PER_NODE" {
maxVolumesPerNode = env.Value
}
}
yamlString = strings.ReplaceAll(yamlString, CSIPmaxManagedArray, managedArray)
yamlString = strings.ReplaceAll(yamlString, CSIPmaxEndpoint, endpoint)
Expand All @@ -185,6 +192,7 @@ func ModifyPowermaxCR(yamlString string, cr csmv1.ContainerStorageModule, fileTy
yamlString = strings.ReplaceAll(yamlString, CSIPmaxVsphereHostname, vsphereHostname)
yamlString = strings.ReplaceAll(yamlString, CSIPmaxVsphereHost, vsphereHost)
yamlString = strings.ReplaceAll(yamlString, CSIPmaxChap, nodeChap)
yamlString = strings.ReplaceAll(yamlString, CsiPmaxMaxVolumesPerNode, maxVolumesPerNode)
case "Controller":
for _, env := range cr.Spec.Driver.Common.Envs {
if env.Name == "X_CSI_MANAGED_ARRAYS" {
Expand Down
5 changes: 5 additions & 0 deletions samples/storage_csm_powermax_v280.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ spec:
# Default value: false
- name: X_CSI_TOPOLOGY_CONTROL_ENABLED
value: "false"
# X_CSI_MAX_VOLUMES_PER_NODE: Defines the maximum PowerMax volumes that the controller can schedule on the node
# Allowed values: Any value greater than or equal to 0
# Default value: "0"
- name: X_CSI_MAX_VOLUMES_PER_NODE
value: "0"
# nodeSelector: Define node selection constraints for node pods.
# For the pod to be eligible to run on a node, the node must have each
# of the indicated key-value pairs as labels.
Expand Down

0 comments on commit 5b603ed

Please sign in to comment.