-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathSample Scripts - Volumes.ps1
More file actions
44 lines (33 loc) · 1.41 KB
/
Copy pathSample Scripts - Volumes.ps1
File metadata and controls
44 lines (33 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Display Volume Name and Volume size in GB
Get-SFVolume | Select Name, @{N='TotalSizeGB';E={[math]::Round($_.TotalSize/1GB*(1/0.9313),1) }}
# Display Volume Name and QoS information
Get-SFVolume | Select Name, @{N='MinIOPS';E={$_.QoS.MinIOPS}}, @{N='MaxIOPS';E={$_.QoS.MaxIOPS}}, @{N='BurstIOPS';E={$_.QoS.BurstIOPS}}
# Display the Name, IQN, SCSI NAA
Get-SFVolume | Select Name, IQN, ScsiNAADeviceID
# Display Volumes for an Account or list of accounts or accountIDs
$accounts = "Josh","Aaron"
$accounts | Get-SFAccount | Get-SFVolume
# or
$accountids = 5,6,7
Get-SFVolume -AccountID $accountids
# Display the VolumeAccessGroups each volume is assigned
$result = @()
$volumes = Get-SFVolume
foreach($vol in $volumes){
$volaccessgroups = $vol.VolumeAccessGroups
foreach($vagID in $volaccessgroups){
$vag = Get-SFVolumeAccessGroup $vagID
# Store Volume Access Group data in object
$object = New-Object -TypeName PSObject -Property @{
Name = $vol.Name
VolumeAccessGroupName = $vag.VolumeAccessGroupName
}
$result += $object
}
}
$result | Sort Name
# Set Attribute
# !!!! Note !!! Doing it this way will OVERWRITE your attributes for the volume.
# We recommend using the Set-SFVolumeAttribute function in the SPBM module for modifying volume attributes.
$attribute = @{"Workload" = "Standard"}
Get-SFVolume Dev* | Set-SFVolume -Attributes $attribute