PureStorage.CBS.AVS.VMFS.ps1

. $PSScriptRoot/PureStorage.CommonUtil.ps1
function Get-PfaVolumeFromVMFSDataStore {
    Param(
        [Parameter(mandatory=$true)]
        $FlashArray,

        [Parameter(mandatory=$true)]
        $DataStore
    )
    $Lun = $Datastore.ExtensionData.Info.Vmfs.Extent.DiskName |select-object -unique
    if ($Lun -like 'naa.624a9370*')
    {
        $VolSerial = ($lun.ToUpper()).substring(12)
        $PureVol = Get-Pfa2Volume -Array $FlashArray -Filter "Serial='$VolSerial'"
    }
    else
    {
        throw "This VMFS is not hosted on Pure Cloud Block Store."
    }

    return $PureVol
}

function Remove-PfaVmfsDatastore {
    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true)]
        $Cluster,

        [Parameter(Mandatory=$true)]
        $Datastore,

        [Parameter(ValueFromPipeline=$True)]
        $FlashArray,

        [Parameter(Mandatory=$false)]
        [String]$AVSCloudName,

        [Parameter(Mandatory=$false)]
        [String]$AVSResourceGroup,

        [Parameter(Mandatory=$false)]
        [int]$TimeoutInMinutes = 10
    )


    $PureVol = Get-PfaVolumeFromVMFSDataStore -FlashArray $FlashArray -Datastore $Datastore

    Write-Progress -Activity "Dismounting datastore" -Status "25% Complete:" -PercentComplete 25
    $params = @{
        ClusterName = $Cluster.Name;
        DatastoreName = $Datastore.Name
    }
    # Question: We just do unmount/detach at VMWare side. Do we need to run Remove-Datastore to clean the datastore?
    Invoke-RunScript -RunCommandName "Dismount-VmfsDatastore" -RunCommandModule "Microsoft.AVS.VMFS" -Parameters $params `
        -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes

    Write-Progress -Activity "Removing volume" -Status "50% Complete:" -PercentComplete 50
    # Remove volume from array hostgroup if available
    $FaHg = Get-PfaHostGroupfromVcCluster -Flasharray $Flasharray -Cluster $Cluster
    $HgConnection = Get-Pfa2Connection -Array $FlashArray -VolumeNames $PureVol.Name -HostGroupNames $FaHg.Name -ErrorAction SilentlyContinue
    if ($HgConnection) {
        Write-Host "Removing volume $($PureVol.Name) from host group $($FaHg.Name)..."
        Remove-Pfa2Connection -Array $FlashArray -VolumeNames $PureVol.Name -HostGroupNames $FaHg.Name
    }

    # Destroy volume if there is no host/hg connections for the volume
    $Connections = Get-Pfa2Connection -Array $FlashArray -VolumeNames $PureVol.Name
    if (-not $Connections) {
        Write-Host "Destroying volume $($PureVol.Name)..."
        Remove-Pfa2Volume -Array $FlashArray -Name $PureVol.Name -Confirm:$false
    }

    Write-Progress -Activity "Rescanning storage" -Status "75% Complete:" -PercentComplete 75
    $params = @{
        ClusterName = $Cluster.Name;
    }
    Invoke-RunScript -RunCommandName "Sync-ClusterVMHostStorage" -RunCommandModule "Microsoft.AVS.VMFS" -Parameters $params `
        -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes
}

function New-VolumeFromSnaspshot {
    [CmdletBinding()]
    Param(
        [Parameter(ValueFromPipeline=$True)]
        $FlashArray,

        [Parameter(Mandatory=$true)]
        [String]$SnapshotName
    )

    $VolumeSnapshot = Get-Pfa2VolumeSnapshot -Array $FlashArray -Name $SnapshotName -ErrorAction Ignore
    if (-not $VolumeSnapshot) {
        throw "Could not find snapshot '$SnapshotName'."
    }

    if ($VolumeSnapshot.Source.Name) {
        # If the original volume still exist
        $VolumeName = $volumeSnapshot.Source.Name + "-"+ (Get-Random -Minimum 10000000 -Maximum 99999999)
    } else {
        # If the original volume is missing, get volume name from snapshot name
        # Get Alphanumeric string from snapshot
        $FilteredSnapshotName = $SnapshotName -replace "[^a-zA-Z0-9]"
        $VolumeName = $FilteredSnapshotName + "-volcopy-"+ (Get-Random -Minimum 10000000 -Maximum 99999999)
    }
    $newVol = New-PfaVolumeByPrefix -FlashArray $FlashArray -Name $VolumeName -SourceName $SnapshotName

    return $newVol
}

