Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -6143,4 +6143,49 @@ function Test-VirtualMachineScaleSetGalleryApplicationFlags
{
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test Virtual Machine Scale Set ResiliencyView parameter
#>
function Test-VirtualMachineScaleSetResiliencyView
{
# Setup
$rgname = Get-ComputeTestResourceName

try
{
# Common
$loc = Get-ComputeVMLocation;
New-AzResourceGroup -Name $rgname -Location $loc -Force;

# New VMSS Parameters
$vmssName = 'vmss' + $rgname;
$vmssType = 'Microsoft.Compute/virtualMachineScaleSets';

$adminUsername = 'Foo12';
$adminPassword = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force;

$vmssConfig = New-AzVmssConfig -Location $loc -SkuCapacity 2 -SkuName 'Standard_DS1_v2' -UpgradePolicyMode 'Manual';

$vmss = New-AzVmss -ResourceGroupName $rgname -Name $vmssName -VirtualMachineScaleSet $vmssConfig;

# Test ResiliencyView parameter
$vmssVMList = Get-AzVmssVM -ResourceGroupName $rgname -VMScaleSetName $vmssName -ResiliencyView;
Assert-NotNull $vmssVMList;
Assert-True { $vmssVMList.Count -ge 1 };

# Test ResiliencyView with specific instance
$vmssVM = Get-AzVmssVM -ResourceGroupName $rgname -VMScaleSetName $vmssName -InstanceId $vmssVMList[0].InstanceId -ResiliencyView;
Assert-NotNull $vmssVM;
Assert-NotNull $vmssVM.InstanceId;
# ResilientVMDeletionStatus property should be available when ResiliencyView is requested
# Note: The property may be null if Resilient Delete is not enabled on the VMSS
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}
3 changes: 3 additions & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* Updated Azure.Core from 1.45.0 to 1.47.3
* Added `-EnableAutomaticUpgrade` and `-TreatFailureAsDeploymentFailure` parameters (Bool) to `New-AzVmGalleryApplication` and `New-AzVmssGalleryApplication` cmdlets.
* Added `-EnableAutomaticUpgrade` and `-TreatFailureAsDeploymentFailure` parameters (Switch) to `Add-AzVmGalleryApplication` and `Add-AzVmssGalleryApplication` cmdlets.
* Added `-ResiliencyView` parameter to `Get-AzVmssVM` cmdlet
- Retrieves the real-time status of VM (Virtual Machine) delete retries for the Resilient Delete feature
- Includes `ResilientVMDeletionStatus` property indicating whether retries are in progress, failed, or not started

## Version 10.5.0
* Added `-Redeploy` switch parameter for `Update-AzHost` cmdlet to enable dedicated host redeployment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public string ResourceGroupName
public string VmId { get; set; }
public VirtualMachineScaleSetVMInstanceView InstanceView { get; set; }
public HardwareProfile HardwareProfile { get; set; }
public string ResilientVMDeletionStatus { get; set; }
public StorageProfile StorageProfile { get; set; }
public AdditionalCapabilities AdditionalCapabilities { get; set; }
public OSProfile OsProfile { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public partial class GetAzureRmVmssVM : ComputeAutomationBaseCmdlet
protected const string DefaultParameterSet = "DefaultParameter",
FriendMethodParameterSet = "FriendMethod";
private VmssVMInstanceViewTypes UserDataExpand = VmssVMInstanceViewTypes.UserData;
private VmssVMInstanceViewTypes ResiliencyViewExpand = VmssVMInstanceViewTypes.ResiliencyView;

public override void ExecuteCmdlet()
{
Expand All @@ -58,6 +59,13 @@ public override void ExecuteCmdlet()
ComputeAutomationAutoMapperProfile.Mapper.Map<VirtualMachineScaleSetVMInstanceView, PSVirtualMachineScaleSetVMInstanceView>(result, psObject);
WriteObject(psObject);
}
else if (this.ResiliencyView == true)
{
var result = VirtualMachineScaleSetVMsClient.Get(resourceGroupName, vmScaleSetName, instanceId, ResiliencyViewExpand);
var psObject = new PSVirtualMachineScaleSetVM();
ComputeAutomationAutoMapperProfile.Mapper.Map<VirtualMachineScaleSetVM, PSVirtualMachineScaleSetVM>(result, psObject);
WriteObject(psObject);
}
else if (this.UserData == true)
{
var result = VirtualMachineScaleSetVMsClient.Get(resourceGroupName, vmScaleSetName, instanceId, UserDataExpand);
Expand Down Expand Up @@ -173,5 +181,17 @@ public override void ExecuteCmdlet()
HelpMessage = "UserData for the Vmss, which will be Base64 encoded. Customer should not pass any secrets in here.",
ValueFromPipelineByPropertyName = true)]
public SwitchParameter UserData { get; set; }

[Parameter(
Mandatory = false,
ParameterSetName = DefaultParameterSet,
HelpMessage = "ResiliencyView retrieves the real-time status of VM delete retries for the Resilient Delete feature.",
ValueFromPipelineByPropertyName = true)]
[Parameter(
Mandatory = false,
ParameterSetName = FriendMethodParameterSet,
HelpMessage = "ResiliencyView retrieves the real-time status of VM delete retries for the Resilient Delete feature.",
ValueFromPipelineByPropertyName = true)]
public SwitchParameter ResiliencyView { get; set; }
}
}
27 changes: 25 additions & 2 deletions src/Compute/Compute/help/Get-AzVmssVM.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Gets the properties of a VMSS virtual machine.
### DefaultParameter (Default)
```
Get-AzVmssVM [[-ResourceGroupName] <String>] [[-VMScaleSetName] <String>] [[-InstanceId] <String>] [-UserData]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
[-ResiliencyView] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### FriendMethod
```
Get-AzVmssVM [[-ResourceGroupName] <String>] [[-VMScaleSetName] <String>] [[-InstanceId] <String>]
[-InstanceView] [-UserData] [-DefaultProfile <IAzureContextContainer>]
[-InstanceView] [-UserData] [-ResiliencyView] [-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
```

Expand Down Expand Up @@ -59,6 +59,14 @@ This command gets the properties of the VMSS virtual machine named VMSS004 that
Since the command specifies the *InstanceView* switch parameter, the cmdlet gets the instance view of the virtual machine.
The command gets the instance ID stored in the variable $ID for which to get the instance view.

### Example 4: Get the resiliency view of a VMSS virtual machine
```powershell
Get-AzVmssVM -ResiliencyView -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId "0"
```

This command gets the resiliency view of the VMSS virtual machine with instance ID "0" in the scale set "myScaleSet".
The ResiliencyView parameter retrieves the real-time status of VM delete retries for the Resilient Delete feature, including the ResilientVMDeletionStatus property which indicates whether retries are in progress, failed, or not started.

## PARAMETERS

### -DefaultProfile
Expand Down Expand Up @@ -136,6 +144,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ResiliencyView
ResiliencyView retrieves the real-time status of VM delete retries for the Resilient Delete feature. When specified, the response includes the ResilientVMDeletionStatus property indicating whether retries are in progress, failed, or not started.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

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

### -VMScaleSetName
Species the name of the VMSS.

Expand Down