Skip to content

Conversation

@cheguv
Copy link
Member

@cheguv cheguv commented Aug 11, 2018

Description

Checklist

@bganapa
Copy link
Member

bganapa commented Aug 11, 2018

@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 = @(
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added back in.

Copy link
Member

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.

Copy link
Member Author

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

@bganapa
Copy link
Member

bganapa commented Aug 11, 2018

@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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please shorten these.

Copy link
Member Author

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please shorten these.

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Member Author

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Member Author

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please shorten these.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping on this comment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StandardManagedDiskAndSnapshotSize

Copy link
Member Author

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.

@bganapa
Copy link
Member

bganapa commented Aug 14, 2018

### -CoresLimit
Maximum number of cores allowed.
### -Location
{{Fill Location Description}}
Copy link
Contributor

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}}
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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 @@
---
Copy link
Member

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 @@
---
Copy link
Member

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 @@
---
Copy link
Member

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]
Copy link
Member

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]
Copy link
Member

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
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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
Copy link
Member

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
Copy link
Member

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 @@
<#
Copy link
Member

@deathly809 deathly809 Aug 17, 2018

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

Copy link
Member Author

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
Copy link
Member

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.")) {

<#
Copy link
Member

@deathly809 deathly809 Aug 20, 2018

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.

Copy link
Member

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
Copy link
Member

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")]
Copy link
Member

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
Copy link
Member

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
@cheguv
Copy link
Member Author

cheguv commented Aug 21, 2018

@bganapa @deathly809 Can you please provide your approval for ASDK team to merge the changes.

@cheguv
Copy link
Member Author

cheguv commented Aug 23, 2018

@maddieclayton can you please help merge the PR.

@deathly809
Copy link
Member

@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.

@deathly809
Copy link
Member

@maddieclayton Can you merge this so I can do my PR?

@maddieclayton
Copy link
Contributor

@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.

@deathly809
Copy link
Member

@maddieclayton I approve.

@maddieclayton maddieclayton merged commit 4434f13 into Azure:preview Aug 28, 2018
ionuttulai pushed a commit to ionuttulai/azure-powershell that referenced this pull request Mar 4, 2020
Update AzureStack.Compute.Admin powershell quota object to support two additional managed disk parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants