Skip to main content
Version: 3.1

Configure Pure Storage FlashArray as a Direct Access volume

On-premises users who want to use Pure Storage FlashArray with Portworx on Kubernetes can attach FlashArray as a Direct Access volume. Used in this way, Portworx directly provisions FlashArray volumes, maps them to a user PVC, and mounts them to pods. Once mounted, the application writes data directly onto FlashArray. As a result, this mounting method doesn’t use storage pools.

FlashArray Direct Access volumes support the following CSI operations:

  • Basic filesystem operations: create, mount, expand, clone, unmount, delete
  • Mount options: Configure file system mount options
  • Snapshots
  • Quality of service (QoS) settings (requires at least one FlashArray with Purity version 5.3.0 or newer and REST API version 1.17 or newer)
note
  • Portworx recommends installing Portworx with FlashArray Cloud Drive before using FlashArray Direct Access volumes.

  • FlashArray Direct Access volumes have the following limitations:

    • RawBlock, volume import, and CSI ephemeral volumes are not supported.
    • CreateOperations is not honored by Portworx.

Install Portworx and configure FlashArray

Before you install Portworx, ensure that you meet the prerequisites. You must provide Portworx with your FlashArray configuration details during installation.

Prerequisites

  • Have a Pure Storage FlashArray with Purity version 5.3.0 or newer

  • Use the FC, iSCSI, or NVMe/RoCE protocol

  • Create a Pure secret px-pure-secret under the STC namespace before installing Portworx

  • Install Portworx version 2.11.0 or newer

  • Use the Portworx Operator 1.8.1 or newer

  • Enable CSI for Portworx

  • Have the latest Linux multipath software package for your operating system

    • FlashArray direct access volumes do not support user friendly names in multipath devices. If user_friendly_names is present in your multipath.conf file, it must be set to no.

    • If you have a vSphere Cloud environment, add the following in your multipath.conf file:

      blacklist {
      devnode "vda"
      device {
      vendor "VMware"
      }
      }
  • Have the latest Filesystem utilities/drivers

  • Have the latest external array management library package libStorageMgmt

    • Red Hat and CentOS only: Ensure that the second action - CAPACITY_DATA_HAS_CHANGED - is uncommented and you have restarted the udev service
  • Have the latest FC initiator software for your operating system (Optional; required for FC connectivity)

  • Have the latest iSCSI initiator software for your operating system (Optional; required for iSCSI connectivity)

    Want to set iSCSI interfaces on FlashArray?
    1. Run the iscsiadm -m iface command to get the <interface-value>. You can use the output in the next step.
    2. Run the pxctl cluster options update --flasharray-iscsi-allowed-ifaces <interface-value> command to specify which network interfaces on the FlashArray system are allowed to handle iSCSI traffic.

Set up your environment to use CSI snapshot feature

To use the CSI snapshot feature, install the following:

  • Snapshot V1 CRDs

  • Snapshot controller

    • You can also install the snapshot controller by adding the following lines to your StorageCluster:

        csi:
      enabled: true
      installSnapshotController: true

Deploy Portworx

Once you've ensured you meet the prerequisites and your physical network topology is appropriately configured, you're ready to deploy Portworx.

  1. Create a JSON file named pure.json that contains your FlashArray information:

    {
    "FlashArrays": [
    {
    "MgmtEndPoint": "<fa-management-endpoint>",
    "APIToken": "<fa-api-token>"
    }
    ]
    }
    note

    You can add FlashBlade configuration information to this file if you're configuring both FlashArray and FlashBlade together. Refer to the JSON file reference for more information.

  2. Enter the following kubectl create command to create a Kubernetes secret called px-pure-secret:

    kubectl create secret generic px-pure-secret --namespace <stc-namespace> --from-file=pure.json=<file path>
    secret/px-pure-secret created
    note

    You must name the secret px-pure-secret.

  3. Navigate to Portworx Central and log in, or create an account, then follow the process to generate a spec.

By default, iSCSI is set as your protocol for data transfer. To change this option, click Customize and navigate to the Storage window. Select a different option from the Select type of storage area network dropdown.

Once deployed, Portworx detects that the FlashArray secret is present when it starts up and can use the specified FlashArray as a Direct Access volume.

