Control Volume Placement Using Array ID
When multiple FlashArrays or FlashBlades are connected to your cluster, you can control where PX-CSI provisions volumes by specifying an array ID. Use this to direct volumes to specific arrays based on performance tiers, capacity requirements, or organizational needs.
Configure volume placement
Get the array ID using one of these methods:
- PX CLI: Run
px csi list backend. For more information about installing and running the PX CLI, see Install and Run PX CLI. - Array UI: Log in to your FlashArray or FlashBlade management interface and navigate to the system settings to find the array ID.
Specify the target array by using the portworx.io/pure-array-id parameter in one of these ways:
- Use a StorageClass parameter: Define the array ID in the StorageClass to apply it to all persistent volume claims (PVCs) that use that StorageClass.
- Use a PVC annotation: Specify the array ID directly in the PVC annotation to override the StorageClass setting or target a specific array for individual volumes.
If the array ID is specified in both the PVC annotation and the StorageClass parameter, the PVC annotation takes precedence.
We recommend using array ID to control volume placement. You can also use FlashArray pods to control volume placement. For more information, see Control volume placement using FlashArray pods.
Use StorageClass parameter
Define the array ID in the StorageClass to apply it to all PVCs that use that StorageClass.
-
Create a StorageClass YAML manifest that specifies the target array by using the
portworx.io/pure-array-idparameter.- FlashArray block
- FlashArray File Services
- FlashBlade
fa-performance-sc.yamlkind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: fa-performance-sc
provisioner: pxd.portworx.com
parameters:
backend: "pure_block"
portworx.io/pure-array-id: "1b07343b-xxxx-xxxx-xxxx-8b5e8cdeb16c" # Targets a specific FlashArray
max_iops: "50000"
max_bandwidth: "10G"
volumeBindingMode: Immediatefa-file-sc.yamlkind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: fa-file-sc
provisioner: pxd.portworx.com
parameters:
backend: "pure_fa_file"
portworx.io/pure-array-id: "1b07343b-xxxx-xxxx-xxxx-8b5e8cdeb16c" # Targets a specific FlashArray
pure_nfs_policy: "test-policy"
pure_fa_file_system: "name01"
mountOptions:
- nfsvers=4.1
- tcp
volumeBindingMode: Immediatefb-capacity-sc.yamlkind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: fb-capacity-sc
provisioner: pxd.portworx.com
parameters:
backend: "pure_file"
portworx.io/pure-array-id: "3d29565d-xxxx-xxxx-xxxx-ad7g0egd38e" # Targets a specific FlashBlade
pure_export_rules: '*(rw)'
mountOptions:
- nfsvers=4.1
- tcp
volumeBindingMode: ImmediatetipFor a complete list of
StorageClassparameters, see the StorageClass reference. -
Apply the StorageClass to your cluster:
kubectl apply -f fa-performance-sc.yamlstorageclass.storage.k8s.io/fa-performance-sc created -
Create a persistent volume claim (PVC) that references the StorageClass:
database-pvc.yamlkind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: database-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
storageClassName: fa-performance-sc # Uses the array ID from the StorageClasstipFor a complete list of
PersistentVolumeClaimfields and annotations, see the PersistentVolumeClaim reference. -
Apply the PVC:
kubectl apply -f database-pvc.yamlpersistentvolumeclaim/database-claim created
Use PVC annotation
Specify the array ID directly in the PVC annotation to target a specific array for the volume. This overrides any array ID specified in the StorageClass.
-
Create a persistent volume claim (PVC) YAML manifest that specifies the target array by using the
portworx.io/pure-array-idannotation.- FlashArray block
- FlashArray File Services
- FlashBlade
database-pvc.yamlkind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: database-claim
annotations:
portworx.io/pure-array-id: "1b07343b-xxxx-xxxx-xxxx-8b5e8cdeb16c" # Targets a specific FlashArray
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
storageClassName: px-fa-direct-accessshared-storage-pvc.yamlkind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: shared-storage-claim
annotations:
portworx.io/pure-array-id: "1b07343b-xxxx-xxxx-xxxx-8b5e8cdeb16c" # Targets a specific FlashArray
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 500Gi
storageClassName: fa-file-scbackup-pvc.yamlkind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: backup-claim
annotations:
portworx.io/pure-array-id: "3d29565d-xxxx-xxxx-xxxx-ad7g0egd38e" # Targets a specific FlashBlade
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Ti
storageClassName: px-fb-direct-access-nfsv4tipFor a complete list of
PersistentVolumeClaimfields and annotations, see the PersistentVolumeClaim reference. -
Apply the PVC to your cluster:
kubectl apply -f database-pvc.yamlpersistentvolumeclaim/database-claim created