function Restore-PfaVmfsFromProtectionGroupSnapshot {
    <#
    .SYNOPSIS
      Mounts a copy of a VMFS datastore to a VMware cluster from a Pure Storage Block Store protection groupsnapshot.
    .DESCRIPTION
      Takes in a snapshot name, the corresponding Pure Storage Block Store, and a cluster. The VMFS copy will be resignatured and mounted.
    .INPUTS
      Pure Cloud Block Store connection, a VolumeSnapshot, and a cluster.
    .OUTPUTS
      Returns the new datastore.
    #>

    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true,ValueFromPipeline=$True)]
        $Cluster,

        [Parameter(ValueFromPipeline=$True)]
        $FlashArray,

        [Parameter(Mandatory=$true)]
        [String]$ProtectionGroupSnapshotName,

        [Parameter(Mandatory=$false)]
        [String]$AVSCloudName,


        [Parameter(Mandatory=$false)]
        [String]$AVSResourceGroup,

        [Parameter(Mandatory=$false)]
        [int]$TimeoutInMinutes = 10
    )

    $NewDatastore = @()
    # Verify snapshot exist
    $ProtectionGroupSnapshot = Get-Pfa2ProtectionGroupSnapshot -Array $FlashArray -Name $ProtectionGroupSnapshotName -ErrorAction Ignore
    if (-not $ProtectionGroupSnapshot) {
        throw "Protection group snapshot $ProtectionGroupSnapshotName does not exist."
    }
    $VolumeSnapshots = Get-Pfa2VolumeSnapshot -Array $FlashArray -Filter "Name='$($ProtectionGroupSnapshotName).*'"
    foreach ($VolumeSnapshot in $VolumeSnapshots) {
        try {
            $NewDatastore += Restore-PfaVmfsFromVolumeSnapshot -FlashArray $FlashArray -Cluster $Cluster -VolumeSnapshotName $VolumeSnapshot.Name `
                                -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes
        } catch {
            Write-Error "Failed to restore datastore from protection group $ProtectionGroupSnapshotName using volume snapshot $($VolumeSnapshot.Name)"
            Write-Error $_.Exception.Message
        }
    }

    if (-not $NewDatastore) {
        throw "No datastore was restored from protection group snapshot $ProtectionGroupSnapshotName."
    }

    return $NewDatastore
}

function Restore-PfaVmfsFromPod {
    <#
    .SYNOPSIS
      Mounts a copy of a VMFS datastore to a VMware cluster from a Pure Storage Block Store protection groupsnapshot.
    .DESCRIPTION
      Takes in a snapshot name, the corresponding Pure Storage Block Store, and a cluster. The VMFS copy will be resignatured and mounted.
    .INPUTS
      Pure Cloud Block Store connection, a VolumeSnapshot, and a cluster.
    .OUTPUTS
      Returns the new datastore.
    #>

    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true,ValueFromPipeline=$True)]
        $Cluster,

        [Parameter(ValueFromPipeline=$True)]
        $FlashArray,

        [Parameter(Mandatory=$true)]
        [String]$PodName,

        [Parameter(Mandatory=$false)]
        [String]$AVSCloudName,


        [Parameter(Mandatory=$false)]
        [String]$AVSResourceGroup,

        [Parameter(Mandatory=$false)]
        [int]$TimeoutInMinutes = 10
    )

    $NewDatastore = @()
    # Verify the pod exists
    $Pod = Get-Pfa2Pod -Array $FlashArray -Name $PodName -ErrorAction Ignore
    if (-not $Pod) {
        throw "Pod $PodName does not exist."
    }
    $Volumes = Get-Pfa2Volume -Array $FlashArray -Filter "Name='$($PodName)::*'"
    foreach ($Volume in $Volumes) {
        try {
            $NewDatastore += Restore-PfaVmfsFromVolume -FlashArray $FlashArray -Cluster $Cluster -VolumeName $Volume.Name `
                                -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes
        } catch {
            Write-Error "Failed to restore datastore from pod $PodName using volume $($Volume.Name)"
            Write-Error $_.Exception.Message
        }
    }

    if (-not $NewDatastore) {
        throw "No datastore was restored from pod $PodName."
    }

    return $NewDatastore
}

function Restore-PfaVmfsFromVolumeSnapshot {
    <#
    .SYNOPSIS
      Mounts a copy of a VMFS datastore to a VMware cluster from a Pure Storage Block Store snapshot.
    .DESCRIPTION
      Takes in a snapshot name, the corresponding Pure Storage Block Store, and a cluster. The VMFS copy will be resignatured and mounted.
    .INPUTS
      Pure Cloud Block Store connection, a VolumeSnapshot, and a cluster.
    .OUTPUTS
      Returns the new datastore.
    #>

    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true,ValueFromPipeline=$True)]
        $Cluster,

        [Parameter(ValueFromPipeline=$True)]
        $FlashArray,

        [Parameter(Mandatory=$true)]
        [String]$VolumeSnapshotName,

        [Parameter(Mandatory=$false)]
        [String]$DatastoreName,

        [Parameter(Mandatory=$false)]
        [String]$AVSCloudName,

        [Parameter(Mandatory=$false)]
        [String]$AVSResourceGroup,

        [Parameter(Mandatory=$false)]
        [int]$TimeoutInMinutes = 10
    )

    $hostGroup = Get-PfaHostGroupfromVcCluster -cluster $cluster -FlashArray $FlashArray

    # Create volume from the volume snapshot
    $VolumesForRestore = New-VolumeFromSnaspshot -FlashArray $FlashArray -SnapshotName $VolumeSnapshotName

    try {
        $NewDatastore = Restore-PfaVmfsFromVolume -FlashArray $FlashArray -Cluster $Cluster -VolumeName $VolumesForRestore.Name ` -DatastoreName $DatastoreName `
                            -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes
    } catch {
        # Clean up created volume if restore failed
        Write-Host "Failed to restore datastore from the volume snapshot $($VolumeSnapshotName)..."
        Write-Host "Cleaning up the volume $($VolumesForRestore.name) created from $($VolumeSnapshotName)..."
        Remove-Pfa2Connection -Array $FlashArray -HostgroupNames $hostGroup.name -VolumeNames $VolumesForRestore.name -ErrorAction SilentlyContinue
        Remove-Pfa2Volume -Array $FlashArray -Name $VolumesForRestore.name -Confirm:$false -ErrorAction SilentlyContinue
        Remove-Pfa2Volume -Array $FlashArray -Name $VolumesForRestore.name -Eradicate -Confirm:$false -ErrorAction SilentlyContinue
        throw
    }


    return $NewDatastore
}

function Restore-PfaVmfsFromVolume {
    <#
    .SYNOPSIS
      Mounts a copy of a VMFS datastore to a VMware cluster from a Pure Storage Block Store volume.
    .DESCRIPTION
      Takes in a snapshot name, the corresponding Pure Storage Block Store, and a cluster. The VMFS copy will be resignatured and mounted.
    .INPUTS
      Pure Cloud Block Store connection, a VolumeSnapshot, and a cluster.
    .OUTPUTS
      Returns the new datastore.
    #>

    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true,ValueFromPipeline=$True)]
        $Cluster,

        [Parameter(ValueFromPipeline=$True)]
        $FlashArray,

        [Parameter(Mandatory=$true)]
        [String]$VolumeName,

        [Parameter(Mandatory=$false)]
        [String]$DatastoreName,

        [Parameter(Mandatory=$false)]
        [String]$AVSCloudName,

        [Parameter(Mandatory=$false)]
        [String]$AVSResourceGroup,

        [Parameter(Mandatory=$false)]
        [int]$TimeoutInMinutes = 10
    )

    $Volume = Get-Pfa2Volume -Array $FlashArray -Name $VolumeName -ErrorAction Ignore
    if (-not $Volume) {
        throw "Volume $VolumeName does not exist."
    }

    $newNAA =  "naa.624a9370" + $Volume.serial.toLower()
    $Datastore = Get-Datastore -ErrorAction stop | Where-Object {$_.ExtensionData.Info.Vmfs.Extent.DiskName -eq $newNAA}
    if ($Datastore) {
        throw "Datastore $($Datastore.Name) is using the volume $VolumeName. Please use a different volume. You can manually create a new volume copy from volume $VolumeName and restore the datastore from the new volume."
    }

    $hostGroup = Get-PfaHostGroupfromVcCluster -cluster $cluster -FlashArray $FlashArray

    Write-Progress -Activity "Connecting volume" -Status "25% Complete:" -PercentComplete 25
    Write-Host "Connecting volume $($Volume.Name) to host group $($hostGroup.Name)..."
    $Connection = Get-Pfa2Connection -Array $FlashArray -VolumeName $($Volume.Name) -HostGroupName $hostGroup.name -ErrorAction Ignore

    if ($Connection) {
        Write-Host "Volume $($Volume.Name) is already connected to host group $($hostGroup.Name). Using the existing connection..."
    } else {
        New-Pfa2Connection -Array $FlashArray -VolumeName $($Volume.Name) -HostGroupName $hostGroup.name | Out-Null
    }

    $esxi = $cluster | Get-VMHost| where-object {($_.ConnectionState -eq 'Connected')} | Select-Object -last 1
    Write-Progress -Activity "Rescanning storage" -Status "50% Complete:" -PercentComplete 50
    Write-Host "Rescanning HBA..."
    $params = @{
        VMHostName = $esxi.Name;
    }
    Invoke-RunScript -RunCommandName "Sync-VMHostStorage" -RunCommandModule "Microsoft.AVS.VMFS" -Parameters $params `
        -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes

    Write-Progress -Activity "Restoring volume" -Status "75% Complete:" -PercentComplete 75
    $params = @{
            ClusterName = $Cluster.Name;
            DeviceNaaId = $newNAA
            DatastoreName = $DatastoreName
    }

    Write-Host "Restoring VMFS Datastore $($DatastoreName) from volume $($Volume.Name)..."

    Invoke-RunScript -RunCommandName  "Restore-VmfsVolume" -RunCommandModule "Microsoft.AVS.VMFS" -Parameters $params `
        -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes

    $NewDatastore = Get-Datastore -ErrorAction stop | Where-Object {$_.ExtensionData.Info.Vmfs.Extent.DiskName -eq $newNAA}

    if (-not $NewDatastore) {
        throw "Failed to restore datastore from volume $($Volume.Name)."
    }

    return $NewDatastore
}

