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 @@ -185,7 +185,7 @@ public void TestVirtualMachineScaleSetNewEncryptionAtHost()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetEncryptionAtHost");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineScaleSetOrchestrationVM()
Expand Down Expand Up @@ -220,14 +220,14 @@ public void TestVirtualMachineScaleSetFlexibleOModeDefaulting()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetFlexibleOModeDefaulting");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAddAzVmssRunCommand()
{
TestRunner.RunTestScript("Test-AddAndRemoveAzVmssRunCommand");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineScaleSetUserdata()
Expand Down Expand Up @@ -318,7 +318,7 @@ public void TestVirtualMachineScaleSetOSImageScheduledEvents()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetOSImageScheduledEvents");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineScaleSetGetById()
Expand Down Expand Up @@ -374,7 +374,7 @@ public void TestVirtualMachineScaleSetSecurityTypeUpdate()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetSecurityTypeUpdate");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineScaleSetDefaultToFlexibleOrchestrationMode()
Expand Down Expand Up @@ -409,7 +409,7 @@ public void TestVirtualMachineScaleSetSecurityTypeAndFlexDefaults()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetSecurityTypeAndFlexDefaults");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineScaleSetSecurityTypeNoVMProfile()
Expand Down Expand Up @@ -500,5 +500,12 @@ public void TestVirtualMachineScaleSetResiliencyView()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetResiliencyView");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineScaleSetHighSpeedInterconnectPlacement()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetHighSpeedInterconnectPlacement");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6185,4 +6185,84 @@ function Test-VirtualMachineScaleSetResiliencyView
# Cleanup
Clean-ResourceGroup $rgname;
}
}

