diff --git a/src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.cs b/src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.cs index dcda2e463a44..73f384925e7a 100644 --- a/src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.cs +++ b/src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.cs @@ -137,5 +137,19 @@ public void SimpleNewVmssSkipExtOverprovision() { TestRunner.RunTestScript("Test-SimpleNewVmssSkipExtOverprovision"); } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestSimpleNewVmssWithHighSpeedInterconnectPlacement() + { + TestRunner.RunTestScript("Test-SimpleNewVmssWithHighSpeedInterconnectPlacement"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestVmssConfigWithHighSpeedInterconnectPlacement() + { + TestRunner.RunTestScript("Test-VmssConfigWithHighSpeedInterconnectPlacement"); + } } } diff --git a/src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.ps1 b/src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.ps1 index 459adf55c85a..52666debebee 100644 --- a/src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.ps1 +++ b/src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.ps1 @@ -551,3 +551,60 @@ function Test-SimpleNewVmssSkipExtOverprovision Clean-ResourceGroup $vmssname } } + +<# +.SYNOPSIS +Test Simple Parameter Set for New Vmss with HighSpeedInterconnectPlacement. +#> +function Test-SimpleNewVmssWithHighSpeedInterconnectPlacement +{ + # Setup + $vmssname = Get-ResourceName + + try + { + $username = "admin01" + $password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force + $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password + [string]$domainNameLabel = "$vmssname$vmssname".tolower(); + $stnd = "Standard"; + + # Test with HighSpeedInterconnectPlacement set to "Trunk" + New-AzVmss -Name $vmssname -Location "westus2" -Credential $cred -DomainNameLabel $domainNameLabel -SecurityType $stnd ` + -HighSpeedInterconnectPlacement "Trunk"; + $vmss = Get-AzVmss -ResourceGroupName $vmssname -Name $vmssname; + Assert-AreEqual "Trunk" $vmss.HighSpeedInterconnectPlacement; + } + finally + { + # Cleanup + Clean-ResourceGroup $vmssname + } +} + +<# +.SYNOPSIS +Test New-AzVmssConfig with HighSpeedInterconnectPlacement. +#> +function Test-VmssConfigWithHighSpeedInterconnectPlacement +{ + # Setup + $rgname = Get-ResourceName + $loc = "westus2"; + + try + { + # Test with HighSpeedInterconnectPlacement set to "None" + $vmssConfig = New-AzVmssConfig -Location $loc -HighSpeedInterconnectPlacement "None"; + Assert-AreEqual "None" $vmssConfig.HighSpeedInterconnectPlacement; + + # Test with HighSpeedInterconnectPlacement set to "Trunk" + $vmssConfig2 = New-AzVmssConfig -Location $loc -HighSpeedInterconnectPlacement "Trunk"; + Assert-AreEqual "Trunk" $vmssConfig2.HighSpeedInterconnectPlacement; + } + finally + { + # Cleanup + Clean-ResourceGroup $rgname + } +} diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index 3b20e3949f01..6cbd87c7dbd1 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -24,6 +24,7 @@ * 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 `-HighSpeedInterconnectPlacement` parameter to `New-AzVmss` and `New-AzVmssConfig` cmdlets to enable or opt out of Infiniband network interconnect between RDMA VM (Virtual Machine) sizes. ## Version 10.5.0 * Added `-Redeploy` switch parameter for `Update-AzHost` cmdlet to enable dedicated host redeployment. diff --git a/src/Compute/Compute/Generated/VirtualMachineScaleSet/Config/NewAzureRmVmssConfigCommand.cs b/src/Compute/Compute/Generated/VirtualMachineScaleSet/Config/NewAzureRmVmssConfigCommand.cs index fa20ef906905..2b0c605b7761 100644 --- a/src/Compute/Compute/Generated/VirtualMachineScaleSet/Config/NewAzureRmVmssConfigCommand.cs +++ b/src/Compute/Compute/Generated/VirtualMachineScaleSet/Config/NewAzureRmVmssConfigCommand.cs @@ -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 = "The HighSpeedInterconnectPlacement property allows customers to enable or opt out of Infiniband network interconnect between RDMA VM sizes. Possible values are: 'None', 'Trunk'.")] + [PSArgumentCompleter("None", "Trunk")] + public string HighSpeedInterconnectPlacement { get; set; } + protected override void ProcessRecord() { if (ShouldProcess("VirtualMachineScaleSet", "New")) @@ -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); diff --git a/src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs b/src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs index cc6cc0aca4e0..eeb34956e493 100644 --- a/src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs +++ b/src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs @@ -299,6 +299,14 @@ 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, + ParameterSetName = SimpleParameterSet, + HelpMessage = "The HighSpeedInterconnectPlacement property allows customers to enable or opt out of Infiniband network interconnect between RDMA VM sizes. Possible values are: 'None', 'Trunk'.")] + [PSArgumentCompleter("None", "Trunk")] + public string HighSpeedInterconnectPlacement { get; set; } + private void ConfigureSecuritySettings() { if (SecurityType?.ToLower() == SecurityTypes.TrustedLaunch || @@ -560,7 +568,8 @@ private async Task> 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.HighSpeedInterconnectPlacement ); } @@ -701,7 +710,8 @@ private async Task> 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.HighSpeedInterconnectPlacement ); } } diff --git a/src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs b/src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs index e588ab6469cc..be58385696f8 100644 --- a/src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs +++ b/src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs @@ -84,7 +84,8 @@ internal static ResourceConfig CreateVirtualMachineScale string securityPostureId = null, string[] securityPostureExcludeExtension = null, bool? enableProxyAgent = null, - bool? addProxyAgentExtension = null + bool? addProxyAgentExtension = null, + string highSpeedInterconnectPlacement = null ) => Strategy.CreateResourceConfig( resourceGroup: resourceGroup, @@ -201,7 +202,8 @@ internal static ResourceConfig CreateVirtualMachineScale AllocationStrategy = skuProfileAllocationStrategy }, DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs ? true : (bool?)null, - OrchestrationMode = orchestrationMode + OrchestrationMode = orchestrationMode, + HighSpeedInterconnectPlacement = highSpeedInterconnectPlacement }; if (auxAuthHeader != null) { @@ -254,7 +256,8 @@ internal static ResourceConfig CreateVirtualMachineScale string securityPostureId = null, string[] securityPostureExcludeExtension = null, bool? enableProxyAgent = null, - bool? addProxyAgentExtension = null + bool? addProxyAgentExtension = null, + string highSpeedInterconnectPlacement = null ) => Strategy.CreateResourceConfig( resourceGroup: resourceGroup, @@ -353,7 +356,8 @@ internal static ResourceConfig CreateVirtualMachineScale AllocationStrategy = skuProfileAllocationStrategy }, DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs ? true : (bool?)null, - OrchestrationMode = orchestrationMode + OrchestrationMode = orchestrationMode, + HighSpeedInterconnectPlacement = highSpeedInterconnectPlacement }; if (auxAuthHeader != null) {