You can define a virtual-machine configuration, and then create the virtual machine, as the following
sample code shows:
$newVM = New-AzureVMConfig
-name $vmname -Instance $instance -ImageName $osimage | Add-
AzureProvisioningConfig -Windows -AdminUsername $adminname -Password $password | Set-
AzureSubnet -SubnetNames $subnet
New-AzureVM -ServiceName $cloudservice -AffinityGroup $affinitygroup -VMs $newVM -VNetName
$vnet -DnsSettings $dns -WaitForBoot
Alternatively, you can create and configure a virtual machine in one step, as the following code sample
shows:
New-AzureQuickVM -Windows -ImageName $osimage -Location $location -Name $vmname
–ServiceName $svcName -InstanceSize $size -AdminUserName $adminname –Password $password
There are more configuration options if you use the
New-AzureVMConfig
and
New-AzureVM
cmdlets,
such as the ability to use a static internal IP address by using
Set-AzureStaticVNetIP
.
New-
AzureVMConfig
enables you to create more complex virtual-machine configurations, and then pass
those configurations to
New-AzureVM
.
Question:
In which situations would you choose to deploy Azure IaaS v1 virtual machines
instead of IaaS v2 virtual machines?

MCT USE ONLY. STUDENT USE PROHIBITED
Implementing Microsoft Azure Infrastructure Solutions
3-37
Lab B: Deploying IaaS v2 virtual machines by using Azure
Resource Manager templates
Scenario
You must use an Azure Resource Manager template to deploy two additional Linux virtual machines and
two additional Windows virtual machines that the ResDev application will use. The virtual machines
should be part of the ResDevRG resource group, to facilitate resource tracking. Linux virtual machines
should reside on the app subnet of the HQ-VNET virtual network, and Windows virtual machines should
reside on the web subnet of the HQ-VNET virtual network.
Objectives
After completing this lab, you must be able to:
•
Use Visual Studio and an Azure Resource Manager template to deploy IaaS v2 virtual machines.
•
Use Azure PowerShell and an Azure Resource Manager template to deploy virtual machines.
Lab Setup
Estimated Time: 25 minutes
Virtual machine:
20533C-MIA-CL1
User name:
Student
Password:
Pa$$w0rd
The virtual machine should be running from the previous lab.
Exercise 1: Using Visual Studio and an Azure Resource Manager template
to deploy IaaS v2 virtual machines
Scenario
You must use Visual Studio to deploy two Linux IaaS v2 virtual machines for use as app servers in the
ResDev app. You should name the servers ResDevApp1 and ResDevApp2. You have a deployment-
template solution and the deployment details for both virtual machines. You must deploy the two virtual
machines from Visual Studio, and then confirm that the virtual machines have been deployed successfully
by using Azure PowerShell.
The main tasks for this exercise are as follows:
1.
Use Visual Studio to deploy the Linux app server’s virtual machines.
2.
Use Azure PowerShell to validate the deployment of the app server’s virtual machines.
Task 1: Use Visual Studio to deploy the Linux app server’s virtual machines
1.


You've reached the end of your free preview.
Want to read all 588 pages?
- Summer '17