Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ public void TestVirtualMachineScaleSetNewEncryptionAtHost()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetEncryptionAtHost");
}

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2537,6 +2537,73 @@ function Test-VirtualMachineScaleSetEncryptionAtHost
}
}

<#
.SYNOPSIS
create a VMSS in orchestration mode then add a vm to it
#>
function Test-VirtualMachineScaleSetOrchestrationVM
{
# Setup
$rgname = Get-ComputeTestResourceName

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

# New VMSS Parameters
$vmssName = 'vmssOrchestrationMode' + $rgname;
$vmName = 'vm' + $rgname;
$domainName = 'domain' + $rgname;
$adminUsername = 'Foo12';
$adminPassword = $PLACEHOLDER;

$securePassword = ConvertTo-SecureString $adminPassword -AsPlainText -Force;
$cred = New-Object System.Management.Automation.PSCredential ($adminUsername, $securePassword);


$VmssConfigWithoutVmProfile = new-azvmssconfig -location $loc -platformfaultdomain 1
$VmssWithoutVmProfile = new-azvmss -resourcegroupname $rgname -vmscalesetname $vmssName -virtualmachinescaleset $VmssConfigWithoutVmProfile

$vm = new-azvm -resourcegroupname $rgname -location $loc -name $vmname -credential $cred -domainnamelabel $domainName -vmssid $VmssWithoutVmProfile.id

Assert-AreEqual $VmssWithoutVmProfile.id $vm.virtualmachinescaleset.id

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there a way to view the instance view of vmss to see this vm added to the vmss?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Theodore Chang (@grizzlytheodore) , No. This functionality does not exist in PS and CLI due to how the feature is setup on the server side.

# Test PlatformFaultDomainCount parameter
$vmssNameSimple = $vmssname + "Simple";
$vmssNameDefault = $vmssname + "Default";
$platformFaultDomainCount = 5;
$platformFaultDomainCountConfig = 3;
$zone = "2";
$domainNameLabel = $rgname + "domainlabel";
$VmSku = "Standard_D2s_v3";


$vmssConfigFaultDomain = New-AzVmssConfig -Location $loc -PlatformFaultDomainCount $platformFaultDomainCountConfig;
Assert-NotNull $vmssConfigFaultDomain;
Assert-AreEqual $vmssConfigFaultDomain.PlatformFaultDomainCount $platformFaultDomainCountConfig;

# PlatformFaultDomainCount in New-AzVmss DefaultParameterSet
$vmssDefault = New-AzVmss -Name $vmssNameDefault -ResourceGroup $rgname -VirtualMachineScaleSet $vmssConfigFaultDomain;
Assert-NotNull $vmssDefault;
Assert-AreEqual $vmssDefault.PlatformFaultDomainCount $platformFaultDomainCountConfig;

# PlatformFaultDomainCount in New-AzVmss SimpleParameterSet
$vmssSimple = New-AzVmss -Name $vmssNameSimple -ResourceGroup $rgname -Credential $cred -Zone $zone -VmSize $VmSku -DomainNameLabel $domainNameLabel -PlatformFaultDomainCount $platformFaultDomainCount;
Assert-NotNull $vmssSimple;
Assert-AreEqual $vmssSimple.PlatformFaultDomainCount $platformFaultDomainCount;



}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
testing encryptionAtHost cmdlet for
Expand Down Expand Up @@ -2582,4 +2649,4 @@ function Test-VirtualMachineScaleSetAssignedHost
# Cleanup
Clean-ResourceGroup $rgname
}
}
}
Loading