Skip to main content
Pure1 Support Portal

How-To: Work with Volumes

In this section we will cover:

 

Creating a Single Volume

Creating volumes on the FlashArray is very simple because we remove all of the complexities of needing to define RAID groups or aggregates. All of the below examples of how to work with volumes assumes that an existing connection to the Pure Storage FlashArray has been created using the Connecting to FlashArray topic. 

Remember from the Connecting to FlashArray topic that the $FlashArray variable will be used to perform tasks against the authenticated FlashArray.

Let's first create a single volume using the New-PfaVolume cmdlet. The only parameters that are required:

  • VolumeName -- Target volume name.
  • Unit -- Valid unit symbols are K, M, G, T, P, representing KiB, MiB, GiB, TiB, and PiB, respectively, where "Ki" denotes 2^10, "Mi" denotes 2^20, and so on.
  • Size -- Size in bytes of the volume.
PS C:\> New-PfaVolume -Array $FlashArray -VolumeName 'SDK-Sample' -Unit G -Size 500

source  :
serial  : 95DAA3D006E43D8F0004B467
created : 2016-11-01T21:30:47Z
name    : SDK-Sample
size    : 536870912000

The New-PfaVolume cmdlet has a WhatIf parameter that shows the exact REST API call in JSON format. This is helpful when wanting to understand what exactly a cmdlet is passing to the REST API. 

PS C:\> New-PfaVolume -Array $FlashArray -VolumeName 'SDK-Sample' -Unit G -Size 500 -WhatIf
What if: Performing the operation "New-PfaVolume" on target "
POST https://10.0.0.1/api/1.7/volume/SDK-Sample
{
  "size": "500G"
}".

 

Creating Multiple Volumes

Creating multiple volumes is just as simple as creating a single volume. To create multiple volumes of the same size a ForEach loop is used.

PS C:\> ForEach ($i in 1..10) { New-PfaVolume -Array $FlashArray -VolumeName "SDK-Sample-$i" -Unit M -Size 250 }
source  :
serial  : 95DAA3D006E43D8F0004B468
created : 2016-11-01T21:41:16Z
name    : SDK-Sample-1
size    : 262144000

source  :
serial  : 95DAA3D006E43D8F0004B469
created : 2016-11-01T21:41:17Z
name    : SDK-Sample-2
size    : 262144000

source  :
serial  : 95DAA3D006E43D8F0004B46A
created : 2016-11-01T21:41:17Z
name    : SDK-Sample-3
size    : 262144000

source  :
serial  : 95DAA3D006E43D8F0004B46B
created : 2016-11-01T21:41:17Z
name    : SDK-Sample-4
size    : 262144000

source  :
serial  : 95DAA3D006E43D8F0004B46C
created : 2016-11-01T21:41:17Z
name    : SDK-Sample-5
size    : 262144000

source  :
serial  : 95DAA3D006E43D8F0004B46D
created : 2016-11-01T21:41:17Z
name    : SDK-Sample-6
size    : 262144000

source  :
serial  : 95DAA3D006E43D8F0004B46E
created : 2016-11-01T21:41:17Z
name    : SDK-Sample-7
size    : 262144000

source  :
serial  : 95DAA3D006E43D8F0004B46F
created : 2016-11-01T21:41:17Z
name    : SDK-Sample-8
size    : 262144000

source  :
serial  : 95DAA3D006E43D8F0004B470
created : 2016-11-01T21:41:17Z
name    : SDK-Sample-9
size    : 262144000

source  :
serial  : 95DAA3D006E43D8F0004B471
created : 2016-11-01T21:41:18Z
name    : SDK-Sample-10
size    : 262144000

Now that there are ten new volumes created the next task is to retrieve the volume details for an individual volume using Get-PfaVolume cmdlet.

PS C:\> Get-PfaVolume -Array $FlashArray -Name 'SDK-Sample-7'

name           : SDK-Sample-7
created        : 2016-11-01T21:41:17Z
source         :
time_remaining :
serial         : 95DAA3D006E43D8F0004B46E
size           : 262144000

Next is to retrieve all volumes on the FlashArray using the Get-PfaVolumes cmdlet. There are several hundred volumes on the FlashArray being used to write these samples so a Where-Object clause is used to only retrieve the SDK-Sample volumes. When retrieving multiple items it is suggested to use the Format options with Windows PowerShell to make the results easily readable. 

PS C:\> Get-PfaVolumes -Array $FlashArray | Where-Object { $_.name -like 'SDK-Sample*' } | Format-Table -AutoSize

