PureStorage.CBS.AVS.psm1
. $PSScriptRoot/PureStorage.Logger.ps1 . $PSScriptRoot/PureStorage.CommonUtil.ps1 . $PSScriptRoot/PureStorage.RunCommandLauncher.ps1 . $PSScriptRoot/PureStorage.CBS.AVS.VMFS.ps1 . $PSScriptRoot/PureStorage.CBS.AVS.VVOLS.ps1 . $PSScriptRoot/PureStorage.CBS.AVS.VVOLS.Replication.ps1 . $PSScriptRoot/PureStorage.CBS.AVS.Configuration.ps1 $VVOL_WARNIING = "vVols Cmdlets are experimental and not supported in this release. Please use with caution." function Build-PCBSCluster { <# .SYNOPSIS Build or update settings for a cluster of ESXi servers .DESCRIPTION Build or update settings for a cluster of ESXi servers. Creates a hostgroup in Pure Cloud Block Store if it does not exists and updates iSCSI settings. Can be used when creating a new cluster or when adding hosts to a cluster. .PARAMETER ClusterName Cluster name .PARAMETER PureCloudBlockStoreConnection Optional. Pure Cloud Block Store Connection. The connection can be created using Connect-Pf2Array cmdlet .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS Resource group name .EXAMPLE Build-PCBSCluster -ClusterName "mycluster" -PureCloudBlockStoreConnection $CBSConnection ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup #> [CmdletBinding()] Param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [String]$ClusterName, [Parameter(Mandatory=$false)] $PureCloudBlockStoreConnection, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Progress -Activity "Building cluster" -Status "0% Complete:" -PercentComplete 1 $fa = Connect-PureCloudBlockStore -PureCloudBlockStoreConnection $PureCloudBlockStoreConnection $WorkflowID = New-WorkflowID New-PhoneHomeWorkflowLogEntry -RestClient $fa -Event $global:BeginWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand try { $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName $cluster = Get-Cluster -Server $vCenterServer -Name $ClusterName if (-not $cluster) { throw "Could not find cluster '$ClusterName'..." } $ClusterStatus = Get-AVSClusterProvisionStatus -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName -AvsClusterName $ClusterName if ($ClusterStatus -ne "Succeeded") { throw "The current provisioning status of cluster $ClusterName is $ClusterStatus. The operation can only proceed when provisioning status is 'Succeeded'" } Test-MPIOProvisionStatus -Cluster $cluster Write-Progress -Activity "Configuring iSCSI" -Status "25% Complete:" -PercentComplete 25 $updated_hosts = New-PfaHostGroupfromVcCluster -FlashArray $fa -Cluster $cluster ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Progress -Activity "Removing unused hosts" -Status "50% Complete:" -PercentComplete 50 Remove-PfaUnusedHosts -FlashArray $fa -Cluster $cluster | Out-Null Write-Progress -Activity "Refreshing iSCSI targets" -Status "75% Complete:" -PercentComplete 75 if ($updated_hosts) { $ethList = (Get-Pfa2NetworkInterface -Array $FlashArray | Where-Object {$_.services -eq "iscsi"} | Where-Object {$_.enabled -eq $true} | Where-Object {$null -ne $_.Eth.address}).Eth $ISCSIAddressList = @() foreach ($eth in $ethList) { $ISCSIAddressList += $eth.address } $params = @{ ClusterName = $ClusterName # Need to join the list as string as RunCommand does not support array type ISCSIAddress = $ISCSIAddressList -join "," } Invoke-RunScript -RunCommandName "Remove-VMHostStaticiSCSITargets" -RunCommandModule "Microsoft.AVS.VMFS" -Parameters $params ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup } Write-Host "Cluster '$ClusterName' is successfully built" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -PercentComplete 100 } catch { New-PhoneHomeWorkflowLogEntry -RestClient $fa -Event $global:ErrorWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand -ErrorMessage $_ throw } New-PhoneHomeWorkflowLogEntry -RestClient $fa -Event $global:CompleteWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function New-PCBSVmfsDatastore { <# .SYNOPSIS Creates a new VMFS datastore and mounts to a VMware cluster .DESCRIPTION Creates a new VMFS datastore and mounts to a VMware cluster .PARAMETER ClusterName Cluster name .PARAMETER DatastoreName Datastore name .PARAMETER Size Datastore capacity size in bytes .PARAMETER PureCloudBlockStoreConnection Optional. Pure Cloud Block Store Connection. The connection can be created using Connect-Pf2Array cmdlet .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS Resource group name .EXAMPLE New-PCBSVmfsDatastore -ClusterName myClusterName -PureCloudBlockStoreConnection $CBSConnection -DatastoreName MyVMFSStore -Size 4GB ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Create a datastore "MyVMFS" #> [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [String]$ClusterName, [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [String]$DatastoreName, [Parameter(Mandatory=$true)] [UInt64]$Size, [Parameter(Mandatory=$false)] $PureCloudBlockStoreConnection, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Progress -Activity "Creating datastore" -Status "0% Complete:" -PercentComplete 1 $fa = Connect-PureCloudBlockStore -PureCloudBlockStoreConnection $PureCloudBlockStoreConnection $WorkflowID = New-WorkflowID New-PhoneHomeWorkflowLogEntry -RestClient $fa -Event $global:BeginWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand try { $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName $Cluster = Get-Cluster -Server $vCenterServer -Name $ClusterName -ErrorAction Ignore if (-not $Cluster) { throw "Cluster $ClusterName does not exist." } $ClusterStatus = Get-AVSClusterProvisionStatus -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName -AvsClusterName $ClusterName if ($ClusterStatus -ne "Succeeded") { throw "The current provisioning status of cluster $ClusterName is $ClusterStatus. The operation can only proceed when provisioning status is 'Succeeded'" } New-PfaVmfs -Cluster $Cluster -Flasharray $fa -Name $DatastoreName -vCenterServer $vCenterServer -Size $Size ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "Datastore '$DatastoreName' is successfully created" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed } catch { New-PhoneHomeWorkflowLogEntry -RestClient $fa -Event $global:ErrorWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand -ErrorMessage $_ throw } New-PhoneHomeWorkflowLogEntry -RestClient $fa -Event $global:CompleteWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Restore-PCBSVmfsDatastore { <# .SYNOPSIS Mounts a copy of a VMFS datastore to a VMware cluster from a Pure Cloud Block Store snapshot, volume, or pod. .DESCRIPTION Takes in a snapshot/volume/pod name, the corresponding Pure Cloud Block Store, and a cluster. The VMFS copy will be resignatured and mounted. .PARAMETER ClusterName Cluster name .PARAMETER VolumeSnapshotName Volume snapshot name. A volume will be created from the volume snapshot. A datastore will be created from the volume .PARAMETER VolumeName Volume name. A datastore will be created from the volume. No volume copy will be created, the volume specified will be directly used for the datastore .PARAMETER ProtectionGroupSnapshotName Protection group snapshot name. All of volume snapshots of the protection group snapshot will be used for restoring. The snapshot will be skipped if not supported. .PARAMETER PodName Pod name. All of volumes of the pod will be used for restoring. The volume will be skipped if not supported .PARAMETER PureCloudBlockStoreConnection Optional. Pure Cloud Block Store Connection. The connection can be created using Connect-Pf2Array cmdlet .PARAMETER DatastoreName Optional. Datastore name. If the parameter is not specified, a generated name will be used. .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS Resource group name .EXAMPLE Restore-PCBSVmfsDatastore -ClusterName myClusterName -VolumeSnapshotName mySnapshotName -PureCloudBlockStoreConnection $CBSConnection ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Takes in a snapshot name, the corresponding Pure Cloud Block Store, and a cluster. The VMFS copy will be resignatured and mounted. .EXAMPLE Restore-PCBSVmfsDatastore -ClusterName myClusterName -VolumeName myVolumeName -PureCloudBlockStoreConnection $CBSConnection ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Takes in a volume name, the corresponding Pure Cloud Block Store, and a cluster. The VMFS copy will be resignatured and mounted. #> [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [String]$ClusterName, [Parameter(Mandatory = $true, ParameterSetName = 'VolumeSnapshot')] [String]$VolumeSnapshotName, [Parameter(Mandatory = $true, ParameterSetName = 'Volume')] [String]$VolumeName, [Parameter(Mandatory = $true, ParameterSetName = 'ProtectionGroupSnapshot')] [String]$ProtectionGroupSnapshotName, [Parameter(Mandatory = $true, ParameterSetName = 'Pod')] [String]$PodName, [Parameter(Mandatory = $false, ParameterSetName = 'Volume')] [Parameter(Mandatory = $false, ParameterSetName = 'VolumeSnapshot')] [String]$DatastoreName, [Parameter(Mandatory=$false)] $PureCloudBlockStoreConnection, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Progress -Activity "Restoring datastore" -Status "0% Complete:" -PercentComplete 1 $fa = Connect-PureCloudBlockStore -PureCloudBlockStoreConnection $PureCloudBlockStoreConnection $WorkflowID = New-WorkflowID New-PhoneHomeWorkflowLogEntry -RestClient $fa -Event $global:BeginWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand try { $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName $Cluster = Get-Cluster -Server $vCenterServer -Name $ClusterName -ErrorAction Ignore if (-not $Cluster) { throw "Cluster '$ClusterName' does not exist." } $ClusterStatus = Get-AVSClusterProvisionStatus -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName -AvsClusterName $ClusterName if ($ClusterStatus -ne "Succeeded") { throw "The current provisioning status of cluster $ClusterName is $ClusterStatus. The operation can only proceed when provisioning status is 'Succeeded'" } if (-not [string]::IsNullOrEmpty($DatastoreName)) { $Datastore = Get-Datastore -Server $vCenterServer -Name $DatastoreName -ErrorAction Ignore if ($Datastore) { throw "Datastore '$Datastore' already exists." } } switch ($PSCmdlet.ParameterSetName) { 'Volume' { Write-Host "Creating datastore from volume..." $NewDatastore = Restore-PfaVmfsFromVolume -FlashArray $fa -Cluster $Cluster -VolumeName $VolumeName -DatastoreName $DatastoreName ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup break } 'VolumeSnapshot' { Write-Host "Creating datastore from volume snapshot..." $NewDatastore = Restore-PfaVmfsFromVolumeSnapshot -FlashArray $fa -Cluster $Cluster -VolumeSnapshotName $VolumeSnapshotName -DatastoreName $DatastoreName ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup break } 'ProtectionGroupSnapshot' { Write-Host "Creating datastore from protection group snapshot..." $NewDatastore = Restore-PfaVmfsFromProtectionGroupSnapshot -FlashArray $fa -Cluster $Cluster -ProtectionGroupSnapshotName $ProtectionGroupSnapshotName ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup break } 'Pod' { Write-Host "Creating datastore from pod..." $NewDatastore = Restore-PfaVmfsFromPod -FlashArray $fa -Cluster $Cluster -PodName $PodName ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup break } } Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Write-Host "Datastore '$($NewDatastore.Name)' is successfully restored" } catch { New-PhoneHomeWorkflowLogEntry -RestClient $fa -Event $global:ErrorWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand -ErrorMessage $_ throw } New-PhoneHomeWorkflowLogEntry -RestClient $fa -Event $global:CompleteWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue return $NewDatastore } function Remove-PCBSVmfsDatastore { <# .SYNOPSIS Detaches and unmount a VMFS datastore from a cluster. Remove the datastore from the host group .DESCRIPTION Detaches and unmount a VMFS datastore from a cluster. Remove the datastore from the host group. The connection configured for the volume and cluster host/host group will be removed from Pure Cloud Block Store. The volume will be destroyed if there is no other connection left. .PARAMETER ClusterName Cluster name .PARAMETER DatastoreName Datastore name .PARAMETER PureCloudBlockStoreConnection Optional. Pure Cloud Block Store Connection. The connection can be created using Connect-Pf2Array cmdlet .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS Resource group name .EXAMPLE Remove-PCBSVmfsDatastore -ClusterName "mycluster" -DatastoreName "myDatastore" PureCloudBlockStoreConnection $CBSConnection ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Takes in a datastore name, datastore would be removed. #> [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [String]$ClusterName, [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [String]$DatastoreName, [Parameter(Mandatory=$false)] $PureCloudBlockStoreConnection, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Progress -Activity "Removing datastore" -Status "0% Complete:" -PercentComplete 1 $FlashArray = Connect-PureCloudBlockStore -PureCloudBlockStoreConnection $PureCloudBlockStoreConnection $WorkflowID = New-WorkflowID New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:BeginWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand try { $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName $Cluster = Get-Cluster -Server $vCenterServer -Name $ClusterName -ErrorAction Ignore if (-not $Cluster) { throw "Cluster '$ClusterName' does not exist." } $ClusterStatus = Get-AVSClusterProvisionStatus -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName -AvsClusterName $ClusterName if ($ClusterStatus -ne "Succeeded") { throw "The current provisioning status of cluster $ClusterName is $ClusterStatus. The operation can only proceed when provisioning status is 'Succeeded'" } $Datastore = Get-Datastore -Server $vCenterServer -Name $DatastoreName -ErrorAction Ignore if (-not $Datastore) { throw "Datastore '$DatastoreName' does not exist." } Remove-PfaVmfsDatastore -Cluster $Cluster -Datastore $DataStore -FlashArray $FlashArray ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "Datastore '$DatastoreName' is successfully removed" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed } catch { New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:ErrorWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand -ErrorMessage $_ throw } New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:CompleteWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Set-PCBSVmfsCapacity { <# .SYNOPSIS Increase the size of a Pure Cloud Block Store-based VMFS datastore. .DESCRIPTION Takes in a datastore, the corresponding Pure Cloud Block Store, and a new size. Both the volume and the VMFS will be grown. .PARAMETER ClusterName Cluster name .PARAMETER DatastoreName Datastore name .PARAMETER Size New datastore capacity size in bytes .PARAMETER PureCloudBlockStoreConnection Optional. Pure Cloud Block Store Connection. The connection can be created using Connect-Pf2Array cmdlet .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS Resource group name .EXAMPLE Set-PCBSVmfsCapacity -ClusterName "mycluster" -DatastoreName myDatastore -Size 3GB -PureCloudBlockStoreConnection $CBSConnection ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Expand size of the datastore myDatastore to 3GB. #> [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [String]$ClusterName, [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [string]$DatastoreName, [Parameter(Mandatory=$true)] [UInt64]$Size, [Parameter(Mandatory=$false)] $PureCloudBlockStoreConnection, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Progress -Activity "Resizing datastore" -Status "0% Complete:" -PercentComplete 1 $FlashArray = Connect-PureCloudBlockStore -PureCloudBlockStoreConnection $PureCloudBlockStoreConnection $WorkflowID = New-WorkflowID New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:BeginWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand try { $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName $Cluster = Get-Cluster -Server $vCenterServer -Name $ClusterName -ErrorAction Ignore if (-not $Cluster) { throw "Cluster '$ClusterName' does not exist." } $ClusterStatus = Get-AVSClusterProvisionStatus -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName -AvsClusterName $ClusterName if ($ClusterStatus -ne "Succeeded") { throw "The current provisioning status of cluster $ClusterName is $ClusterStatus. The operation can only proceed when provisioning status is 'Succeeded'" } $Datastore = Get-Datastore -Server $vCenterServer -Name $DatastoreName -ErrorAction SilentlyContinue if (-not $Datastore) { throw "Could not find datastore '$DatastoreName'! Please make sure to select an existing datastore." } Set-PfaVmfsCapacity -Cluster $Cluster -FlashArray $FlashArray -Datastore $Datastore -SizeInByte $Size ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "Datastore '$DatastoreName' is successfully resized" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed } catch { New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:ErrorWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand -ErrorMessage $_ throw } New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:CompleteWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function New-PCBSVASAProvider { <# .SYNOPSIS Register Pure Cloud Block Store VASA providers with vCenter .DESCRIPTION Register Pure Cloud Block Store VASA providers for all array controllers with vCenter. If a VASA provider has a certificate problem, it will be created .PARAMETER PureCloudBlockStoreConnection Optional. Pure Cloud Block Store Connection. The connection can be created using Connect-Pf2Array cmdlet .PARAMETER PureCloudBlockStoreCredential Pure Cloud BlockStore Credential .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS Resource group name .EXAMPLE New-PCBSVASAProvider -PureCloudBlockStoreConnection $CBSConnection -PureCloudBlockStoreCredential $CBSConnectionCredential ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup #> [CmdletBinding()] Param( [Parameter(Mandatory=$false)] $PureCloudBlockStoreConnection, [Parameter(Mandatory=$true)] [PSCredential]$PureCloudBlockStoreCredential, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Register VASA provider" -Status "0% Complete:" -PercentComplete 1 $FlashArray = Connect-PureCloudBlockStore -PureCloudBlockStoreConnection $PureCloudBlockStoreConnection $WorkflowID = New-WorkflowID New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:BeginWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand try { $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName Update-VASAProvider -vCenterServer $vCenterServer -FlashArray $FlashArray -FlashArrayCredential $PureCloudBlockStoreCredential ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup }catch { New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:ErrorWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand -ErrorMessage $_ throw } New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:CompleteWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand Write-Host "VASA provider is successfully registered." Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Update-PCBSVASAProvider { <# .SYNOPSIS Refresh Pure Cloud Block Store VASA provider vCenter certificates .DESCRIPTION Refresh Pure Cloud Block Store VASA provider vCenter certificates .PARAMETER PureCloudBlockStoreConnection Optional. Pure Cloud Block Store Connection. The connection can be created using Connect-Pf2Array cmdlet .PARAMETER PureCloudBlockStoreCredential Pure Cloud BlockStore Credential .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS Resource group name .EXAMPLE Update-PCBSVASAProvider -PureCloudBlockStoreConnection $CBSConnection -PureCloudBlockStoreCredential $CBSConnectionCredential ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup #> [CmdletBinding()] Param( [Parameter(Mandatory=$false)] $PureCloudBlockStoreConnection, [Parameter(Mandatory=$true)] [PSCredential]$PureCloudBlockStoreCredential, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Update VASA provider" -Status "0% Complete:" -PercentComplete 1 $FlashArray = Connect-PureCloudBlockStore -PureCloudBlockStoreConnection $PureCloudBlockStoreConnection $WorkflowID = New-WorkflowID New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:BeginWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand try { $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName Update-VASAProvider -vCenterServer $vCenterServer -FlashArray $FlashArray -FlashArrayCredential $PureCloudBlockStoreCredential -RefreshOnly ` -AVSResourceGroup $AVSResourceGroup -AVSCloudName $AVSCloudName }catch { New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:ErrorWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand -ErrorMessage $_ throw } New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:CompleteWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand Write-Host "VASA provider is successfully updated." Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function New-PCBSVvolDataStore { <# .SYNOPSIS Mount a vVol datastore on all of the hosts in the cluster. .DESCRIPTION Mount a vVol datastore on all of the hosts in the cluster. .PARAMETER ClusterName Cluster name .PARAMETER DatastoreName Optional. Datastore name. If not provided, a datastore name driven from the Pure Cloud Clock Store Name will be used .PARAMETER UseDefaultStore Optional. Indicates whether to use default root container. If not provided, the default store will not be used and multi-storage Pod container will be used. Note that Non-default store can only be used with Pure Cloud Block Store version 6.4.1 or later. .PARAMETER PureCloudBlockStoreConnection Optional. Pure Cloud Block Store Connection. The connection can be created using Connect-Pf2Array cmdlet .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS resource group name .EXAMPLE New-PCBSVVolDataStore -ClusterName "mycluster" -DatastoreName "myDatastore" -PureCloudBlockStoreConnection $CBSConnection ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup #> [CmdletBinding()] Param( [Parameter(Mandatory=$true)] [String]$ClusterName, [Parameter(Mandatory=$false)] [String]$DatastoreName, [Parameter(Mandatory=$false)] [bool]$UseDefaultStore, [Parameter(Mandatory=$false)] $PureCloudBlockStoreConnection, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Add datastore" -Status "0% Complete:" -PercentComplete 1 $FlashArray = Connect-PureCloudBlockStore -PureCloudBlockStoreConnection $PureCloudBlockStoreConnection $WorkflowID = New-WorkflowID New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:BeginWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand try { $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName $Cluster = Get-Cluster -Server $vCenterServer -Name $ClusterName -ErrorAction Ignore if (-not $Cluster) { throw "Cluster $ClusterName does not exist." } $ClusterStatus = Get-AVSClusterProvisionStatus -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName -AvsClusterName $ClusterName if ($ClusterStatus -ne "Succeeded") { throw "The current provisioning status of cluster $ClusterName is $ClusterStatus. The operation can only proceed when provisioning status is 'Succeeded'" } $datastore = Mount-VvolDatastore -vCenterServer $vCenterServer -DatastoreName $DatastoreName -Cluster $Cluster -FlashArray $FlashArray -UseDefaultStore $UseDefaultStore ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Wait-VvolDatastoreCreation -DataStoreName $datastore.Name } catch { New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:ErrorWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand -ErrorMessage $_ throw } New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:CompleteWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand Write-Host "Datastore '$($datastore.Name)' is successfully created" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Remove-PCBSVVolDataStore { <# .SYNOPSIS Remove a vVol datastore from all of the hosts in the cluster. .DESCRIPTION Remove a vVol datastore from all of the hosts in the cluster. .PARAMETER ClusterName Cluster name .PARAMETER DatastoreName Datastore name .PARAMETER PureCloudBlockStoreConnection Optional. Pure Cloud Block Store Connection. The connection can be created using Connect-Pf2Array cmdlet .PARAMETER AVSCloudName AVS Cloud Name .PARAMETER AVSResourceGroup AVS Resource Group .EXAMPLE Remove-PCBSVVolDataStore -ClusterName "mycluster" -DatastoreName "myDatastore" -PureCloudBlockStoreConnection $CBSConnection ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup #> [CmdletBinding()] Param( [Parameter(Mandatory=$true)] [String]$ClusterName, [Parameter(Mandatory=$true)] [String]$DatastoreName, [Parameter(Mandatory=$false)] $PureCloudBlockStoreConnection, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Remove datastore" -Status "0% Complete:" -PercentComplete 1 $FlashArray = Connect-PureCloudBlockStore -PureCloudBlockStoreConnection $PureCloudBlockStoreConnection $WorkflowID = New-WorkflowID New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:BeginWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand try { $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName $Cluster = Get-Cluster -Server $vCenterServer -Name $ClusterName -ErrorAction Ignore if (-not $Cluster) { throw "Cluster $ClusterName does not exist." } $ClusterStatus = Get-AVSClusterProvisionStatus -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName -AvsClusterName $ClusterName if ($ClusterStatus -ne "Succeeded") { throw "The current provisioning status of cluster $ClusterName is $ClusterStatus. The operation can only proceed when provisioning status is 'Succeeded'" } $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName Dismount-VvolDatastore -vCenterServer $vCenterServer -DatastoreName $DatastoreName -Cluster $Cluster -FlashArray $FlashArray ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "Datastore '$DatastoreName' is successfully removed" } catch { New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:ErrorWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand -ErrorMessage $_ throw } Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue New-PhoneHomeWorkflowLogEntry -RestClient $FlashArray -Event $global:CompleteWorkflow -ID $WorkflowID -Name $MyInvocation.MyCommand } function New-PCBSStoragePolicy { <# .SYNOPSIS Creates a new Pure Cloud Block Store vVol Storage Policy .DESCRIPTION Creates a new Pure Cloud Block Store vVol Storage Policy with specified capabilities .INPUTS Capabilities .OUTPUTS New storage policy .PARAMETER PolicyName Pure Cloud Block Store vVol Storage Policy name. .PARAMETER PolicyDescription Optional. Pure Cloud Block Store vVol Storage Policy description. .PARAMETER SourcePureCloudBlockStores Optional. Name of one or more Pure Cloud Block Store to use. Use comma as seperater if there are multiple names .PARAMETER ReplicationEnabled Optional. Replication capability rule. The input value could be yes, no or empty, If not provided replication will not be enabled. .PARAMETER ReplicationInterval Optional. Replication capability rule. Protection group remote snapshot creation interval in seconds. .PARAMETER ReplicationRetentionInterval Optional. Replication capability rule. Protection group remote snapshot retention interval in seconds. .PARAMETER ReplicationRuleLocalSnapshotEnabled Optional. Replication capability rule. The input value could be yes, no or empty. .PARAMETER ReplicationRuleLocalSnapshotInterval Optional. Replication capability rule. Protection group local snapshot creation interval in seconds. .PARAMETER ReplicationRuleLocalSnapshotRetentionInterval Optional. Replication capability rule. Protection group local snapshot retention interval in seconds. .PARAMETER ReplicationConcurrency Optional. Replication capability rule. The number of target Pure Cloud Block Store to replicate to at once. .PARAMETER ReplicationRansomwareProtection Optional. Replication capability rule. Protection group ransomware protection .PARAMETER TargetPureCloudBlockStores Optional. Replication capability rule. Names of specific Pure Cloud Block Store desired as replication targets. Use comma as seperater if there are multiple names .PARAMETER ConsistencyGroupName Optional. Replication capability rule. A Pure Cloud Block Store protection group name .PARAMETER PerVirtualDiskIOPSLimit Optional. QoS placement capability rule. IOPS limit get applied to per virtual disk .PARAMETER PerVirtualDiskIOPSLimitUnit Optional. QoS placement capability rule. IOPS limit unit (K, M, or -) .PARAMETER PerVirtualDiskBandwidthLimit Optional. QoS placement capability rule. Bandwidth limit get applied to per virtual disk .PARAMETER PerVirtualDiskBandwidthLimitUnit Optional. QoS placement capability rule. Bandwidth limit unit (KB/s, MB/s or GB/s) .PARAMETER VolumeTaggingKey Optional. Volume tagging placement capability. Volumes with this policy will be tagged with the key .PARAMETER VolumeTaggingValue Optional. Volume tagging placement capability. Volumes with this policy will be tagged with the value .PARAMETER VolumeTaggingCopyable Optional. Volume tagging placement capability. When set to yes, any volume copies of this volume will receive the tag .PARAMETER PlacementRuleLocalSnapshotInterval Optional. Local snapshot protection placement capability. Snapshots will be taken in the specified interval in seconds. .PARAMETER PlacementRuleLocalSnapshotRetentionInterval Optional. Local snapshot protection placement capability. Snapshots will be retained for the timespan in seconds. .PARAMETER PlacementRuleLocalSnapshotRetainAdditionalSnapshots Optional. Local snapshot protection placement capability. Optional additional retention: After the retention timespan specified above is up, a number of snapshots will be selected, evenly spaced out, from the last retention timespan. This parameter specifies the number of snapshots to select from the last retention timespan. These snapshots will be retained for a number of additional days (see parameter below). Leave this parameter as "0" if additional retention is not required. .PARAMETER PlacementRuleLocalSnapshotRetainAdditionalDays Optional. Local snapshot protection placement capability. Optional additional retention: This parameter specifies the number of days that additional snapshots should be retained. If a selection for "Retain additional snapshots" (see above) was made, this parameter must also be specified. Leave this parameter as "0" if additional retention is not required. .PARAMETER OffloadType Optional. Snapshot offload protection placement capability. Purity//FA Snap to Cloud is a policy-based solution to manage portable snapshots through the offload of volume snapshots to a target, such as an Azure Blob container, or an S3 bucket, for long-term retention. With different types of offload targets this rule allows policies to specify a specific offload target type or to have no requirement for a specific type of target. .PARAMETER OffloadTargetNames Optional. Snapshot offload protection placement capability. Upon the first assignment of this policy to a VM on a given datastore a consistency group will be created with the settings supplied. This rule specifies which targets are added to the consistency groups target list. If no requirement is selected then the storage provider will selected one of the available offload targets on the compatible datastore's array. .PARAMETER OffloadReplicationInterval Optional. Snapshot offload protection placement capability. Snapshots will be taken and replicated to the offload target in the specified interval. .PARAMETER OffloadOffloadReplicationTime Optional. Snapshot offload protection placement capability. If the replication interval is set to one or more days, optionally set the 'Daily/weekly replication time' to specify the preferred hour of each day when Purity//FA replicates the snapshot. For example, if the replication schedule is set to "Replicate every 4 days at 6pm," Purity//FA replicates the snapshots every four days at or around 6:00 p.m. .PARAMETER OffloadRetentionInterval Optional. Snapshot offload protection placement capability. Replicated snapshots will be retained for the specified timespan on the offload target. .PARAMETER OffloadRetainAdditionalSnapshots Optional. Snapshot offload protection placement capability. After the retention timespan specified is up, a number of snapshots will be selected, evenly spaced out, from the last retention timespan. This parameter specifies the number of snapshots to select from the last retention timespan. These snapshots will be retained for a number of additional days (see parameter below). Leave this parameter as "0" if additional retention is not required. .PARAMETER OffloadRetainAdditionalDays Optional. Snapshot offload protection placement capability. This parameter specifies the number of days that additional snapshots should be retained. If a selection for "Retain additional snapshots" (see above) was made, this parameter must also be specified. Leave this parameter as "0" if additional retention is not required. .PARAMETER OffloadReplicationBlackoutFrom Optional. Snapshot offload protection placement capability. Define a timespan for which replication is suspended or "blacked out". The asynchronous replication process stops during the blackout period. When the blackout period starts, replication processes that are still in progress will not be interrupted. Instead, Purity//FA will wait until the in-progress snapshot replication is complete before it observes the blackout period. This value dictates when the blackout period begins. .PARAMETER OffloadReplicationBlackoutTo Optional. Snapshot offload protection placement capability. Define a timespan for which replication is suspended or "blacked out". The asynchronous replication process stops during the blackout period. When the blackout period starts, replication processes that are still in progress will not be interrupted. Instead, Purity//FA will wait until the in-progress snapshot replication is complete before it observes the blackout period. This value dictates when the blackout period ends and replication jobs can be initiated again. .PARAMETER DefaultProtectionOptout Optional. Default protection opt-out placement capability. Whether should new volumes be placed in default protection groups. If not provided, new volumes will be placed in default protection groups. .PARAMETER AVSCloudName AVS Cloud Name .PARAMETER AVSResourceGroup AVS Resource Group .EXAMPLE New-PCBSStoragePolicy Creates the default SPBM policy that indicates a VM should be on a Pure Cloud Block Store using vVols. Default generated name and description. .EXAMPLE New-PCBSStoragePolicy -PolicyName myGreatPolicy ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Creates a SPBM policy with the specified name that indicates a VM should be on a Pure Cloud Block Store using vVols. Default generated description. .EXAMPLE New-PCBSStoragePolicy -PolicyName myGreatReplicationPolicy -ReplicationInterval 7200 -ReplicationEnabled "yes" -ReplicationConcurrency 2 ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Creates a replication-type SPBM policy with the specified name that indicates a VM should be on a Pure Cloud Block Store using vVols, replicated every 2 hours to at least two other Pure Cloud Block Stores. Default generated description. .EXAMPLE New-PCBSStoragePolicy -PolicyName myGreatReplicationPolicy -SourcePureCloudBlockStores "MyArrayOne,MyArrayTwo" ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Creates a SPBM policy with the specified name that indicates a VM should be on the specific Pure Cloud Block Store using vVols. #> [CmdletBinding()] Param( [Parameter(Mandatory=$true)] [String]$PolicyName, [Parameter(Mandatory=$false)] [String]$PolicyDescription = "Pure Storage Cloud Block Store vVol storage policy default description", [Parameter(Mandatory=$false)] [string[]]$SourcePureCloudBlockStores, [Parameter(Mandatory=$false)] [Nullable[boolean]]$ReplicationEnabled, [Parameter(Mandatory=$false)] [Timespan]$ReplicationInterval, [Parameter(Mandatory=$false)] [Timespan]$ReplicationRetentionInterval, [Parameter(Mandatory=$false)] [Nullable[boolean]]$ReplicationRuleLocalSnapshotEnabled, [Parameter(Mandatory=$false)] [Timespan]$ReplicationRuleLocalSnapshotInterval, [Parameter(Mandatory=$false)] [Timespan]$ReplicationRuleLocalSnapshotRetentionInterval, [Parameter(Mandatory=$false)] [int]$ReplicationConcurrency, [Parameter(Mandatory=$false)] [Nullable[boolean]]$ReplicationRansomwareProtection, [Parameter(Mandatory=$false)] [string[]]$TargetPureCloudBlockStores, [Parameter(Mandatory=$false)] [String]$ConsistencyGroupName, [Parameter(Mandatory=$false)] [int]$PerVirtualDiskIOPSLimit, [Parameter(Mandatory=$false)] [String]$PerVirtualDiskIOPSLimitUnit, [Parameter(Mandatory=$false)] [int]$PerVirtualDiskBandwidthLimit, [Parameter(Mandatory=$false)] [String]$PerVirtualDiskBandwidthLimitUnit, [Parameter(Mandatory=$false)] [String]$VolumeTaggingKey, [Parameter(Mandatory=$false)] [String]$VolumeTaggingValue, [Parameter(Mandatory=$false)] [Nullable[boolean]]$VolumeTaggingCopyable, [Parameter(Mandatory=$false)] [Timespan]$PlacementRuleLocalSnapshotInterval, [Parameter(Mandatory=$false)] [Timespan]$PlacementRuleLocalSnapshotRetentionInterval, [Parameter(Mandatory=$false)] [int]$PlacementRuleLocalSnapshotRetainAdditionalSnapshots, [Parameter(Mandatory=$false)] [int]$PlacementRuleLocalSnapshotRetainAdditionalDays, [Parameter(Mandatory=$false)] [ValidateSet("s3", "nfs", "azure")] [string]$OffloadType, [Parameter(Mandatory=$false)] [string[]]$OffloadTargetNames, [Parameter(Mandatory=$false)] [Timespan]$OffloadReplicationInterval, [Parameter(Mandatory=$false)] [ValidateSet("-", "12am", "1am", "2am", "3am", "4am", "5am", "6am", "7am", "8am", "9am", "10am", "11am", "12pm", "1pm", "2pm", "3pm", "4pm", "5pm", "6pm", "7pm", "8pm", "9pm", "10pm", "11pm")] [string]$OffloadOffloadReplicationTime, [Parameter(Mandatory=$false)] [Timespan]$OffloadRetentionInterval, [Parameter(Mandatory=$false)] [int]$OffloadRetainAdditionalSnapshots, [Parameter(Mandatory=$false)] [int]$OffloadRetainAdditionalDays, [Parameter(Mandatory=$false)] [ValidateSet("-", "12am", "1am", "2am", "3am", "4am", "5am", "6am", "7am", "8am", "9am", "10am", "11am", "12pm", "1pm", "2pm", "3pm", "4pm", "5pm", "6pm", "7pm", "8pm", "9pm", "10pm", "11pm")] [string]$OffloadReplicationBlackoutFrom, [Parameter(Mandatory=$false)] [ValidateSet("-", "12am", "1am", "2am", "3am", "4am", "5am", "6am", "7am", "8am", "9am", "10am", "11am", "12pm", "1pm", "2pm", "3pm", "4pm", "5pm", "6pm", "7pm", "8pm", "9pm", "10pm", "11pm")] [string]$OffloadReplicationBlackoutTo, [Parameter(Mandatory=$false)] [Nullable[boolean]]$DefaultProtectionOptout, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Create storage policy" -Status "0% Complete:" -PercentComplete 1 $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName New-VvolStoragePolicy -PolicyName $PolicyName -PolicyDescription $PolicyDescription -SourcePureCloudBlockStores $SourcePureCloudBlockStores -ReplicationEnabled $ReplicationEnabled -ReplicationInterval $ReplicationInterval -ReplicationRetentionInterval $ReplicationRetentionInterval ` -ReplicationRuleLocalSnapshotEnabled $ReplicationRuleLocalSnapshotEnabled -ReplicationRuleLocalSnapshotInterval $ReplicationRuleLocalSnapshotInterval -ReplicationRuleLocalSnapshotRetentionInterval $ReplicationRuleLocalSnapshotRetentionInterval -ReplicationConcurrency $ReplicationConcurrency -ReplicationRansomwareProtection $ReplicationRansomwareProtection ` -TargetPureCloudBlockStores $TargetPureCloudBlockStores -ConsistencyGroupName $ConsistencyGroupName -PerVirtualDiskIOPSLimit $PerVirtualDiskIOPSLimit -PerVirtualDiskIOPSLimitUnit $PerVirtualDiskIOPSLimitUnit ` -PerVirtualDiskBandwidthLimit $PerVirtualDiskBandwidthLimit -PerVirtualDiskBandwidthLimitUnit $PerVirtualDiskBandwidthLimitUnit -VolumeTaggingKey $VolumeTaggingKey -VolumeTaggingValue $VolumeTaggingValue -VolumeTaggingCopyable $VolumeTaggingCopyable ` -PlacementRuleLocalSnapshotInterval $PlacementRuleLocalSnapshotInterval -PlacementRuleLocalSnapshotRetentionInterval $PlacementRuleLocalSnapshotRetentionInterval -PlacementRuleLocalSnapshotRetainAdditionalSnapshots $PlacementRuleLocalSnapshotRetainAdditionalSnapshots -PlacementRuleLocalSnapshotRetainAdditionalDays $PlacementRuleLocalSnapshotRetainAdditionalDays ` -OffloadType $OffloadType -OffloadTargetNames $OffloadTargetNames -OffloadReplicationInterval $OffloadReplicationInterval -OffloadOffloadReplicationTime $OffloadOffloadReplicationTime -OffloadRetentionInterval $OffloadRetentionInterval -OffloadRetainAdditionalSnapshots $OffloadRetainAdditionalSnapshots -OffloadRetainAdditionalDays $OffloadRetainAdditionalDays -OffloadReplicationBlackoutFrom $OffloadReplicationBlackoutFrom -OffloadReplicationBlackoutTo $OffloadReplicationBlackoutTo -DefaultProtectionOptout $DefaultProtectionOptout ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -vCenterServer $vCenterServer Write-Host "Storage policy '$PolicyName' is successfully created" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Remove-PCBSStoragePolicy { <# .SYNOPSIS Remove a Pure Cloud Block Store vVol Storage Policy .DESCRIPTION Remove a Pure Cloud Block Store vVol Storage Policy using policy name. The policy must be unused and belong to Pure .INPUTS SPBM policy name .PARAMETER PolicyName Pure Cloud Block Store vVol Storage Policy name .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS Resource group name .EXAMPLE Remove-PCBSStoragePolicy -PolicyName myPolicyName -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup #> [CmdletBinding()] Param( [Parameter(mandatory = $true)] [string]$PolicyName, [Parameter(Mandatory = $true)] [String]$AVSCloudName, [Parameter(Mandatory = $true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Remove storage policy" -Status "0% Complete:" -PercentComplete 1 $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName Remove-VvolStoragePolicy -PolicyName $PolicyName -vCenterServer $vCenterServer ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "Storage policy '$PolicyName' is successfully removed" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Start-PCBSFailover { <# .SYNOPSIS Issue test failover or failover operation against "Target" replication group. .DESCRIPTION Issue test failover or failover operation against replication group. Must be run on a "Target" Replication Group. .PARAMETER TargetReplicationGroupID Target VMWare Replication Group Id to be used on failover. Must be a "Target" Replication Group. .PARAMETER PointInTimeReplicaName Optional. Point in time replica name to failover to. If not provided, the latest replica will be used. .PARAMETER ClusterName Cluster name where failover VMs will be created. .PARAMETER PowerOn Optional. Indicates whether to or not to power on created VMs. If not provided the VM(s) will be powered on. .PARAMETER TestFailover Optional. Indicates whether to actually perform a failover(false) or to only perform a test failover(true). If not provided will only perform failover test. .PARAMETER AVSCloudName AVS cloud name. The target AVS instance where the failover will be performed. .PARAMETER AVSResourceGroup AVS resource group name. .EXAMPLE Start-PCBSFailover -TargetReplicationGroupID myGroupId -ClusterName myclustername -TestFailover $true -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Issues test failover on replication group specified by id "myGroupId", test VMs will be created under cluster "myclustername", and group replication state will be set to "InTest" .EXAMPLE Start-PCBSFailover -TargetReplicationGroupID myGroupId -ClusterName myclustername -PowerOn $true -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Issues failover on replication group specified by id "myGroupId", test VMs will be created under cluster "myclustername", VMs created will be powered on, and group replication state will be set to "FailedOver" .EXAMPLE Start-PCBSFailover -TargetReplicationGroupID myGroupId -ClusterName myclustername -PowerOn $true -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Issues Failover on replication group specified by id "myGroupId", new VMs will be created under cluster "myclustername", VMs created will be powered on, and group replication state will be set to "FailedOver" #> [CmdletBinding()] Param( [Parameter(mandatory = $true)] [String]$ClusterName, [Parameter(mandatory = $true)] [String]$TargetReplicationGroupID, [Parameter(mandatory = $false)] [String]$PointInTimeReplicaName, [Parameter(mandatory = $false)] [switch]$PowerOn, [Parameter(mandatory = $false)] [switch]$TestFailover, [Parameter(Mandatory = $true)] [String]$AVSCloudName, [Parameter(Mandatory = $true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Start failover" -Status "0% Complete:" -PercentComplete 1 $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName Start-VvolReplicationGroupFailover -ReplicationGroupID $TargetReplicationGroupID -PointInTimeReplicaName $PointInTimeReplicaName -ClusterName $ClusterName -PowerOn $PowerOn -TestFailover $TestFailover -vCenterServer $vCenterServer ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "Replication group '$TargetReplicationGroupID' successfully failovered to cluster '$ClusterName'" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Sync-PCBSReplicationGroup { <# .SYNOPSIS Synchronize a replication group. Must be run on a "Target" Replication Group. .DESCRIPTION Synchronize a replication group. Triggers an on demand snapshot replication job. Must be run on a "Target" Replication Group. .PARAMETER TargetReplicationGroupID Replication Group Id that was used on the test failover .PARAMETER PointInTimeReplicaName Optional. Point in time replica name to sync to. If not provided, a generated name "Sync-*" will be used. .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS resource group name .EXAMPLE Sync-PCBSReplicationGroup -TargetReplicationGroupID myGroupId -PointInTimeReplicaName myReplicaName -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Synchronizes a replication group specified by id "myGroupId". An on demand snapshot replication job will be triggered on array #> [CmdletBinding()] Param( [Parameter(mandatory=$true)] [String]$TargetReplicationGroupID, [Parameter(mandatory = $false)] [String]$PointInTimeReplicaName, [Parameter(Mandatory = $true)] [String]$AVSCloudName, [Parameter(Mandatory = $true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Start Replication Group sync" -Status "0% Complete:" -PercentComplete 1 $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName if (-not $PointInTimeReplicaName) { $PointInTimeReplicaName = "Sync-$([guid]::newguid())" } Sync-VvolReplicationGroup -ReplicationGroupID $TargetReplicationGroupID -PointInTimeReplicaName $PointInTimeReplicaName -vCenterServer $vCenterServer ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "Replication group '$TargetReplicationGroupID' is successfully synced to point in time replica '$PointInTimeReplicaName'" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Stop-PCBSFailoverTest { <# .SYNOPSIS Stops a test failover that was started on replication group .DESCRIPTION Stops a test failover that was started on replication group. Must be used on a "InTest" Replication Group .PARAMETER InTestTargetReplicationGroupID Replication Group Id that was used on the test failover .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS resource group name .EXAMPLE Stop-PCBSFailoverTest -InTestReplicationGroupID myGroupId -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Stops a test failover that was started on replication group specified by id "myGroupId", test VMs will be stopped and deleted and group replication state will be set to "Target" #> [CmdletBinding()] Param( [Parameter(mandatory=$true)] [String]$InTestTargetReplicationGroupID, [Parameter(Mandatory = $true)] [String]$AVSCloudName, [Parameter(Mandatory = $true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Stop failover test" -Status "0% Complete:" -PercentComplete 1 $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName Stop-VvolReplicationGroupFailoverTest -ReplicationGroupID $InTestTargetReplicationGroupID -vCenterServer $vCenterServer ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "Failover test associated with Replication group '$InTestTargetReplicationGroupID' is successfully stopped" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Start-PCBSFailoverCleanup { <# .SYNOPSIS Cleans up the original source site after failing over to a new site. .DESCRIPTION Cleans up the original source site after failing over to a new site. Must be run on source site. Will stop and unregister VMs protected by replication group. .PARAMETER SourceReplicationGroupID Replication Group Id for source group used on the failover .PARAMETER RemoveFromDisk Optional. Indicates whether to remove VMs from disk. .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS resource group name .EXAMPLE Start-PCBSFailoverCleanup -SourceReplicationGroupID myGroupId -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Will stop and unregister VMs protected by replication group identified by "myGroupId". #> [CmdletBinding()] Param( [Parameter(Mandatory=$true)] [String]$SourceReplicationGroupID, [Parameter(Mandatory=$false)] [switch]$RemoveFromDisk, [Parameter(Mandatory = $true)] [String]$AVSCloudName, [Parameter(Mandatory = $true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Clean up original source site after failover" -Status "0% Complete:" -PercentComplete 1 $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName Start-VvolCleanupSourceReplicationGroupForFailover -ReplicationGroupID $SourceReplicationGroupID -RemoveFromDisk $RemoveFromDisk -vCenterServer $vCenterServer ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "The original source site '$SourceReplicationGroupID' is successfully cleaned up" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } function Start-PCBSFailoverReverse { <# .SYNOPSIS Reverse replication on a FailedOver replication group and reprotect by assigning a storage policy to affected objects .DESCRIPTION Reverse replication on a FailedOver replication group and reprotect by assigning a storage policy to affected objects. Must be used on a FailedOver Replication Group. The Failedover Replication Group will become "Source" .PARAMETER FailedoverTargetReplicationGroupID Replication Group Id that was used on failover .PARAMETER PolicyName Optional. Policy Name to be used to reprotect objects. .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS resource group name .EXAMPLE Start-PCBSFailoverReverse -FailedoverTargetReplicationGroupID myGroupId -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Reprotect replication group specified by id "myGroupId", and sets objects storage policy to the default "VVol No Requirements Policy" .EXAMPLE Start-PCBSFailoverReverse -FailedoverTargetReplicationGroupID myGroupId -PolicyName PolicyName -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Reprotect replication group specified by id "myGroupId", and sets objects storage policy to "PolicyName" #> [CmdletBinding()] Param( [Parameter(mandatory=$true)] [String]$FailedoverTargetReplicationGroupID, [Parameter(mandatory=$false)] [String]$PolicyName, [Parameter(Mandatory = $true)] [String]$AVSCloudName, [Parameter(Mandatory = $true)] [String]$AVSResourceGroup ) Write-Warning $VVOL_WARNIING Write-Progress -Activity "Reprotect replication group" -Status "0% Complete:" -PercentComplete 1 $vCenterServer = Connect-AVSvCenter -AVSResourceGroupName $AVSResourceGroup -AVSPrivateCloudName $AVSCloudName Start-VvolReprotectReplicationGroup -ReplicationGroupID $FailedoverTargetReplicationGroupID -PolicyName $PolicyName -vCenterServer $vCenterServer ` -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup Write-Host "The FailedOver replication group '$FailedoverTargetReplicationGroupID' is successfully reprotected" Write-Progress -Activity "Operation is done" -Status "100% Complete:" -Completed Disconnect-VIServer -Server $vCenterServer -Confirm:$false -ErrorAction SilentlyContinue } <# .SYNOPSIS Fully remove a Pure Storage CBS AVS monitor deployment from Azure infrastructure .DESCRIPTION Fully remove a Pure Storage CBS AVS monitor deployment from Azure infrastructure. The resource group and its resources will be destroyed. The vNet subnet used by the monitor will also be remove from the vNet. .PARAMETER MonitorResourceGroup ResourceGroup to host monitor infrastructure components .PARAMETER RemoveSubnet Optional. Indicates whether to remove the subnet used by the monitor from the vNet. If not provided, the subnet will not be removed. .EXAMPLE Remove-PCBSAVSMonitor -MonitorResourceGroup "myAVSMonitorResourceGroup" .NOTES Must be logged in to Azure (using Connect-AzAccount) before running this cmdlet #> function Remove-PCBSAVSMonitor { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [String]$MonitorResourceGroup, [Parameter(Mandatory=$false)] [Switch]$RemoveSubnet ) $ResourceGroup = Get-AzResourceGroup $MonitorResourceGroup -ErrorAction ignore if (-not $ResourceGroup) { throw "Pure Storage CBS AVS monitor $MonitorResourceGroup does not exist" } if ([string]::IsNullOrEmpty($ResourceGroup.Tags["PureStorage.CBS.AVS"])) { throw "The resource group provided is not Pure Storage CBS AVS monitor resource group. Only Pure Storage CBS AVS monitor resource group can be removed by this command" } # smartDetector is auto configured without tag. Ignore this component $NonMonitorResources = Get-AzResource -ResourceGroupName $MonitorResourceGroup | Where-Object { [string]::IsNullOrEmpty($_.tags["AVSMonitorResourceGroupName"]) -and $_.ResourceType -ne "microsoft.alertsmanagement/smartDetectorAlertRules"} if ($NonMonitorResources.Count -ge 1) { throw "Non Pure Storage CBS AVS monitor resource $($MonitorResources.Name) detected. Please manually remove the resource before removing the whole monitor" } $MonitorFuncApp = Get-AzFunctionApp -ResourceGroupName $MonitorResourceGroup $MonitorKeyVault = Get-AzKeyVault -ResourceGroupName $MonitorResourceGroup # Vnet name here is constructed as {vNetResouceGUI}-{SubnetName} # eg. fece391b-8f4e-4e05-a203-e5961cdd9fd1_subnet-avsfuncappsbqzuuqxofe2q $vNetResourceGUID = $MonitorFuncApp.SiteConfig.VnetName.Split("_")[0] $MonitorSubnetName = $MonitorFuncApp.SiteConfig.VnetName.Split("_")[1] $MonitorVNet = get-AzVirtualNetwork | Where-Object {$_.ResourceGuid -eq $vNetResourceGUID} Write-Host "Removing resource group $MonitorResourceGroup..." Remove-AzResourceGroup $MonitorResourceGroup -Force | Out-Null # Remove subnet if ($RemoveSubnet) { Write-Host "Removing subnet $MonitorSubnetName from vNet $($MonitorVNet.Name)..." Remove-AzVirtualNetworkSubnetConfig -Name $MonitorSubnetName -VirtualNetwork $MonitorVNet | Set-AzVirtualNetwork | Out-Null } # Purge key vault Write-Host "Purging key vault $($MonitorKeyVault.VaultName)..." Remove-AzKeyVault -Name $MonitorKeyVault.VaultName -InRemovedState -Force -Location $ResourceGroup.Location | Out-Null } <# .SYNOPSIS Deploy or update a Pure Storage CBS AVS monitor to Azure infrastructure .DESCRIPTION Deploy or update a Pure Storage CBS AVS monitor to Azure infrastructure. The monitor will scan periodically for AVS Cluster/Host changes and will make sure to change iSCSI configuration accordingly. .PARAMETER MonitorResourceGroup Resource group to host monitor infrastructure components. The resource group will be created if not exists .PARAMETER MonitorResourceGroupRegion Resource group region to host monitor infrastructure components. .PARAMETER AVSCloudName AVS cloud name .PARAMETER AVSResourceGroup AVS Resource group name .PARAMETER PureCloudBlockStoreEndpoint Pure Cloud Block Store endpoint address .PARAMETER PureCloudBlockStoreCredential Pure Cloud Block Store credentials .PARAMETER VNetName An existing VNet name. The VNey specified should have access to AVS as well as Pure Storage Cloud Block Store (CBS) array. .PARAMETER VNetResourceGroup VNet REsourceGroup .PARAMETER VNetSubnetAddress The VNet subnet address range in CIDR notation (e.g. 192.168.1.0/24). It must be contained by the address space of the virtual network. .PARAMETER VNetSubnetName If VNetSubnetAddress is specified, then VnetSubnetName can be optionaly used to specify a new subnet name otherwise it is existing VNet subnet name. .PARAMETER MonitorIntervalInMinute Optional. The default monitor interval is 10 minutes. .EXAMPLE Deploy-PCBSAVSMonitor -PureCloudBlockStoreEndpoint "192.168.2.100" -PureCloudBlockStoreCredential (Get-Credential) -AVSCloudName "my-avs" -AVSResourceGroup "avs-resourcegroup" ` -MonitorResourceGroup "NewResourceGroup" -MonitorResourceGroupRegion "westus2" -VNetName "my-vnet" -VNetResourceGroup "vnet-resourcegroup" -VNetSubnetAddress "192.168.3.0/24" .NOTES Must be logged in to Azure (using Connect-AzAccount) before running this cmdlet #> function Deploy-PCBSAVSMonitor { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [String]$MonitorResourceGroup, [Parameter(Mandatory=$true)] [String]$MonitorResourceGroupRegion, [Parameter(Mandatory=$true)] [String]$AVSCloudName, [Parameter(Mandatory=$true)] [String]$AVSResourceGroup, [Parameter(Mandatory=$true)] [String]$PureCloudBlockStoreEndpoint, [Parameter(Mandatory=$true)] [pscredential]$PureCloudBlockStoreCredential, [Parameter(Mandatory=$true)] [String]$VNetName, [Parameter(Mandatory=$true)] [String]$VNetResourceGroup, [Parameter(ParameterSetName='NewSubnet', Mandatory=$true)] [String]$VNetSubnetAddress, [Parameter(ParameterSetName='ExistingSubnet', Mandatory=$true)] [Parameter(ParameterSetName='NewSubnet', Mandatory=$false)] [String]$VNetSubnetName, [Parameter(Mandatory=$false)] [ValidateScript({ $_ -ge 10 }, ErrorMessage = "The minimum interval for the monitor is 10 minutes.")] [ValidateScript({ $_ -le 60 }, ErrorMessage = "The maximum interval for the monitor is 60 minutes.")] [int]$MonitorIntervalInMinute = 10 ) $ProductVersion = (Get-Module "PureStorage.CBS.AVS").Version.ToString() $ResourceGroup = Get-AzResourceGroup $MonitorResourceGroup -ErrorAction ignore if (-not $ResourceGroup) { Write-Host "Resource group $MonitorResourceGroup does not exist. Creating the resource group..." New-AzResourceGroup $MonitorResourceGroup -Location $MonitorResourceGroupRegion -Tag @{'PureStorage.CBS.AVS' = $ProductVersion} | Out-Null } else { if ($ResourceGroup.location -ne $MonitorResourceGroupRegion) { throw "The resource group $MonitorResourceGroup exists but its region $($ResourceGroup.location) does not match provided region $MonitorResourceGroupRegion" } # If the resource group exists and it's empty, we'll use the resource group even though there is no tag $Resources = Get-AzResource -ResourceGroupName $MonitorResourceGroup if ($Resources.Count -eq 0) { Set-AzResourceGroup -Name $MonitorResourceGroup -Tag @{'PureStorage.CBS.AVS' = $ProductVersion} } elseif (-not $ResourceGroup.Tags["PureStorage.CBS.AVS"]) { throw "The resource group $MonitorResourceGroup exists but not used by Pure Storage CBS AVS monitor. Please select another name for Pure Storage CBS AVS monitor" } } $DeploymentTemplatePath = Join-Path -Path $PSScriptRoot -ChildPath 'templates' -AdditionalChildPath 'Main.bicep' $DeploymentId = (New-Guid).ToString() $DeploymentParams = @{ "PureCloudBlockStoreEndpoint" = $PureCloudBlockStoreEndpoint; "PureCloudBlockStoreUsername" = $PureCloudBlockStoreCredential.UserName; "PureCloudBlockStorePassword" = $PureCloudBlockStoreCredential.Password; "AVSCloudName" = $AVSCloudName; "AVSResourceGroup" = $AVSResourceGroup; "VNetName" = $VNetName; "VNetResourceGroupName" = $VNetResourceGroup; "MonitorIntervalInMinute" = $MonitorIntervalInMinute "DeploymentId" = $DeploymentId } if ($VNetSubnetAddress) { $DeploymentParams["SubnetAddressRange"] = $VNetSubnetAddress } if ($VNetSubnetName) { $DeploymentParams["SubnetName"] = $VNetSubnetName } Write-Host "Deploying AVS monitoring infrastructure to Azure..." New-AzResourceGroupDeployment -Name "PCBSMonitorDeployment_$DeploymentId" -ResourceGroupName $MonitorResourceGroup -TemplateFile $DeploymentTemplatePath -TemplateParameterObject $DeploymentParams } <# .SYNOPSIS List the existing Pure Cloud Block Store in the Pure Storage CBS AVS monitor .DESCRIPTION List the existing Pure Cloud Block Store in the Pure Storage CBS AVS monitor .PARAMETER MonitorResourceGroup ResourceGroup to host monitor infrastructure components .EXAMPLE Get-PCBSAVSMonitorArray -MonitorResourceGroup myMonitor .NOTES Must be logged in to Azure (using Connect-AzAccount) before running this cmdlet #> function Get-PCBSAVSMonitorArray { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [String]$MonitorResourceGroup ) $ResourceGroup = Get-AzResourceGroup -Name $MonitorResourceGroup if (-not $ResourceGroup) { throw "Resource group $MonitorResourceGroupdoes not exist" } if (-not $ResourceGroup.Tags["PureStorage.CBS.AVS"]) { throw "Resouce group $MonitorResourceGroup specified does not host Pure Storage CBS AVS monitor" } $UserPrincipalName = (Get-AzContext).Account.Id $KeyVault = Get-AzKeyVault -ResourceGroupName $MonitorResourceGroup Set-AzKeyVaultAccessPolicy -VaultName $KeyVault.VaultName -UserPrincipalName $UserPrincipalName -PermissionsToSecrets set,delete,get,purge,list $Arrays = @() $Secrets = Get-AzKeyVaultSecret -VaultName $KeyVault.VaultName | where-object {$_.Name -like "*-$($KeyVault.VaultName)-username"} foreach ($Secret in $Secrets) { $ArrayName = ($Secret.name -Split "-$($KeyVault.VaultName)-username")[0] # If the string matches the format like "172-168-1-0", the array ip addressed was processed because secret name does not allow "." if ($ArrayName -match "^\d+-\d+-\d+-\d+$") { $ArrayName = $ArrayName.Replace("-", ".") } $Arrays += $ArrayName } return $Arrays } <# .SYNOPSIS Add a Pure Cloud Block Store to an existing Pure Storage CBS AVS monitor .DESCRIPTION Add a Pure Cloud Block Store to an existing Pure Storage CBS AVS monitor. If the Pure Block store already exists, it will be overwritten .PARAMETER MonitorResourceGroup ResourceGroup to host monitor infrastructure components .PARAMETER PureCloudBlockStoreEndpoint Pure Cloud Block Store endpoint address .PARAMETER PureCloudBlockStoreCredential Pure Cloud Block Store credential .EXAMPLE Add-PCBSAVSMonitorArray -MonitorResourceGroup myMonitorGroup -PureCloudBlockStoreEndpoint myArray -PureCloudBlockStoreCredential (Get-Credential) .NOTES Must be logged in to Azure (using Connect-AzAccount) before running this cmdlet #> function Add-PCBSAVSMonitorArray { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [String]$MonitorResourceGroup, [Parameter(Mandatory=$true)] [String]$PureCloudBlockStoreEndpoint, [Parameter(Mandatory=$true)] [pscredential]$PureCloudBlockStoreCredential ) $ResourceGroup = Get-AzResourceGroup -Name $MonitorResourceGroup if (-not $ResourceGroup) { throw "Resource group $MonitorResourceGroup does not exist" } if (-not $ResourceGroup.Tags["PureStorage.CBS.AVS"]) { throw "Resouce group $MonitorResourceGroup specified does not host Pure Storage CBS AVS monitor" } $PureCloudBlockStoreEndpointOrigin = $PureCloudBlockStoreEndpoint Write-Host "Adding Pure Cloud Block Store $PureCloudBlockStoreEndpointOrigin to monitor resource group $MonitorResourceGroup..." $UserPrincipalName = (Get-AzContext).Account.Id $KeyVault = Get-AzKeyVault -ResourceGroupName $MonitorResourceGroup Set-AzKeyVaultAccessPolicy -VaultName $KeyVault.VaultName -UserPrincipalName $UserPrincipalName -PermissionsToSecrets set,delete,get,purge,list # Make sure the credential works before adding to the monitor $Array = Connect-Pfa2array -Endpoint $PureCloudBlockStoreEndpoint -Credential $PureCloudBlockStoreCredential -IgnoreCertificateError -ErrorAction Stop if (-not $Array) { throw "Failed to connect to the Pure Cloud Block Store. Please check the endpoint and credential of the Pure Cloud Block Store." } if ($PureCloudBlockStoreEndpoint -match "^\d+.\d+.\d+.\d+$") { $PureCloudBlockStoreEndpoint = $PureCloudBlockStoreEndpoint.Replace(".", "-") } $Secret = Get-AzKeyVaultSecret -VaultName $KeyVault.VaultName | where-object {$_.Name -eq "$($PureCloudBlockStoreEndpoint)-$($KeyVault.VaultName)-username"} if ($Secret) { Write-Host "Overriding the existing credential for Pure Cloud Block Store $PureCloudBlockStoreEndpointOrigin..." } Set-AzKeyVaultSecret -VaultName $KeyVault.VaultName -Name "$($PureCloudBlockStoreEndpoint)-$($KeyVault.VaultName)-username" -SecretValue (ConvertTo-SecureString -String $PureCloudBlockStoreCredential.UserName -AsPlainText -Force) Set-AzKeyVaultSecret -VaultName $KeyVault.VaultName -Name "$($PureCloudBlockStoreEndpoint)-$($KeyVault.VaultName)-password" -SecretValue $PureCloudBlockStoreCredential.Password Write-Host "The Pure Cloud Block Store $PureCloudBlockStoreEndpointOrigin is successfully added to monitor resource group $MonitorResourceGroup." } <# .SYNOPSIS Remove an existing Pure Cloud Block Store from a Pure Storage CBS AVS monitor .DESCRIPTION Remove an existing Pure Cloud Block Store from a Pure Storage CBS AVS monitor. If the Pure Block store already exists, it will be overwritten .PARAMETER MonitorResourceGroup ResourceGroup to host monitor infrastructure components .PARAMETER PureCloudBlockStoreEndpoint Pure Cloud Block Store endpoint address .EXAMPLE Remove-PCBSAVSMonitorArray -MonitorResourceGroup myMonitorGroup -PureCloudBlockStoreEndpoint myArray .NOTES Must be logged in to Azure (using Connect-AzAccount) before running this cmdlet #> function Remove-PCBSAVSMonitorArray { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [String]$MonitorResourceGroup, [Parameter(Mandatory=$true)] [String]$PureCloudBlockStoreEndpoint ) $ResourceGroup = Get-AzResourceGroup -Name $MonitorResourceGroup if (-not $ResourceGroup) { throw "Resource group $MonitorResourceGroup does not exist" } if (-not $ResourceGroup.Tags["PureStorage.CBS.AVS"]) { throw "Resouce group $MonitorResourceGroup specified does not host Pure Storage CBS AVS monitor" } $PureCloudBlockStoreEndpointOrigin = $PureCloudBlockStoreEndpoint $KeyVault = Get-AzKeyVault -ResourceGroupName $MonitorResourceGroup Write-Host "Removing Pure Cloud Block Store $PureCloudBlockStoreEndpointOrigin from monitor resource group $MonitorResourceGroup..." $UserPrincipalName = (Get-AzContext).Account.Id Set-AzKeyVaultAccessPolicy -VaultName $KeyVault.VaultName -UserPrincipalName $UserPrincipalName -PermissionsToSecrets set,delete,get,purge,list if ($PureCloudBlockStoreEndpoint -match "^\d+.\d+.\d+.\d+$") { $PureCloudBlockStoreEndpoint = $PureCloudBlockStoreEndpoint.Replace(".", "-") } $Secret = Get-AzKeyVaultSecret -VaultName $KeyVault.VaultName | where-object {$_.Name -eq "$($PureCloudBlockStoreEndpoint)-$($KeyVault.VaultName)-username"} if (-not $Secret) { throw "Pure Cloud Block Store $PureCloudBlockStoreEndpointOrigin does not exist in the monitor resource group $MonitorResourceGroup" } Remove-AzKeyVaultSecret -VaultName $KeyVault.VaultName -Name "$($PureCloudBlockStoreEndpoint)-$($KeyVault.VaultName)-username" -Force Remove-AzKeyVaultSecret -VaultName $KeyVault.VaultName -Name "$($PureCloudBlockStoreEndpoint)-$($KeyVault.VaultName)-password" -Force # Purge secret Purge-AzureSecretWithRetry -KeyVaultName $KeyVault.VaultName -SecretName "$($PureCloudBlockStoreEndpoint)-$($KeyVault.VaultName)-username" Purge-AzureSecretWithRetry -KeyVaultName $KeyVault.VaultName -SecretName "$($PureCloudBlockStoreEndpoint)-$($KeyVault.VaultName)-password" Write-Host "The Pure Cloud Block Store $PureCloudBlockStoreEndpointOrigin is successfully removed." } Export-ModuleMember -Function Build-PCBSCluster Export-ModuleMember -Function New-PCBSVmfsDatastore Export-ModuleMember -Function Restore-PCBSVmfsDatastore Export-ModuleMember -Function Remove-PCBSVmfsDatastore Export-ModuleMember -Function Set-PCBSVmfsCapacity Export-ModuleMember -Function Deploy-PCBSAVSMonitor Export-ModuleMember -Function Remove-PCBSAVSMonitor Export-ModuleMember -Function Add-PCBSAVSMonitorArray Export-ModuleMember -Function Remove-PCBSAVSMonitorArray Export-ModuleMember -Function Get-PCBSAVSMonitorArray Export-ModuleMember -Function New-PCBSVvolDataStore Export-ModuleMember -Function Remove-PCBSVvolDataStore Export-ModuleMember -Function New-PCBSVASAProvider Export-ModuleMember -Function Update-PCBSVASAProvider Export-ModuleMember -Function New-PCBSStoragePolicy Export-ModuleMember -Function Remove-PCBSStoragePolicy Export-ModuleMember -Function Start-PCBSFailover Export-ModuleMember -Function Stop-PCBSFailoverTest Export-ModuleMember -Function Start-PCBSFailoverCleanup Export-ModuleMember -Function Start-PCBSFailoverReverse Export-ModuleMember -Function Sync-PCBSReplicationGroup # SIG # Begin signature block # MIIn+AYJKoZIhvcNAQcCoIIn6TCCJ+UCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUBNIidRcbZxLqGI4yP3pqFp2v # gLmggiEoMIIFjTCCBHWgAwIBAgIQDpsYjvnQLefv21DiCEAYWjANBgkqhkiG9w0B # AQwFADBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYD # VQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVk # IElEIFJvb3QgQ0EwHhcNMjIwODAxMDAwMDAwWhcNMzExMTA5MjM1OTU5WjBiMQsw # CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRk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