Skip to content

Add LicenseType parameter to New-AzureVMConfig and BYOL test #6

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 1 commit into from
Apr 25, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.ServiceManagementTests\TestMigrationAbortAzureVNet.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.ServiceManagementTests\TestNewAzureVMWithBYOL.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestAddAzureTrafficManagerEndpoint.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,3 +773,69 @@ function Test-MigrationAbortAzureVNet
# Cleanup
Remove-AzureVNetConfig
}


function Test-NewAzureVMWithBYOL
{
# Virtual Machine cmdlets are now showing a non-terminating error message for ResourceNotFound
# To continue script, $ErrorActionPreference should be set to 'SilentlyContinue'.
$ErrorActionPreference='SilentlyContinue';

# Setup
$location = "Central US";
$storageName = "mybyolosimagerdfe";

$vm1Name = "vm1";
$vm2Name = "vm2";
$svcName = Get-CloudServiceName;

$vmSize = "Small";
$licenseType = "Windows_Server";
$imgName = getAssetName;
$userName = "User" + $svcName;
$pass = "User@" + $svcName;

$media1 = "http://mybyolosimagerdfe.blob.core.windows.net/myvhd/" + $svcName + "0.vhd";
$media2 = "http://mybyolosimagerdfe.blob.core.windows.net/myvhd/" + $svcName + "1.vhd";

Set-CurrentStorageAccountName $storageName;

Add-AzureVMImage -ImageName $imgName `
-MediaLocation "https://mybyolosimagerdfe.blob.core.windows.net/vhdsrc/win2012-tag0.vhd" `
-OS "Windows" `
-Label "BYOL Image" `
-RecommendedVMSize $vmSize `
-IconUri "http://www.bing.com" `
-SmallIconUri "http://www.bing.com" `
-ShowInGui;

# Test
New-AzureService -ServiceName $svcName -Location $location;

$vm1 = New-AzureVMConfig -Name $vm1Name -ImageName $imgName -InstanceSize $vmSize `
-LicenseType $licenseType -HostCaching ReadWrite -MediaLocation $media1;

$vm1 = Add-AzureProvisioningConfig -VM $vm1 -Windows -Password $pass -AdminUsername $userName;

$vm2 = New-AzureVMConfig -Name $vm2Name -ImageName $imgName -InstanceSize $vmSize `
-LicenseType $licenseType -HostCaching ReadWrite -MediaLocation $media2;

$vm2 = Add-AzureProvisioningConfig -VM $vm2 -Windows -Password $pass -AdminUsername $userName;

New-AzureVM -ServiceName $svcName -VMs $vm1,$vm2

$vm1result = Get-AzureVM -ServiceName $svcName -Name $vm1Name;
$vm2result = Get-AzureVM -ServiceName $svcName -Name $vm2Name;

Update-AzureVM -ServiceName $svcName -Name $vm1Name -VM $vm1result.VM;

$vm1result = Get-AzureVM -ServiceName $svcName -Name $vm1Name;
$vm2result = Get-AzureVM -ServiceName $svcName -Name $vm2Name;

Remove-AzureService -ServiceName $svcName;

Remove-AzureVMImage -ImageName $imgName;

# Cleanup
Cleanup-CloudService $svcName
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,14 @@ public void TestMigrationAbortAzureVNet()
{
this.RunPowerShellTest("Test-MigrationAbortAzureVNet");
}

[Fact]
[Trait(Category.Service, Category.ServiceManagement)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.AcceptanceType, Category.BVT)]
public void TestNewAzureVMWithBYOL()
{
this.RunPowerShellTest("Test-NewAzureVMWithBYOL");
}
}
}
Loading