<#
.SYNOPSIS
Test creating a VMSS with HighSpeedInterconnectPlacement set
#>
function Test-VirtualMachineScaleSetHighSpeedInterconnectPlacement
{
# Setup
$rgname = Get-ComputeTestResourceName;
$loc = "westus2";

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

$vmssName = 'vmss' + $rgname;
$domainNameLabel1 = "d1" + $rgname;
$subnetName = 'subnet' + $rgname;
$vnetName = 'vnet' + $rgname;

$adminUsername = Get-ComputeTestResourceName;
$password = Get-PasswordForVM;
$adminPassword = $password | ConvertTo-SecureString -AsPlainText -Force;
$cred = New-Object System.Management.Automation.PSCredential ($adminUsername, $adminPassword);
$linuxImage = "Canonical:0001-com-ubuntu-server-jammy:22_04-lts:latest"

# Case 1: Create using simple parameter set
$vmss = New-AzVmss -ResourceGroupName $rgname -Location $loc -Credential `
$cred -VMScaleSetName $vmssName -DomainNameLabel $domainNameLabel1 `
-Image $linuxImage `
-HighSpeedInterconnectPlacement "None";

# verify
Assert-AreEqual $vmss.HighSpeedInterconnectPlacement "None";


# Create VNet and Subnet
$vnetAddressPrefix = "10.0.0.0/16";
$subnetAddressPrefix = "10.0.0.0/24";
$subnetConfig = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix $subnetAddressPrefix;
$vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $loc -AddressPrefix $vnetAddressPrefix -Subnet $subnetConfig;

# Get subnet object
$subnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname | Get-AzVirtualNetworkSubnetConfig -Name $subnetName

# VMSS Config
$vmssConfig = New-AzVmssConfig -Location $loc -SkuCapacity 2 -SkuName "Standard_D4s_v3" -HighSpeedInterconnectPlacement "None";

# Configure IP and NIC
$ipCfg = New-AzVmssIpConfig -Name "ipconfig1" -SubnetId $subnet.Id
$vmssConfig = Add-AzVmssNetworkInterfaceConfiguration -VirtualMachineScaleSet $vmssConfig `
-Name "nicConfig" -Primary $true -IPConfiguration $ipCfg;

# Configure OS profile
$vmssConfig = Set-AzVmssOSProfile -VirtualMachineScaleSet $vmssConfig `
-ComputerNamePrefix "test" `
-AdminUsername $adminUsername `
-AdminPassword $password

# Assert the HighSpeedInterconnectPlacement from the vmssConfig
Assert-AreEqual $vmssConfig.HighSpeedInterconnectPlacement "None";

# Create the vmss using the config
$vmssResult = New-AzVmss -ResourceGroupName $rgname -VMScaleSetName "newtestVmss" -VirtualMachineScaleSet $vmssConfig;

# Assert the HighSpeedInterconnectPlacement from the vmssResult
Assert-AreEqual $vmssResult.HighSpeedInterconnectPlacement "None";

$vmssGet = Get-AzVmss -ResourceGroupName $rgname -VMScaleSetName "newtestVmss"
$vmssUpdated = Update-AzVmss -ResourceGroupName $rgname -VMScaleSetName "newtestVmss" -VirtualMachineScaleSet $vmssGet -HighSpeedInterconnectPlacement $null;
$vmssGet = Get-AzVmss -ResourceGroupName $rgname -VMScaleSetName "newtestVmss"
Assert-AreEqual $vmssGet.HighSpeedInterconnectPlacement "None";
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname;
}
}

Large diffs are not rendered by default.

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 `-HighSpeedInterconnectPlacement` parameter to `New-AzVmssConfig`, `New-AzVmss`, and `Update-AzVmss` cmdlets.

## Version 11.1.0
* Added `-ResiliencyView` parameter to `Get-AzVmssVM` cmdlet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ public string ResourceGroupName
public string Etag { get; private set; }

public ResiliencyPolicy ResiliencyPolicy { get; set; }
public string HighSpeedInterconnectPlacement { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,13 @@ public partial class NewAzureRmVmssConfigCommand : Microsoft.Azure.Commands.Reso
[PSArgumentCompleter("CreateBeforeDelete")]
public string AutomaticZoneRebalanceBehavior { get; set; }

[Parameter(
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Specifies the high speed interconnect placement for the virtual machine scale set.")]
[PSArgumentCompleter("None", "Trunk")]
public string HighSpeedInterconnectPlacement { get; set; }

protected override void ProcessRecord()
{
if (ShouldProcess("VirtualMachineScaleSet", "New"))
Expand Down Expand Up @@ -1145,7 +1152,8 @@ private void Run()
SpotRestorePolicy = this.IsParameterBound(c => c.EnableSpotRestore) ? new SpotRestorePolicy(true, this.SpotRestoreTimeout) : null,
PriorityMixPolicy = vPriorityMixPolicy,
SkuProfile = vSkuProfile,
ResiliencyPolicy = vResiliencyPolicy
ResiliencyPolicy = vResiliencyPolicy,
HighSpeedInterconnectPlacement = this.IsParameterBound(c => c.HighSpeedInterconnectPlacement) ? this.HighSpeedInterconnectPlacement : null
};

WriteObject(vVirtualMachineScaleSet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,13 @@ public override void ExecuteCmdlet()
[PSArgumentCompleter("CreateBeforeDelete")]
public string AutomaticZoneRebalanceBehavior { get; set; }

[Parameter(
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Specifies the high speed interconnect placement for the virtual machine scale set.")]
[PSArgumentCompleter("None", "Trunk")]
public string HighSpeedInterconnectPlacement { get; set; }

private void BuildPatchObject()
{
if (this.IsParameterBound(c => c.AutomaticOSUpgrade))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@ public partial class NewAzureRmVmss : ComputeAutomationBaseCmdlet
HelpMessage = "Specify whether to implicitly install the ProxyAgent Extension. This option is currently applicable only for Linux Os.")]
public SwitchParameter AddProxyAgentExtension { get; set; }

[Parameter(
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Specifies the high speed interconnect placement for the virtual machine scale set.")]
[PSArgumentCompleter("None", "Trunk")]
public string HighSpeedInterconnectPlacement { get; set; }

private void ConfigureSecuritySettings()
{
if (SecurityType?.ToLower() == SecurityTypes.TrustedLaunch ||
Expand Down Expand Up @@ -560,7 +567,8 @@ private async Task<ResourceConfig<VirtualMachineScaleSet>> SimpleParameterSetNor
securityPostureId: _cmdlet.SecurityPostureId,
securityPostureExcludeExtension: _cmdlet.SecurityPostureExcludeExtension,
enableProxyAgent: _cmdlet.EnableProxyAgent ? true : (bool?)null,
addProxyAgentExtension: _cmdlet.AddProxyAgentExtension.IsPresent ? true : (bool?)null
addProxyAgentExtension: _cmdlet.AddProxyAgentExtension.IsPresent ? true : (bool?)null,
highSpeedInterconnectPlacement: _cmdlet.IsParameterBound(c => c.HighSpeedInterconnectPlacement) ? _cmdlet.HighSpeedInterconnectPlacement : null
);
}

Expand Down Expand Up @@ -701,7 +709,8 @@ private async Task<ResourceConfig<VirtualMachineScaleSet>> SimpleParameterSetOrc
securityPostureId: _cmdlet.SecurityPostureId,
securityPostureExcludeExtension: _cmdlet.SecurityPostureExcludeExtension,
enableProxyAgent: _cmdlet.EnableProxyAgent ? true : (bool?)null,
addProxyAgentExtension: _cmdlet.AddProxyAgentExtension.IsPresent ? true : (bool?)null
addProxyAgentExtension: _cmdlet.AddProxyAgentExtension.IsPresent ? true : (bool?)null,
highSpeedInterconnectPlacement: _cmdlet.IsParameterBound(c => c.HighSpeedInterconnectPlacement) ? _cmdlet.HighSpeedInterconnectPlacement : null
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ internal static ResourceConfig<VirtualMachineScaleSet> CreateVirtualMachineScale
string securityPostureId = null,
string[] securityPostureExcludeExtension = null,
bool? enableProxyAgent = null,
bool? addProxyAgentExtension = null
bool? addProxyAgentExtension = null,
string highSpeedInterconnectPlacement = null
)
=> Strategy.CreateResourceConfig(
resourceGroup: resourceGroup,
Expand Down Expand Up @@ -201,7 +202,8 @@ internal static ResourceConfig<VirtualMachineScaleSet> CreateVirtualMachineScale
AllocationStrategy = skuProfileAllocationStrategy
},
DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs ? true : (bool?)null,
OrchestrationMode = orchestrationMode
OrchestrationMode = orchestrationMode,
HighSpeedInterconnectPlacement = highSpeedInterconnectPlacement
};
if (auxAuthHeader != null)
{
Expand Down Expand Up @@ -254,7 +256,8 @@ internal static ResourceConfig<VirtualMachineScaleSet> CreateVirtualMachineScale
string securityPostureId = null,
string[] securityPostureExcludeExtension = null,
bool? enableProxyAgent = null,
bool? addProxyAgentExtension = null
bool? addProxyAgentExtension = null,
string highSpeedInterconnectPlacement = null
)
=> Strategy.CreateResourceConfig(
resourceGroup: resourceGroup,
Expand Down Expand Up @@ -353,7 +356,8 @@ internal static ResourceConfig<VirtualMachineScaleSet> CreateVirtualMachineScale
AllocationStrategy = skuProfileAllocationStrategy
},
DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs ? true : (bool?)null,
OrchestrationMode = orchestrationMode
OrchestrationMode = orchestrationMode,
HighSpeedInterconnectPlacement = highSpeedInterconnectPlacement
};
if (auxAuthHeader != null)
{
Expand Down
22 changes: 19 additions & 3 deletions src/Compute/Compute/help/New-AzVmss.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Creates a virtual machine scale set.
```
New-AzVmss [-ResourceGroupName] <String> [-VMScaleSetName] <String>
[-VirtualMachineScaleSet] <PSVirtualMachineScaleSet> [-AsJob] [-IfMatch <String>] [-IfNoneMatch <String>]
[-EdgeZone <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
[-EdgeZone <String>] [-HighSpeedInterconnectPlacement <String>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

### SimpleParameterSet
Expand All @@ -40,7 +40,7 @@ New-AzVmss [[-ResourceGroupName] <String>] [-VMScaleSetName] <String> [-AsJob] [
[-EnableVtpm <Boolean>] [-EnableSecureBoot <Boolean>] [-SecurityPostureId <String>]
[-SecurityPostureExcludeExtension <String[]>] [-SkuProfileVmSize <String[]>]
[-SkuProfileAllocationStrategy <String>] [-EnableProxyAgent] [-AddProxyAgentExtension]
[-DefaultProfile <IAzureContextContainer>] [-SinglePlacementGroup]
[-HighSpeedInterconnectPlacement <String>] [-DefaultProfile <IAzureContextContainer>] [-SinglePlacementGroup]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

Expand Down Expand Up @@ -603,6 +603,22 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -HighSpeedInterconnectPlacement
Specifies the high speed interconnect placement for the virtual machine scale set.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: None, Trunk

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

### -HostGroupId
Specifies the dedicated host group the virtual machine scale set will reside in.

Expand Down
24 changes: 20 additions & 4 deletions src/Compute/Compute/help/New-AzVmssConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ New-AzVmssConfig [[-Overprovision] <Boolean>] [[-Location] <String>] [-EdgeZone
[-EnableSecureBoot <Boolean>] [-SecurityPostureId <String>] [-SecurityPostureExcludeExtension <String[]>]
[-SkuProfileVmSize <String[]>] [-SkuProfileAllocationStrategy <String>] [-EnableResilientVMCreate]
[-EnableResilientVMDelete] [-EnableAutomaticZoneRebalance] [-AutomaticZoneRebalanceStrategy <String>]
[-AutomaticZoneRebalanceBehavior <String>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
[-AutomaticZoneRebalanceBehavior <String>] [-HighSpeedInterconnectPlacement <String>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ExplicitIdentityParameterSet
Expand All @@ -62,8 +62,8 @@ New-AzVmssConfig [[-Overprovision] <Boolean>] [[-Location] <String>] [-EdgeZone
[-EnableSecureBoot <Boolean>] [-SecurityPostureId <String>] [-SecurityPostureExcludeExtension <String[]>]
[-SkuProfileVmSize <String[]>] [-SkuProfileAllocationStrategy <String>] [-EnableResilientVMCreate]
[-EnableResilientVMDelete] [-EnableAutomaticZoneRebalance] [-AutomaticZoneRebalanceStrategy <String>]
[-AutomaticZoneRebalanceBehavior <String>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
[-AutomaticZoneRebalanceBehavior <String>] [-HighSpeedInterconnectPlacement <String>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

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

### -HighSpeedInterconnectPlacement
Specifies the high speed interconnect placement for the virtual machine scale set.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: None, Trunk

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

### -IdentityId
Specifies the list of user identities associated with the virtual machine scale set.
The user identity references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'
Expand Down
Loading