Skip to content

[NetAppFiles] Bump to api-version 2021-06 #15983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/NetAppFiles/NetAppFiles.Test/NetAppFiles.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.13.0" />
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.14.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.6.0" />
</ItemGroup>

Expand Down
14 changes: 11 additions & 3 deletions src/NetAppFiles/NetAppFiles.Test/ScenarioTests/AccountTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ function Test-AccountActiveDirectory
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
$groupTagName = "owner"
$groupTagValue = "b-aubald"
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{$groupTagName = $groupTagValue}

# check multiple ADs are captured
# currently this is not permitted and throws a message
Expand Down Expand Up @@ -121,6 +123,7 @@ Test Account CRUD operations
#>
function Test-AccountCrud
{
#$resourceGroup = "somename2"
$resourceGroup = Get-ResourceGroupName
$accName1 = Get-ResourceName
$accName2 = Get-ResourceName
Expand All @@ -130,8 +133,10 @@ function Test-AccountCrud
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

#New-AzResourceGroup -Name $resourceGroup -Tags @{Owner = 'b-aubald'} -Location $resourceLocation

# create and check account 1
$newTagName = "tag1"
$newTagValue = "tagValue1"
Expand Down Expand Up @@ -197,7 +202,10 @@ function Test-AccountPipelines
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
$groupTagName = "owner"
$groupTagValue = "b-aubald"
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tag @{$groupTagName = $groupTagValue}


New-AnfAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $accName1 | Remove-AnfAccount

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Test-ActiveDirectoryCrud
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# try creating an Account -
$newTagName = "tag1"
Expand Down Expand Up @@ -109,7 +109,7 @@ function Test-ActiveDirectoryPipelines
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

New-AnfAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $accName1
$sPass = ConvertTo-SecureString $adPassword -AsPlainText -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Test-BackupPolicyCrud
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $backupLocation
New-AzResourceGroup -Name $resourceGroup -Location $backupLocation -Tags @{Owner = 'b-aubald'}

# try creating an Account -
$newTagName = "tag1"
Expand Down Expand Up @@ -141,7 +141,7 @@ function Test-BackupPolicyPipelines
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $backupLocation
New-AzResourceGroup -Name $resourceGroup -Location $backupLocation -Tags @{Owner = 'b-aubald'}

New-AnfAccount -ResourceGroupName $resourceGroup -Location $backupLocation -Name $accName1
$newTagName = "tag1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function Test-BackupCrud
Start-Sleep -Seconds 10.0
$i++
}
until ($sourceVolume.ProvisioningState -eq "Succeeded" -or $i -eq 3);
until ($sourceVolume.ProvisioningState -eq "Succeeded" -or $i -eq 3);
}

function SleepDuringRecord ($seconds = 30.0)
Expand All @@ -95,7 +95,7 @@ function Test-BackupCrud
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $backupVNetLocation
New-AzResourceGroup -Name $resourceGroup -Location $backupVNetLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $backupVNetLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
Expand Down Expand Up @@ -268,7 +268,7 @@ function Test-BackupPipelines
$newTagValue = "psBackupTagValue1"

# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $backupVNetLocation
New-AzResourceGroup -Name $resourceGroup -Location $backupVNetLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $backupVNetLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
Expand Down Expand Up @@ -433,7 +433,7 @@ function Test-VolumeBackupStatus
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $backupVNetLocation
New-AzResourceGroup -Name $resourceGroup -Location $backupVNetLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $backupVNetLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
Expand Down
4 changes: 2 additions & 2 deletions src/NetAppFiles/NetAppFiles.Test/ScenarioTests/PoolTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function Test-PoolCrud
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create account
$retrievedAcc = New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName
Expand Down Expand Up @@ -126,7 +126,7 @@ function Test-PoolPipelines
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create pool by piping from account
New-AnfAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $accName | New-AnfPool -Name $poolName1 -PoolSize $poolSize -ServiceLevel $serviceLevel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function Test-SnapshotPolicyCrud
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# try creating an Account -
$newTagName = "tag1"
Expand Down Expand Up @@ -170,7 +170,7 @@ function Test-SnapshotPolicyPipelines
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

New-AnfAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $accName1
# try creating an Account -
Expand Down
14 changes: 7 additions & 7 deletions src/NetAppFiles/NetAppFiles.Test/ScenarioTests/SnapshotTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ function Test-SnapshotCrud
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
$delegation = New-AzDelegation -Name "netAppVolumes" -ServiceName "Microsoft.Netapp/volumes"
Add-AzVirtualNetworkSubnetConfig -Name $subnetName -VirtualNetwork $virtualNetwork -AddressPrefix "10.0.1.0/24" -Delegation $delegation | Set-AzVirtualNetwork

# create the resource group
New-AzResourceGroup -Name $resourceGroupName -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroupName -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create account, pool and volume
$retrievedAcc = New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName
Expand Down Expand Up @@ -133,7 +133,7 @@ function Test-SnapshotPipelines
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
Expand Down Expand Up @@ -197,15 +197,15 @@ function Test-CreateVolumeFromSnapshot
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
$delegation = New-AzDelegation -Name "netAppVolumes" -ServiceName "Microsoft.Netapp/volumes"
Add-AzVirtualNetworkSubnetConfig -Name $subnetName -VirtualNetwork $virtualNetwork -AddressPrefix "10.0.1.0/24" -Delegation $delegation | Set-AzVirtualNetwork