function New-PfaVolumeByPrefix {
    Param (
        [Parameter(Mandatory=$true)]
        [string] $Name,


        [ValidateRange(1GB,64TB)] # 1 GB to 64 TB
        [Parameter(Mandatory=$false)]
        [UInt64] $Size,

        [Parameter(Mandatory=$True)]
        $Flasharray,

        [Parameter(Mandatory=$false)]
        [string] $SourceName,

        [Parameter(Mandatory=$false)]
        [string] $PodName,

        [Parameter(Mandatory=$false)]
        [switch] $NoDefaultProtection
    )
    # Create a volume with the specified name. If the name already exists in the array, use it as a prefix
    $maxTries = 20
    $count = 0
    $existingVolume = $null
    # Get base volume name from source volume reflected in pure snapshot object
    # Source volume name possibility:
    # regular volume snapshot: testvol
    # pod volume snapshot: testpod::testacvol
    # array replicated volume snapshot: msconnect-ff-flasharray-1:testvol
    $BaseName = $Name.split(":")[-1]

    # Truncate the name if it is too large
    if ($BaseName.Length -gt 53) {
        $BaseName = $BaseName.Substring(0,53).TrimEnd("-")
    }

    # If a PodName is specified, verify the pod exists
    if ($PodName) {
        $pod = Get-Pfa2Pod -Array $FlashArray -Name $PodName -ErrorAction Ignore
        if (-not $pod) {
            throw "Pod '$PodName' does not exist."
        }
        $BaseName = "$PodName::$BaseName"
    }
    $volName = $BaseName
    $existingVolume = Get-Pfa2Volume -Array $Flasharray  -Name $volName -ErrorAction SilentlyContinue
    while ($existingVolume -and $count -lt $maxTries) {
        $count = $count + 1
        $volName = "$BaseName-$count"
        $existingVolume = Get-Pfa2Volume -Array $Flasharray  -Name $volName -ErrorAction SilentlyContinue
    }
    if ($existingVolume) {
        # We exhausted the max number of tries
        throw "Could note create a volume based on the Name '$Name', please select a unique volume name"
    }
    Write-Host "Creating volume $volName..."
    $UseDefaultProtection = -not $NoDefaultProtection.IsPresent
    if ($SourceName) {
        # Create a volume from a snapshot
        $vol = New-Pfa2Volume -Array $FlashArray -Name $volName -SourceName $SourceName -WithDefaultProtection $UseDefaultProtection -ErrorAction Stop
    }
    else {
        # Create a fresh volume
        $vol = New-Pfa2Volume -Array $FlashArray -Name $volName -Provisioned $Size -WithDefaultProtection $UseDefaultProtection -ErrorAction Stop
    }
    return $vol

}
function New-PfaVmfs {
    <#
    .SYNOPSIS
      Create a new VMFS on a new Pure Cloud Block Store volume
    .DESCRIPTION
      Creates a new VMFS on Pure Cloud Block Store and presents it to a cluster.
    .INPUTS
      FlashArray connection, a vCenter cluster, a volume size, and name.
    .OUTPUTS
      Returns a VMFS object.
    #>


    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true)]
        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster]$Cluster,

        [Parameter(Mandatory=$True)]
        $Flasharray,

        [Parameter(Mandatory=$true)]
        [string]$Name,

        [Parameter(Mandatory=$true)]
        $vCenterServer,

        [ValidateRange(1GB,64TB)] # 1 GB to 64 TB
        [Parameter(Mandatory=$true)]
        [UInt64]$Size,

        [Parameter(Mandatory=$false)]
        [string] $PodName,

        [Parameter(Mandatory=$false)]
        [switch] $NoDefaultProtection,

        [Parameter(Mandatory=$false)]
        [String]$AVSCloudName,

        [Parameter(Mandatory=$false)]
        [String]$AVSResourceGroup,

        [Parameter(Mandatory=$false)]
        [int]$TimeoutInMinutes = 10
    )
    Write-Progress -Activity "Creating volume" -Status "25% Complete:" -PercentComplete 25
    $datastore = Get-Datastore -Server $vCenterServer  -Name $Name -ErrorAction Ignore
    if ($Datastore) {
        $Vmhost = $Cluster | Get-VMHost
        $HostDatastoreInfo = $Datastore.ExtensionData.Host
        $HasNotConnectedHost = $HostDatastoreInfo.MountInfo| Where-Object {$_.Accessible -ne $True -or $_.Mounted -ne $True}
        if ($HostDatastoreInfo.Count -ne $Vmhost.Count -or $HasNotConnectedHost) {
            Write-Warning "Datastore '$Name' already exists but not connected to all hosts in the cluster. Trying to connect the datastore to all hosts in the cluster..."
            $params = @{
                ClusterName = $Cluster.Name;
            }
            Invoke-RunScript -RunCommandName "Sync-ClusterVMHostStorage" -RunCommandModule "Microsoft.AVS.VMFS" -Parameters $params `
        -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes
            Write-Host "Rescanning finished. Datastore '$Name' is now connected to all hosts in the cluster. If not, please check if hosts are in a good state and use the diagnostic tool in this module to test network connection."
            return
        } else {
            throw "Cannot create the datastore. Datastore '$Name' already exists!"
        }
    }
    $hostGroup = Get-PfaHostGroupfromVcCluster -cluster $cluster -FlashArray $FlashArray -ErrorAction Stop

    $newVol = New-PfaVolumeByPrefix -FlashArray $FlashArray -Name $Name -Size $Size -NoDefaultProtection:$NoDefaultProtection.IsPresent -PodName $PodName -ErrorAction Stop
    New-Pfa2Connection -Array $FlashArray -HostGroupNames $hostGroup.Name -VolumeNames $newVol.Name | Out-Null
    Write-Progress -Activity "Rescanning storage" -Status "50% Complete:" -PercentComplete 50
    $newNAA = "naa.624a9370" + $newVol.serial.toLower()
    Write-Host "Rescanning storage..."
    $params = @{
        ClusterName = $Cluster.Name;
    }
    Invoke-RunScript -RunCommandName "Sync-ClusterVMHostStorage" -RunCommandModule "Microsoft.AVS.VMFS" -Parameters $params `
        -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes

    Write-Debug -Message "NAA for datastore $Name is $newNAA"
    Write-Progress -Activity "Creating datastore" -Status "75% Complete:" -PercentComplete 75
    try {
        $params = @{
            ClusterName = $Cluster.Name;
            DatastoreName = $Name;
            DeviceNaaId = $newNAA;
            Size = $Size
        }
        Invoke-RunScript -RunCommandName  "New-VmfsDatastore" -RunCommandModule "Microsoft.AVS.VMFS" -Parameters $params `
            -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes
    }
    catch {
        # Cleanup
        Remove-Pfa2Connection -Array $Flasharray -HostGroupNames $hostGroup.Name -VolumeNames $newVol.Name
        Remove-Pfa2Volume -Array $Flasharray -Name $newVol.Name -Confirm:$false | Out-Null
        Remove-Pfa2Volume -Array $Flasharray -Name $newVol.Name -Eradicate -Confirm:$false| Out-Null
        throw
    }
}


function Set-PfaVmfsCapacity {
    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true)]
        $Cluster,

        [Parameter(Position=0,ValueFromPipeline=$True)]
        $Flasharray,

        [Parameter(Position=1,mandatory=$true,ValueFromPipeline=$True)]
        $Datastore,

        [Parameter(mandatory=$false)]
        [UInt64]$SizeInByte,

        [Parameter(Mandatory=$false)]
        [String]$AVSCloudName,

        [Parameter(Mandatory=$false)]
        [String]$AVSResourceGroup,

        [Parameter(Mandatory=$false)]
        [int]$TimeoutInMinutes = 10
    )

    Write-Progress -Activity "Resizing volume" -Status "25% Complete:" -PercentComplete 25


    $pureVol = Get-PfaVolumeFromVMFSDataStore -Flasharray $FlashArray -Datastore $Datastore
    $Size = Get-FriendlySize -SizeInByte $SizeInByte
    $CurrentSize = Get-FriendlySize -SizeInByte $pureVol.Provisioned
    if ($SizeInByte -lt $pureVol.Provisioned)
    {
        throw "The new specified size '$Size' is not larger than the current size '$CurrentSize'. ESXi does not permit VMFS volumes to be shrunk--please specify a size larger than the existing."
    }
    elseif ($SizeInByte -eq $pureVol.Provisioned) {
        # Resize operation might not have been completed in the past, try again

        # Check if the datastore was already resizes
        $CapacityDiff = ($SizeInByte - $Datastore.CapacityGB * 1GB) / 1GB
        if ($CapacityDiff -lt 0) {
            throw "Cannot resize datastore to lower capacity than $($Datastore.CapacityGB)GB"
        }
        if ($CapacityDiff -le 1) {
            # Difference is negligible. Might be due to VMWare reserved capacity
            Write-Warning "Datastore '$Datastore.Name' is already set to requested capacity."
            return
        }
        Write-Warning "Volume $($pureVol.Name) is already set at the requested capacity. Refreshing datastore object on AVS.."
    }
    else {
        Write-Host "Increasing the size of the volume $($pureVol.Name) to $Size on Pure Cloud Block Store..."

        # FlashArray only accept byte that is multiple of 512. If not, we round up by 512
        $SizeInByte = [math]::ceiling($SizeInByte/512) * 512

        Update-Pfa2Volume -Array $FlashArray -Name $pureVol.Name -Provisioned $SizeInByte | Out-Null
    }

    Write-Progress -Activity "Resizing datastore" -Status "50% Complete:" -PercentComplete 50
    $params = @{
        ClusterName = $Cluster.Name;
        DeviceNaaId = $Datastore.ExtensionData.Info.Vmfs.Extent.DiskName
    }
    Invoke-RunScript -RunCommandName "Resize-VmfsVolume" -RunCommandModule "Microsoft.AVS.VMFS" -Parameters $params `
        -AVSCloudName $AVSCloudName -AVSResourceGroup $AVSResourceGroup -TimeoutInMinutes $TimeoutInMinutes

}

function Get-FriendlySize {
    [CmdletBinding()]
    Param(
        [Parameter(mandatory=$false)]
        [UInt64]$SizeInByte
    )

    $SizeInGB = $SizeInByte / 1024 / 1024 / 1024

    if ($SizeInGB -ge 1024) {
        $SizeInTB = $SizeInGB/1024
        return "$([math]::Round($SizeInTB, 2)) TB"
    } else {
        return "$([math]::Round($SizeInGB, 2)) GB"
    }
}


# SIG # Begin signature block
# MIIugwYJKoZIhvcNAQcCoIIudDCCLnACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA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