Creating virtual machines using virtual machine image

Creating virtual machines using virtual machine image requires you to specify either an existing operating system disk, or a virtual machine image. Virtual machine images have different provisioning settings depending on whether the source image is Windows or Linux-based. That being said, a signiicant portion of the coniguration options will be the same regardless of the operating system type. Within the management portal, you select the image name from the Gallery view, as Figure 1 shows.

Creating virtual machines using virtual machine image 1

FIGURE 1 The Gallery view for virtual machines

Using the Azure PowerShell cmdlets you can enumerate the available images using the Get-AzureVMImage cmdlet. This cmdlet will return all of the image information that is available (including some images that do not appear in the management portal). It can be quite overwhelming without applying some basic filters.

To only return images available for the Windows Server 2012 R2 Datacenter family, you can filter on the $_.ImageFamily property, as shown in the following example and Figure 2.

$imageFamily = “Windows Server 2012 R2 Datacenter”
Get-AzureVMImage | where { $_.ImageFamily -eq $imageFamily }

Creating virtual machines using virtual machine image 2

FIGURE 2 Enumerating available images by image family

The Azure PowerShell cmdlets use the ImageName property to specify the image to use during creation. You can take the previous example one step further by sorting the PublishedDate in descending order, and then select the ImageName to only return the latest ImageName for the requested image family as shown in the following example and Figure 3.

$imageFamily = “Windows Server 2012 R2 Datacenter”
$imageName = Get-AzureVMImage |
where { $_.ImageFamily -eq $imageFamily } |
sort PublishedDate -Descending |
select -ExpandProperty ImageName -First 1

Creating virtual machines using virtual machine image 3

FIGURE 3 Identifying the newest image by image family

When the image name has been determined, it is passed to the New-AzureQuickVM, or the New-AzureVMConig cmdlet with the ImageName parameter

This article is a part of 70-533 Implementing Microsoft Azure Infrastructure Solutions Prep course.

More Articles included in this course are

Creating an Azure website

Creating an Azure website using  Portal, Powershell and CLI Creating an Azure website on Microsoft Azure Cloud starts with creating ...
Read More

Deployment slots in Azure website

Defining deployment slots in Azure website Deployment slots in Azure website are collection of individual Azure website linked to your ...
Read More

Publishing an Azure website

Publishing an Azure website using various methods For publishing an Azure website, the web application or code needs to be ...
Read More

WebJobs in Azure website

Introduction to WebJobs in Azure website and Deployment using Portal and Powershell Web Jobs in Azure websites are exclusive applications ...
Read More

Azure website settings

Introduction to Configuring the azure website settings The first step you will need to follow for an Azure website is to ...
Read More
Loading...

Practice Tests in this course are

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 1

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 1 This page shows the instructions for Exam 70-533 ...
Read More

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 2

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 2 This page shows the instructions for Exam 70-533 ...
Read More

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 3

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 3 This page shows the instructions for Exam 70-533 ...
Read More

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 4

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 4 This page shows the instructions for Exam 70-533 ...
Read More

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 5

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 5 This page shows the instructions for Exam 70-533 ...
Read More
Loading...