# create the resource group
New-AzResourceGroup -Name $resourceGroupName -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroupName -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create account, pool and volume
$retrievedAcc = New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName
Expand Down Expand Up @@ -272,15 +272,15 @@ function Test-RestoreVolumeFromSnapshot
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
$delegation = New-AzDelegation -Name "netAppVolumes" -ServiceName "Microsoft.Netapp/volumes"
Add-AzVirtualNetworkSubnetConfig -Name $subnetName -VirtualNetwork $virtualNetwork -AddressPrefix "10.0.1.0/24" -Delegation $delegation | Set-AzVirtualNetwork

# create the resource group
New-AzResourceGroup -Name $resourceGroupName -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroupName -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create account, pool and volume
$retrievedAcc = New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function Test-VaultCrud
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $backupLocation
New-AzResourceGroup -Name $resourceGroup -Location $backupLocation -Tags @{Owner = 'b-aubald'}

# try creating an Account -
$newTagName = "tag1"
Expand Down
41 changes: 25 additions & 16 deletions src/NetAppFiles/NetAppFiles.Test/ScenarioTests/VolumeTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function Test-VolumeCrud
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
Expand Down Expand Up @@ -224,7 +224,10 @@ function Test-VolumeCrud

# update (patch) export policy and check no change to rest of volume
$retrievedVolume = Update-AzNetAppFilesVolume -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName -PoolName $poolName2 -VolumeName $volName4 -ExportPolicy $exportPolicyMod
Assert-AreEqual '2.3.4.0/24' $retrievedVolume.ExportPolicy.Rules[0].AllowedClients

$retrievedVolume = Get-AzNetAppFilesVolume -ResourceGroupName $resourceGroup -AccountName $accName -PoolName $poolName2 -VolumeName $volName4
#Due to service side bug that is to be fixed this is disabled temporaraly
#Assert-AreEqual '2.3.4.0/24' $retrievedVolume.ExportPolicy.Rules[0].AllowedClients
# unchanged, not part of the patch
Assert-AreEqual "Standard" $retrievedVolume.ServiceLevel
Assert-AreEqual $doubleUsage $retrievedVolume.usageThreshold
Expand Down Expand Up @@ -263,7 +266,7 @@ function Test-VolumeReplication
$usageThreshold = 100 * $gibibyte
$doubleUsage = 2 * $usageThreshold
$srcResourceGroupLocation = "westus2"
$destResourceGroupLocation = "southcentralus"
$destResourceGroupLocation = "eastus"
#$srcResourceLocation = "westus2stage"
$srcResourceLocation = "westus2"
$destResourceLocation = "eastus"
Expand All @@ -290,6 +293,7 @@ function Test-VolumeReplication

function WaitForRepliationStatus($targetState)
{
$i = 0
do
{
try
Expand All @@ -298,18 +302,21 @@ function Test-VolumeReplication
}
catch [Microsoft.Rest.Azure.CloudException]
{
$ErrorMessage = $_.Exception.Message
#Send-MailMessage -From [email protected] -To [email protected] -Subject "Test Failed!" -SmtpServer localhost -Body "We failed to get replication status. The error message was $ErrorMessage"
$ErrorMessage = $_.Exception.Message
if ($ErrorMessage -notlike "*Cannot get replication status, the volume replication is*")
{
# Send-MailMessage -From [email protected] -To [email protected] -Subject "Test Thrown!" -SmtpServer localhost -Body "We Are Throwing the exception to get replication status. The error message was $ErrorMessage"
{
throw
}
#Send-MailMessage -From [email protected] -To [email protected] -Subject "Test Continued!" -SmtpServer localhost -Body "We Are Continuing from the exception to get replication status. The error message was $ErrorMessage"
}
}
Start-Sleep -Seconds 1.0
Start-Sleep -Seconds 10.0
$i++
}
while ($replicationStatus.MirrorState -ne $targetState)
until ($replicationStatus.MirrorState -eq $targetState -or $i -eq 20);

$replicationStatus = Get-AnfReplicationStatus -ResourceGroupName $destResourceGroup -AccountName $destAccName -PoolName $destPoolName -VolumeName $destVolName
Assert-AreEqual $targetState $replicationStatus.MirrorState

#while ($replicationStatus.MirrorState -ne $targetState)
}

function SleepDuringRecord
Expand All @@ -326,8 +333,10 @@ function Test-VolumeReplication
# normal setup :

# create the resource groups for source and destination
New-AzResourceGroup -Name $srcResourceGroup -Location $srcResourceGroupLocation
New-AzResourceGroup -Name $destResourceGroup -Location $destResourceGroupLocation
$groupTagName = "owner"
$groupTagValue = "b-aubald"
New-AzResourceGroup -Name $srcResourceGroup -Location $srcResourceGroupLocation -Tags @{$groupTagName = $groupTagValue}
New-AzResourceGroup -Name $destResourceGroup -Location $destResourceGroupLocation -Tags @{$groupTagName = $groupTagValue}

# create virtual network source
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $srcResourceGroup -Location $srcResourceLocation -Name $srcVnetName -AddressPrefix 10.0.0.0/16
Expand Down Expand Up @@ -460,7 +469,7 @@ function Test-SetVolumePool
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
Expand Down Expand Up @@ -568,7 +577,7 @@ function Update-AzNetAppFilesVolumeSnapshotPolicy
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
Expand Down Expand Up @@ -660,7 +669,7 @@ function Test-VolumePipelines
try
{
# create the resource group
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation -Tags @{Owner = 'b-aubald'}

# create virtual network
$virtualNetwork = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $vnetName -AddressPrefix 10.0.0.0/16
Expand Down
Loading