Reader small image

You're reading from  Learning Microsoft Azure Storage

Product typeBook
Published inNov 2017
PublisherPackt
ISBN-139781785884917
Edition1st Edition
Tools
Right arrow

Azure Storage for VMs

In this chapter, we will go through the relationship between Azure Virtual Machines (VMs) and Azure Storage. The chapter will kick off by introducing Azure VMs, moving forward to how to create these VMs, then you will learn about the storage considerations you need to take care of to get a better design for your environment, and even how to capture images from these VMs. Finally, you will learn how to automate these tasks.

The following topics will be covered:

  • An introduction to Azure VMs
  • Creating an Azure VM
  • Storage considerations for Azure VMs
  • Capturing VMs
  • Automating your common tasks with Azure VM storage

An introduction to Azure VMs

Azure VMs is the most well-known, usable, and oldest service available in Azure. Azure VMs provides the deployment of different flavors of Windows and Linux VMs.

Using Azure VMs provides you with full control over the configuration and management of a VM. Management refers to installing software, patching, and even maintaining a VM.

It is no surprise that, when you create a normal VM, whether it is on-premises or off-premises, you need storage for the VM's virtual hard disk. That leads us to understanding that Azure VMs use Azure Storage as a storage provider, and that is what I am going to cover in detail throughout this chapter.

But before getting started and getting our hands dirty with playing with Azure VMs, I'm going to illustrate some confusing points regarding them.

Fortunately, Microsoft bills VMs per minute, not per hour, therefore...

Creating an Azure VM

Before diving further into Azure VMs and their concerns with Azure Storage, let's create an Azure VM:

  1. Open the Azure portal and navigate to Virtual machines, as shown in the following screenshot:
Figure 3.1: Azure VMs blade overview
  1. Click on Create Virtual Machines to select an OS image for the VM.
  2. For the sake of this demonstration, I'll select Windows Server 2016 Datacenter, as shown in the following screenshot:
Figure 3.2: Selecting the image that is going to be used on the VM
  1. Once you click on the image, you will be asked to determine the deployment model, as shown in the following screenshot:
Figure 3.3: Selecting the VM deployment model
  1. Once you specify the deployment model, a new blade will pop up, and you will be asked to fill in the fields, as shown in the following screenshot:
Figure 3.4: Filling in Azure VM basic...

Storage considerations for Azure VMs

As mentioned earlier, Azure VMs depend on Azure Storage to function properly. Therefore, let's go through some storage considerations for Azure VMs for a better design for your environment.

Managed versus unmanaged disks

As mentioned earlier, managed disks save lots of effort and even support Premium Storage and Standard Storage.

Managed disks key points

Let's cover some of the managed disks key points that may influence your design and even your decision when it comes to selecting whether to use managed disks or not:

  • Simplicity...

Capturing VMs

Templates … Templates … Templates…

That is what we always seek when we need to create a machine with the same specifications regularly, especially in dev/test environments.

So, what would you do if you wanted to have an image of a VM that you could use later to recreate other VMs without having to do all the steps you did to get this VM up and running?

The answer is very easy to say and easily implemented. You only need to capture the VM, considering that the image will include all the disks added to that VM.

There are two ways to capture the VM from the Azure portal. The first is, if you use managed storage, you will directly capture the image from the VM blade. But if you use unmanaged storage, you will navigate to Images and start capturing the VM.

But before doing any of that, you have to sysprep the VM first.

...

Automating the tasks

As usual at the end of each chapter, we get our hands dirty with automation.

Creating an Azure VM using PowerShell

Creating an Azure VM is one of the most common tasks on Azure, so let's get started.

First off, let's create the resources that make up the VM, and let's kick off with network resources.

Network resources

Every VM requires some network resources to be able to function properly, such as a subnet, virtual network, public IP address, and network security group (NSG), as shown in the following cmdlets:

$Subnet = New-AzureRmVirtualNetworkSubnetConfig...

Further information

Azure VMs and Azure Storage could not be covered entirely in this chapter, however, it has covered most of the common topics you will deal with. For further information about Azure Storage for VMs, check out the following URLs:

Summary

This has been a long and productive chapter, full of information and details. I've covered the most important topics about the relationship between Azure Storage and Azure VMs, which included what Azure VMs are, how to create them, and the key points to be considered about Azure Storage when creating VMs.

In the next chapter, we will cover a completely new topic--Azure SQL databases, how to work with them, and how to design a good solution in Azure.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Learning Microsoft Azure Storage
Published in: Nov 2017Publisher: PacktISBN-13: 9781785884917
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime