Skip to content

-PerformancePlus for New-AzDiskConfig #20937

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 3 commits into from
Feb 17, 2023
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
1 change: 1 addition & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

-->
## Upcoming Release
* Added `-PerformancePlus` parameter to `New-AzDiskConfig`

## Version 5.4.0
* Added `-SkipIdentity`, `-PathUserIdentity`, `-IsTest` parameter to `Set-AzVMAEMExtension`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ public partial class NewAzureRmDiskConfigCommand : Microsoft.Azure.Commands.Reso
[PSArgumentCompleter("X64", "Arm64")]
public string Architecture { get; set; }

[Parameter(
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled.")]
public bool? PerformancePlus { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

We'd like suggest to use switch parameter for PerformancePlus in New-Az* command

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, switchParameter would make more sense but all the boolean properties for Disk in this cmdlet New-AzDiskConfig are defined as boolean and not Switch. So I wanted to keep it consistent within this cmdlet.
I think it's better than having one boolean property be switch while ~3 others are all boolean for this cmdlet.

Copy link
Member Author

Choose a reason for hiding this comment

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


protected override void ProcessRecord()
{
if (ShouldProcess("Disk", "New"))
Expand Down Expand Up @@ -351,6 +357,15 @@ private void Run()
vCreationData.LogicalSectorSize = this.LogicalSectorSize;
}

if (this.IsParameterBound(c => c.PerformancePlus))
{
if (vCreationData == null)
{
vCreationData = new CreationData();
}
vCreationData.PerformancePlus = this.PerformancePlus;
}

if (this.IsParameterBound(c => c.EncryptionSettingsEnabled))
{
if (vEncryptionSettingsCollection == null)
Expand Down
18 changes: 17 additions & 1 deletion src/Compute/Compute/help/New-AzDiskConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ New-AzDiskConfig [[-SkuName] <String>] [-Tier <String>] [-LogicalSectorSize <Int
[-DiskEncryptionSetId <String>] [-EncryptionType <String>] [-DiskAccessId <String>]
[-NetworkAccessPolicy <String>] [-BurstingEnabled <Boolean>] [-PublicNetworkAccess <String>]
[-AcceleratedNetwork <Boolean>] [-DataAccessAuthMode <String>] [-Architecture <String>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-PerformancePlus <Boolean>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -484,6 +485,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -PerformancePlus
Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled.

```yaml
Type: System.Nullable`1[System.Boolean]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -PublicNetworkAccess
Policy for controlling export on the disk.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@
"Az.Compute","Get-AzGalleryApplication","Get-AzGalleryApplication","2","8200","Get-AzGalleryApplication changes the confirm impact. Please ensure that the change in ConfirmImpact is justified","Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact."
"Az.Compute","Get-AzGalleryApplicationVersion","Get-AzGalleryApplicationVersion","2","8010","Get-AzGalleryApplicationVersion Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
"Az.Compute","Get-AzGalleryApplicationVersion","Get-AzGalleryApplicationVersion","2","8200","Get-AzGalleryApplicationVersion changes the confirm impact. Please ensure that the change in ConfirmImpact is justified","Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact."
"Az.Compute","Microsoft.Azure.Commands.Compute.Automation.NewAzureRmDiskConfigCommand","New-AzDiskConfig","1","8410","Parameter PerformancePlus of cmdlet New-AzDiskConfig does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."