Skip to content

Commit 5e0d781

Browse files
committed
vVol Core support complete
vVol Core support complete
1 parent 71f809c commit 5e0d781

1 file changed

Lines changed: 40 additions & 47 deletions

File tree

PureStorage.FlashArray.VMware.VVol/PureStorage.FlashArray.VMware.VVol.psm1

Lines changed: 40 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ function Update-PfaVvolVmVolumeGroup {
1010
.OUTPUTS
1111
Returns the FlashArray volume names of the input VM.
1212
.NOTES
13-
Version: 2.1
13+
Version: 2.0
1414
Author: Cody Hosterman https://codyhosterman.com
15-
Creation Date: 12/23/2019
16-
Purpose/Change: Parameter sets and validation
15+
Creation Date: 08/26/2020
16+
Purpose/Change: Core support
1717
.EXAMPLE
1818
PS C:\ New-PfaConnection -endpoint flasharray-m20-2 -credentials (get-credential) -defaultArray
1919
PS C:\ Update-PfaVvolVmVolumeGroup -vm (get-vm myVM)
@@ -243,8 +243,8 @@ function Get-VvolUuidFromVmdk {
243243
.NOTES
244244
Version: 2.0
245245
Author: Cody Hosterman https://codyhosterman.com
246-
Creation Date: 05/26/2019
247-
Purpose/Change: Updated for new connection mgmt
246+
Creation Date: 08/26/2020
247+
Purpose/Change: Core support
248248
.EXAMPLE
249249
PS C:\ New-PfaConnection -endpoint flasharray-m20-2 -credentials (get-credential) -defaultArray
250250
PS C:\ get-vm myVM | get-harddisk | Get-VvolUuidFromVmdk
@@ -372,10 +372,10 @@ function Get-PfaSnapshotFromVvolVmdk {
372372
.OUTPUTS
373373
Returns all specified snapshot names.
374374
.NOTES
375-
Version: 2.1
375+
Version: 2.0
376376
Author: Cody Hosterman https://codyhosterman.com
377-
Creation Date: 12/24/2019
378-
Purpose/Change: Updated for new connection mgmt
377+
Creation Date: 08/26/2020
378+
Purpose/Change: Core support
379379
.EXAMPLE
380380
PS C:\ New-PfaConnection -endpoint flasharray-m20-2 -credentials (get-credential) -defaultArray
381381
PS C:\ get-vm myVM | get-harddisk | Get-PfaSnapshotFromVvolVmdk
@@ -426,8 +426,8 @@ function Copy-PfaVvolVmdkToNewVvolVmdk {
426426
.NOTES
427427
Version: 2.0
428428
Author: Cody Hosterman https://codyhosterman.com
429-
Creation Date: 05/26/2019
430-
Purpose/Change: Updated for new connection mgmt
429+
Creation Date: 08/26/2020
430+
Purpose/Change: Core support
431431
.EXAMPLE
432432
PS C:\ New-PfaConnection -endpoint flasharray-m20-2 -credentials (get-credential) -defaultArray
433433
PS C:\ get-vm myVM | Copy-PfaVvolVmdkToNewVvolVmdk -vmdk (get-vm sourceVM |get-harddisk)
@@ -484,8 +484,8 @@ function Copy-PfaSnapshotToExistingVvolVmdk {
484484
.NOTES
485485
Version: 2.0
486486
Author: Cody Hosterman https://codyhosterman.com
487-
Creation Date: 05/26/2019
488-
Purpose/Change: Updated for new connection mgmt
487+
Creation Date: 08/26/2020
488+
Purpose/Change: Core support
489489
.EXAMPLE
490490
PS C:\ New-PfaConnection -endpoint flasharray-m20-2 -credentials (get-credential) -defaultArray
491491
PS C:\ $vm = get-vm testvm01
@@ -552,8 +552,8 @@ function Copy-PfaSnapshotToNewVvolVmdk {
552552
.NOTES
553553
Version: 2.0
554554
Author: Cody Hosterman https://codyhosterman.com
555-
Creation Date: 06/04/2019
556-
Purpose/Change: Updated for new connection mgmt
555+
Creation Date: 08/26/2020
556+
Purpose/Change: Core support
557557
.EXAMPLE
558558
PS C:\ New-PfaConnection -endpoint flasharray-m20-2 -credentials (get-credential) -defaultArray
559559
PS C:\ $vm = get-vm testvm01
@@ -635,10 +635,10 @@ function Copy-PfaVvolVmdkToExistingVvolVmdk {
635635
.OUTPUTS
636636
Returns the new hard disk.
637637
.NOTES
638-
Version: 2.1
638+
Version: 2.0
639639
Author: Cody Hosterman https://codyhosterman.com
640-
Creation Date: 01/02/2020
641-
Purpose/Change: Updated for new connection mgmt
640+
Creation Date: 08/26/2020
641+
Purpose/Change: Core support
642642
.EXAMPLE
643643
PS C:\ New-PfaConnection -endpoint flasharray-m20-2 -credentials (get-credential) -defaultArray
644644
PS C:\ $disks = get-vm myVM | get-harddisk
@@ -731,10 +731,10 @@ function New-PfaSnapshotOfVvolVmdk {
731731
.OUTPUTS
732732
Returns the snapshot name.
733733
.NOTES
734-
Version: 2.1
734+
Version: 2.0
735735
Author: Cody Hosterman https://codyhosterman.com
736-
Creation Date: 01/02/2020
737-
Purpose/Change: Updated for new connection mgmt
736+
Creation Date: 08/26/2020
737+
Purpose/Change: Core support
738738
.EXAMPLE
739739
PS C:\ New-PfaConnection -endpoint flasharray-m20-2 -credentials (get-credential) -defaultArray
740740
PS C:\ $disks = get-vm prodVM | get-harddisk
@@ -820,10 +820,10 @@ function Get-VmdkFromWindowsDisk {
820820
.OUTPUTS
821821
Returns VMDK object
822822
.NOTES
823-
Version: 1.0
823+
Version: 2.0
824824
Author: Cody Hosterman https://codyhosterman.com
825-
Creation Date: 08/24/2018
826-
Purpose/Change: Updated for new connection mgmt
825+
Creation Date: 08/26/2020
826+
Purpose/Change: Core support
827827
.EXAMPLE
828828
PS C:\ $vm = get-vm myVM
829829
PS C:\ Get-VmdkFromWindowsDisk -vm $vm -driveLetter E
@@ -962,8 +962,8 @@ function New-PfaVasaProvider {
962962
$vasaProviders = @()
963963
foreach ($faConnection in $fa)
964964
{
965-
$mgmtIPs = Get-PfaNetworkInterfaces -Array $faConnection | where-object {$_.name -like "*eth0"}
966-
$arrayname = Get-PfaArrayAttributes -array $faConnection
965+
$mgmtIPs = New-PfaRestOperation -resourceType network -restOperationType GET -flasharray $faConnection -SkipCertificateCheck |Where-Object {$_.name -like "*eth0"}
966+
$arrayname = New-PfaRestOperation -resourceType array -restOperationType GET -flasharray $flasharray -SkipCertificateCheck
967967
$ctnum = 0
968968
foreach ($mgmtIP in $mgmtIPs)
969969
{
@@ -1019,10 +1019,10 @@ function Get-PfaVasaProvider {
10191019
10201020
Connect to a FlashArray and return the current active VASA Provider for that FlashArray.
10211021
.NOTES
1022-
Version: 1.1
1022+
Version: 2.0
10231023
Author: Cody Hosterman https://codyhosterman.com
1024-
Creation Date: 01/23/2020
1025-
Purpose/Change: First release
1024+
Creation Date: 08/26/2020
1025+
Purpose/Change: Core support
10261026
10271027
*******Disclaimer:******************************************************
10281028
This scripts are offered "as is" with no warranty. While this
@@ -1038,7 +1038,7 @@ function Get-PfaVasaProvider {
10381038
[Parameter(Position=0,ValueFromPipeline=$True,mandatory=$true)]
10391039
[PurePowerShell.PureArray]$flasharray
10401040
)
1041-
$faID = "com.purestorage:" + (Get-PfaArrayAttributes -Array $flasharray).id
1041+
$faID = "com.purestorage:" + (New-PfaRestOperation -resourceType array -restOperationType GET -flasharray $flasharray -SkipCertificateCheck).id
10421042
try {
10431043
$vp = (Get-VasaStorageArray -Id $faid -ErrorAction Stop).provider
10441044
return $vp
@@ -1068,10 +1068,10 @@ function Remove-PfaVasaProvider {
10681068
10691069
Connect to FlashArray and then remove all VASA providers for a given FlashArray without additional confirmation prompts.
10701070
.NOTES
1071-
Version: 1.0
1071+
Version: 2.0
10721072
Author: Cody Hosterman https://codyhosterman.com
1073-
Creation Date: 07/08/2019
1074-
Purpose/Change: First release
1073+
Creation Date: 08/26/2020
1074+
Purpose/Change: Core support
10751075
10761076
*******Disclaimer:******************************************************
10771077
This scripts are offered "as is" with no warranty. While this
@@ -1200,7 +1200,7 @@ function Mount-PfaVvolDatastore {
12001200
}
12011201
elseif ($null -ne $flasharray)
12021202
{
1203-
$arrayID = "com.purestorage:" + (Get-PfaArrayAttributes -array $flasharray).id
1203+
$arrayID = "com.purestorage:" + (New-PfaRestOperation -resourceType array -restOperationType GET -flasharray $flasharray -SkipCertificateCheck).id
12041204
$needToCalculateScID = $True
12051205
}
12061206
elseif ($null -ne $vasaArray)
@@ -1235,7 +1235,7 @@ function Mount-PfaVvolDatastore {
12351235
$datastoreExists = get-datastore |Where-Object {$_.Type -eq "VVol"} |Where-Object {$_.ExtensionData.Info.VVolds.Scid -eq $scId}
12361236
if ($null -eq $datastoreExists)
12371237
{
1238-
throw "This storage container ID ($($scId)) has not yet been mounted in this vCenter as a vVol datastore, so no existing name was found. Please enter a name for the vVol datastore"
1238+
$datastoreName = (New-PfaRestOperation -resourceType array -restOperationType GET -flasharray $flasharray -SkipCertificateCheck).array_name + "-vvol-DS"
12391239
}
12401240
else {
12411241
$datastoreName = $datastoreExists.Name
@@ -1283,26 +1283,19 @@ function Mount-PfaVvolDatastore {
12831283
}
12841284
}
12851285
$hGroup = get-pfaHostGroupfromVcCluster -cluster $cluster -flasharray $fa -ErrorAction Stop
1286-
$allPEs = Get-PfaProtocolEndpointVolumes -Array $fa -ErrorAction Stop
1287-
if (($null -ne $protocolEndpoint) -and ($protocolEndpoint -ne ""))
1288-
{
1289-
$pe = $allPEs |Where-Object {$_.name -eq $protocolEndpoint}
1290-
if ($null -eq $pe)
1291-
{
1292-
throw "The Protocol Endpoint named $($protocolEndpoint) was not found."
1293-
}
1294-
}
1295-
else
1286+
$allPEs = New-PfaRestOperation -resourceType volume?protocol_endpoint=true -restOperationType GET -flasharray $fa -SkipCertificateCheck -ErrorAction Stop
1287+
if (($null -eq $protocolEndpoint) -or ($protocolEndpoint -eq ""))
12961288
{
1297-
$pe = $allPEs |Where-Object {$_.name -eq "pure-protocol-endpoint"}
1289+
$protocolEndpoint = "vVol-Protocol-Endpoint"
12981290
}
1291+
$pe = $allPEs |Where-Object {$_.name -eq $protocolEndpoint}
12991292
if ($null -eq $pe)
13001293
{
1301-
$pe = New-PfaProtocolEndpointVolume -Array $fa -VolumeName "pure-protocol-endpoint"
1294+
$pe = New-PfaRestOperation -resourceType volume/$($protocolEndpoint)?protocol_endpoint=true -restOperationType POST -flasharray $fa -SkipCertificateCheck
13021295
}
13031296
try
13041297
{
1305-
New-PfaHostGroupVolumeConnection -Array $fa -VolumeName $pe.name -HostGroupName $hGroup.name -ErrorAction Stop|Out-Null
1298+
New-PfaRestOperation -resourceType "hgroup/$($hGroup.name)/volume/$($pe.name)" -restOperationType POST -flasharray $fa -SkipCertificateCheck -ErrorAction Stop |Out-Null
13061299
}
13071300
catch
13081301
{

0 commit comments

Comments
 (0)