source serial                   created              name                  size
------ ------                   -------              ----                  ----
       95DAA3D006E43D8F0004B467 2016-11-01T21:30:47Z SDK-Sample    536870912000
       95DAA3D006E43D8F0004B468 2016-11-01T21:41:16Z SDK-Sample-1     262144000
       95DAA3D006E43D8F0004B469 2016-11-01T21:41:17Z SDK-Sample-2     262144000
       95DAA3D006E43D8F0004B46A 2016-11-01T21:41:17Z SDK-Sample-3     262144000
       95DAA3D006E43D8F0004B46B 2016-11-01T21:41:17Z SDK-Sample-4     262144000
       95DAA3D006E43D8F0004B46C 2016-11-01T21:41:17Z SDK-Sample-5     262144000
       95DAA3D006E43D8F0004B46D 2016-11-01T21:41:17Z SDK-Sample-6     262144000
       95DAA3D006E43D8F0004B46E 2016-11-01T21:41:17Z SDK-Sample-7     262144000
       95DAA3D006E43D8F0004B46F 2016-11-01T21:41:17Z SDK-Sample-8     262144000
       95DAA3D006E43D8F0004B470 2016-11-01T21:41:17Z SDK-Sample-9     262144000
       95DAA3D006E43D8F0004B471 2016-11-01T21:41:18Z SDK-Sample-10    262144000

 

Renaming a Volume

Renaming a volume can be accomplished using the Rename-PfaVolumeOrSnapshot cmdlet and can come in handy after creating a single or multiple volumes without the need to destroy the volume and create with the new name. In the below example the SDK-Sample-5 volume is renamed to SDK-Rename-5. We use the Get-PfaVolumes cmdlet again to show all of the volumes like 'SDK-*'.

PS C:\> Rename-PfaVolumeOrSnapshot -Array $FlashArray -NewName 'SDK-Rename-5' -Name 'SDK-Sample-5'
name
----
SDK-Rename-5

PS C:\> Get-PfaVolumes -Array $FlashArray | Where-Object { $_.name -like 'SDK-*' } | Format-Table -AutoSize

source serial                   created              name                  size
------ ------                   -------              ----                  ----
       95DAA3D006E43D8F0004B467 2016-11-01T21:30:47Z SDK-Sample    536870912000
       95DAA3D006E43D8F0004B468 2016-11-01T21:41:16Z SDK-Sample-1     262144000
       95DAA3D006E43D8F0004B469 2016-11-01T21:41:17Z SDK-Sample-2     262144000
       95DAA3D006E43D8F0004B46A 2016-11-01T21:41:17Z SDK-Sample-3     262144000
       95DAA3D006E43D8F0004B46B 2016-11-01T21:41:17Z SDK-Sample-4     262144000
       95DAA3D006E43D8F0004B46C 2016-11-01T21:41:17Z SDK-Rename-5     262144000
       95DAA3D006E43D8F0004B46D 2016-11-01T21:41:17Z SDK-Sample-6     262144000
       95DAA3D006E43D8F0004B46E 2016-11-01T21:41:17Z SDK-Sample-7     262144000
       95DAA3D006E43D8F0004B46F 2016-11-01T21:41:17Z SDK-Sample-8     262144000
       95DAA3D006E43D8F0004B470 2016-11-01T21:41:17Z SDK-Sample-9     262144000
       95DAA3D006E43D8F0004B471 2016-11-01T21:41:18Z SDK-Sample-10    262144000

 

Volume Space & I/O Metrics

There are a few PowerShell SDK cmdlets that provide volume metric information that can be useful in reporting scenarios.

  • Get-PfaAllVolumeIOMetrics
  • Get-PfaAllVolumeIOMetricsAverage
  • Get-PfaAllVolumeIOMetricsTotal
  • Get-PfaAllVolumeSpaceMetrics
  • Get-PfaAllVolumeSpaceMetricsByTimeRange
  • Get-PfaVolumeIOMetrics
  • Get-PfaVolumeIOMetricsAverage
  • Get-PfaVolumeIOMetricsByTimeRange
  • Get-PfaVolumeSpaceMetrics
  • Get-PfaVolumeSpaceMetricsByTimeRange

Below is an example of using the Get-PfaVolumeSpaceMetrics for an individual volume which shows details related to space reporting (snapshots, data reduction, thin provisioning, total reduction).

PS C:\> Get-PfaVolumeSpaceMetrics -Array $FlashArray -VolumeName 'TPCE-FlatFiles-Dataset'

total             : 745852677691
name              : TPCE-FlatFiles-Dataset
system            :
snapshots         : 0
volumes           : 745852677691
data_reduction    : 3.122348960160198
size              : 4398046511104
shared_space      :
thin_provisioning : 0.47048936784267426
total_reduction   : 5.896669057312716

Below is an example of using the Get-PfaVolumeIOMetrics for an individual volume which shows details related to I/O reporting (reads, writes). For detailed information on how to calculate and intepret the different properties read Calculating Block Size with the PowerShell SDK.

PS C:\> Get-PfaVolumeIOMetrics -Array $FlashArray -VolumeName 'Apps-CSV-1'
writes_per_sec    : 85
name              : Apps-CSV-1
usec_per_write_op : 17258
output_per_sec    : 0
reads_per_sec     : 0
input_per_sec     : 83962342
time              : 2016-11-01T21:59:54Z
usec_per_read_op  : 0