-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Update AzureStack.Compute.Admin powershell quota object to support two additional managed disk parameters #6903
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
Conversation
|
@cheguv build is failing.. could you pls take a look https://azuresdkci.westus2.cloudapp.azure.com/job/powershell/6543/console |
| $Location = (Get-AzureRMLocation).Location | ||
| } | ||
|
|
||
| $filterInfos = @( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is being removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cheguv We have to leave this in, I forgot that this was for client side filters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added back in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see it as removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted all changes to this file. should now have no differeence from what was in azure\azure-powershell
|
@cheguv Can you please update the Examples and markdown help files? To update the markdown files, you could use tools\UpdatePlaytyps.ps1 file |
|
|
||
| [Parameter(Mandatory = $false)] | ||
| [int32] | ||
| $MaxAllocationStandardManagedDisksAndSnapshots = 2048, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please shorten these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed and PM has opened a bug to track this and get done.
|
|
||
| [Parameter(Mandatory = $false)] | ||
| [int32] | ||
| $MaxAllocationPremiumManagedDisksAndSnapshots = 2048, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please shorten these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed and PM has opened a bug to track this and get done.
| .PARAMETER VirtualMachineCount | ||
| Maximum number of virtual machines allowed. | ||
| .PARAMETER MaxAllocationStandardManagedDisksAndSnapshots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed and PM has opened a bug to track this and get done.
| .PARAMETER MaxAllocationStandardManagedDisksAndSnapshots | ||
| Maximum number of standard managed disks and snapshots allowed | ||
| .PARAMETER MaxAllocationPremiumManagedDisksAndSnapshots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed and PM has opened a bug to track this and get done.
|
|
||
| [Parameter(Mandatory = $false)] | ||
| [int32] | ||
| $MaxAllocationStandardManagedDisksAndSnapshots, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed and PM has opened a bug to track this and get done.
|
|
||
| [Parameter(Mandatory = $false)] | ||
| [int32] | ||
| $MaxAllocationPremiumManagedDisksAndSnapshots, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed and PM has opened a bug to track this and get done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will just have to make a breaking change in the future and notify clients with a warning before we do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cheguv Do you want to print a warning saying the parameter name MaxAllocationStandardManagedDisksAndSnapshots will be changed in future kind of message when this param is being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename the PowerShell parameters to the shortened name - they don't need to match the backend, and better to not match now than to make breaking changes in the future.
|
|
||
| [Parameter(Mandatory = $false)] | ||
| [int32] | ||
| $MaxAllocationStandardManagedDisksAndSnapshots, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please shorten these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed and PM has opened a bug to track this and get done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can change it here, it won't affect server side. Please consult with PM to change it now in PowerShell so we don't have a breaking change later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping on this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StandardManagedDiskAndSnapshotSize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is is shortened. Check ConvertTo-ComputeQuota.ps1.
new ComputeQuotaObject type is defined in this file. This is what is exposed to customers.
…ig for both compute.admin and tests
| ### -CoresLimit | ||
| Maximum number of cores allowed. | ||
| ### -Location | ||
| {{Fill Location Description}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fill out description - apply everywhere in this file.
| ### -Type | ||
| Type of extension. | ||
| ### -Location | ||
| {{Fill Location Description}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
|
|
||
| [Parameter(Mandatory = $false)] | ||
| [int32] | ||
| $MaxAllocationStandardManagedDisksAndSnapshots, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping on this comment
|
|
||
| [Parameter(Mandatory = $false)] | ||
| [int32] | ||
| $MaxAllocationPremiumManagedDisksAndSnapshots, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename the PowerShell parameters to the shortened name - they don't need to match the backend, and better to not match now than to make breaking changes in the future.
| @@ -1,72 +0,0 @@ | |||
| --- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this deleted?
| @@ -1,147 +0,0 @@ | |||
| --- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this deleted?
| @@ -1,185 +0,0 @@ | |||
| --- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this deleted?
| [string] | ||
| $Type | ||
|
|
||
| [int32] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a BREAKING change that will break all the BVTs along with clients.
| $quota.CoresCount | Should be $_[1] | ||
| $quota.VmScaleSetCount | Should be $_[2] | ||
| $quota.VirtualMachineCount | Should be $_[3] | ||
| $quota.StandardManagedDiskAndSnapshotSize | Should be $_[4] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing.
| $Quota.CoresLimit | Should Not Be $null | ||
| $Quota.CoresCount | Should Not Be $null | ||
| $Quota.VirtualMachineCount | Should Not Be $null | ||
| $Quota.VmScaleSetCount | Should Not Be $null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not validating the new Quota properties. Add validation for those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
|
||
| # | ||
| # if running against the actual environment enable the following to create first. | ||
| # New-AzsComputeQuota -Location $global:Location -Name "testQuotaCreateUpdateDelete" -AvailabilitySetCount 1 -CoresCount 1 -VmScaleSetCount 1 -VirtualMachineCount 1 -StandardManagedDiskAndSnapshotSize 1 -PremiumManagedDiskAndSnapshotSize 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should have recorded the create.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason recording with powershell is not working where as with sdk did work well.
| ``` | ||
|
|
||
| Add a new platform image. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should not be a need to change this file as there is no change in the cmdlet Add-AzsPlatformImage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, there might be soem update in platyps script, that caused this change, i will remove.
| if ('Update' -eq $PsCmdlet.ParameterSetName -or 'InputObject' -eq $PsCmdlet.ParameterSetName -or 'ResourceId' -eq $PsCmdlet.ParameterSetName) { | ||
|
|
||
| if ($NewQuota -eq $null) { | ||
| $NewQuota = Get-AzsComputeQuota -Location $Location -Name $Name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to
ConvertTo-SDKQuota -Quota (Get-AzsComputeQuota -Location $Location -Name $Name)
| return $result | ||
| } | ||
|
|
||
| function Convert-CustomQuotaToSDKObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to function to
ConvertTo-SDKQuota
| @@ -0,0 +1,115 @@ | |||
| <# | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split into two files, ConvertTo-CustomQuotaObject.ps1 and ConvertTo-SDKQuota.ps1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| $Location | ||
| } | ||
|
|
||
| function New-QuotaCustomObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to
ConvertTo-CustomQuotaObject
…bject to be used, add back deleted md files, review comments
|
|
||
| if ($PSCmdlet.ShouldProcess("$Name", "Create a new compute quota.")) { | ||
|
|
||
| <# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncomment this and move to first line of Process block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, add this and alias to Set-AzsComputeQuota
|
|
||
| $quotaObj = Get-TaskResult @GetTaskResult_params | ||
| [QuotaCustomObject]$script:result = New-QuotaCustomObject -Quota $quotaObj | ||
| [ComputeQuotaObject]$script:result = ConvertTo-ComputeQuota -Quota $quotaObj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to save to variable. Just have this single line at the end of your function
ConvertTo-ComputeQuota -Quota (Get-TaskResult @GetTaskResult_params)
| [int32] | ||
| $AvailabilitySetCount = 10, | ||
|
|
||
| #[Alias("CoresLimit")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out?
| $utilityCmdParams[$_] = Get-Variable -Name $_ -ValueOnly | ||
| } | ||
| $NewQuota = New-QuotaObject @utilityCmdParams | ||
| $NewQuota = ConvertTo-SdkQuota $PSBoundParameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you do this? My last comment said to just revert to what was there originally and creating 2 variables for the expected C# SDK quota object. To make it work with alias just set $CoresLimit = $CoresCount if $CoresLimit is not set.
…e alias is used for two methods New-AzsComputeQuota and Set-AzsComputeQuota
|
@bganapa @deathly809 Can you please provide your approval for ASDK team to merge the changes. |
|
@maddieclayton can you please help merge the PR. |
|
@cheguv As we said, we are waiting for the Azure team to finish some work. They have a PR that is outstanding and we cannot merge until that has finished. |
|
@maddieclayton Can you merge this so I can do my PR? |
|
@deathly809 Can you give your approval on the PR just so we have record of it? Since you release the Admin modules, I'm going to require approval from either you or @bganapa before merging PRs to StackAdmin. After the Travis job passes I'll merge. |
|
@maddieclayton I approve. |
Update AzureStack.Compute.Admin powershell quota object to support two additional managed disk parameters
Description
Checklist
CONTRIBUTING.mdplatyPSmodule