Use FlashArray as a Direct Access volume

Once you’ve configured Portworx to work with your FlashArray, you can create a StorageClass and reference it in any PVCs you create.

Create a StorageClass

Create a StorageClass spec and set parameters.backend to "pure_block". Here is an example StorageClass spec:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: sc-portworx-fa-direct-access
provisioner: pxd.portworx.com
parameters:
backend: "pure_block"
max_iops: "1000"
max_bandwidth: "1G"
allowVolumeExpansion: true

Create a PVC

Create a PersistentVolumeClaim and reference the StorageClass you created by entering the name that you gave your StorageClass in the spec.storageClassName field. For example:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pure-claim-block
labels:
app: nginx
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: sc-portworx-fa-direct-access

Mount to a pod

Create a Pod and reference the PVC you created by entering the name you gave your PVC in the persistentVolumeClaim.claimName field. For example:

kind: Pod
apiVersion: v1
metadata:
name: nginx-pod
labels:
app: nginx
spec:
volumes:
- name: pure-vol
persistentVolumeClaim:
claimName: pure-claim-block
containers:
- name: nginx
image: nginx
volumeMounts:
- name: pure-vol
mountPath: /data
ports:
- containerPort: 80

Once you apply the Pod, you can use watch kubectl get pods to look for a STATUS of Running. Once the pod is running, you can see it as a connected host for your volume.

Clone a PVC

To clone PVC, create a PersistentVolumeClaim with dataSource.kind set to PVC and dataSource.name set to the name of the PVC you wish to clone. For example:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-clone
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: sc-portworx-fa-direct-access
dataSource:
kind: PersistentVolumeClaim
name: pure-claim-block

Take a snapshot

To take a snapshot, perform the following steps:

  1. Create a SnapshotClass with driver set to pxd.portworx.com. For example:

    kind: VolumeSnapshotClass
    apiVersion: snapshot.storage.k8s.io/v1
    metadata:
    name: px-fa-direct-access-snapshotclass
    annotations:
    snapshot.storage.kubernetes.io/is-default-class: "true"
    driver: pxd.portworx.com
    deletionPolicy: Delete
  2. Create a VolumeSnapshot where volumeSnapshotClassName is set to the name you gave your VolumeSnapshotClass, and source.persistentVolumeClaimName is set to the name you gave your volume. For example:

    kind: VolumeSnapshot
    apiVersion: snapshot.storage.k8s.io/v1
    metadata:
    name: volumesnapshot-of-pure-claim-block
    spec:
    volumeSnapshotClassName: px-fa-direct-access-snapshotclass
    source:
    persistentVolumeClaimName: pure-claim-block

Once you have applied the VolumeSnapshot to create a snapshot, you can view the snapshot with kubectl get volumesnapshot or in the array UI under Volume Snapshots, where it has the same functions as other types of Pure snapshots.

note
  • If you do not see your VolumeSnapshot when you run kubectl get volumesnapshot, run kubectl get crd to get the full path of the CRD, then use that full path in your kubectl get command. For example:

    kubectl get volumesnapshots.snapshot.storage.k8s.io
  • A snapshot of a volume that has not been attached will be completely empty. It will include no filesystem, making it unattachable. If you want an attachable but empty snapshot with a filesystem, attach and detach the volume before taking the snapshot.

Restore a snapshot

To restore a snapshot to a new PVC, create a PersistentVolumeClaim with dataSource.kind set to VolumeSnapshot and dataSource.name set to the name of your VolumeSnapshot. For example:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-restore
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: sc-portworx-fa-direct-access
dataSource:
kind: VolumeSnapshot
name: volumesnapshot-of-pure-claim-block
apiGroup: snapshot.storage.k8s.io

Once you have applied the PersistentVolumeClaim to create a PVC, you can view it with kubectl get pvc or in the array UI. The array UI shows under Details that the source of the new PVC is the PVC from which the snapshot was made.

Expand a PVC

To expand a PVC of a FlashArray direct access volume, run the command kubectl edit pvc <pvcName>, then change the size in the spec.

Delete a PVC

To delete a PVC of a FlashArray direct access volume, use the following command:

kubectl delete pvc <pvcName>

Was this page helpful?