Creating and Managing Virtual Machines
This course will show you how to create and manage virtual machines in the Azure ecosystem.
By the end of this course, you'll have gained a firm understanding of the key components that comprise the Azure virtual machine ecosystem. Ideally, you will achieve the following learning objectives:
- How to create and manage virtual machines in the Azure environment.
- How to create and manage VM images, workloads, and more.
- How to monitor your Azure virtual machines.
This course is intended for individuals who wish to pursue the Azure 70-532 certification.
You should have work experience with Azure and general cloud computing knowledge.
This Course Includes
- 59 minutes of high-definition video.
- Expert-led instruction and exploration of important concepts surrounding Azure virtual machines.
What You Will Learn
- The concepts behind VM workloads.
- How to create and manage Azure VM images.
- Azure VM configuration management.
- Azure VM networking.
- How to scale Azure virtual machines.
- How to design and implement Azure VM storage.
- How to monitor your Azure virtual machines.
Hello and welcome back. This section covers how to manage storage within the context of a virtual machine. We'll cover four elements in this section. Firstly, we'll look at disk caching and then we'll discuss the planning for storage capacity. Third, we'll look at the Azure file service before finally looking at Geo Replication.
Let's quickly recap on the makeup of a standard virtual machine in terms of storage. We'll start by taking a fictional, physical machine stored in a rack in an Azure data center currently hosting three virtual machines. The physical machine is denoted here by the surrounding yellow box. Each of the three VM's comes by default with two disks, an OS disk and a Temp disk. The OS disk and any data disks you attach yourself is stored in an Azure blob which has a set of performance characteristics which we'll cover shortly. Meanwhile, the Temp disk is the physical disk used by the host machine. As such, it is shared across all three VM's. This means that the performance you receive on this drive is contended with by the other two virtual machines.
SSD backed disks are available in Azure too which are designed for high-performance scenarios, but note, as these disks are not stored on blobs, they're not replicated three times, etc. They are physical disks. Therefore, do not use them to store critical information. Let's discuss the performance characteristics of blob storage a little more and relate it to the classic VM disks.
Firstly, each disk is stored as a single page blob stored in a standard storage account. A standard virtual machine has roughly the limit of around 500 IOP's and a max rupert 60 megabytes per second. However, we can greatly increase this by striping multiple disks together, so 16 disks striped together you can achieve up to 8000 IOPs. Note, that the limits stated here are different depending on the size of the VM. For example, at the current time, only extra large and A7 VM's support two terabyte disks. Also note, that these figures are for standard storage accounts. Premium storage accounts have much higher limits per disk. For example, up to 5000 IOP's.
In this demo, we'll see how to stripe multiple data disks together in order to increase disk IO performance. I'm logged in to a virtual machine. Here, this one contains three data disks. I'm going to stripe them together using storage spaces so that we can get a maximum IO performance from them. I'll click on file and storage services. Then, from there, I'm going to click on storage pools and at the top right there's a drop-down that has tasks. We're going to create a new storage pool. And we'll call it striping demo. And we're going to add all of the disks and click create. We can right-click on this pool and create a new virtual disk. We're going to call it Striped Disk. We'll stick with simple storage for this one. We'll stick with fixed. We'll specify maximum size and click create. We've got the tick selected so that it will create a volume after this wizard has closed. And now a new volume wizard has started. Click next. It has our disk already selected from our server and the disk here, disk five. Select next. Stick with the defaults. We'll give it a drive letter of E. Click next, next and create. We click close. If we open up the explorer window we'll see that we have a new disk here, volume E, which is our new drive.
Azure offers the possibility of disk caching for disks in a virtual machine. Caching takes place either in memory on the host machine of the VM or on the physical, local disk in the host. There are three types of caching: Off, read only, read and write. With read and write, writes are written to a local cache and then persisted to the real blob at a later stage.
By default, OS disks are set to read and write whilst data disks are set to none. This is because random access reads are typically quicker when performed directly against storage, as is often the case with random data access. Conversely, sequential IO can often benefit from local caching, as is often the case with typical OS workloads.
Applying caching in the portal is simple. First, navigate to the virtual machine in the portal. Then, access the disks splayed from settings and select the disk you wish to configure. As you can see here, we have a 256 gigabyte disk which has host caching set to none.
Azure storage supports geo replication for blobs, however, be aware that geo replicated blobs are not synchronized across files. This means that a disk which uses striping or similar, such as storage pools, cannot guarantee repeated ordering of operations across data centers. This could result in corrupt data and as such, it is recommended to not use geo replication for VHDs.
The Azure file service allows sharing of files for our UNC file shares across virtual machines with support for a majority of the SMB protocol. This makes it an ideal tool for the lift and shift situations that rely on file shares, for example, shared data sources or output files such as logs. You can also use it to share common data across multiple VMs for purposes of administration, for example.
One added bonus is that Azure file service exposes files over a secure restful API. This is useful in hybrid solutions. Imagine an Azure cloud service that adds files to a share via the rest endpoint but files are consumed by an application running on a Windows VM through the SMB share. Shares created through the Azure file service can be shared across multiple VMs. This means that two virtual machines are backed on different storage accounts can access the same share. The two VMs can even live on different subscriptions. Note, that the Azure file service is backed by regular Azure storage so all files on the share get the usual three copies, higher availability and performance characteristics that blobs, tables and queues receive.
There are some restrictions with the Azure file service that's worth being aware of. Firstly, all VMs that access the same share must reside in the same region. It's also not suitable for a hybrid, on-premises cloud solution, even if connected over a virtual network. Lastly, it supports only a subset of the SMB 3.0 and 2.1 features. Some features that are not supported are listed here.
There are some hard limits on the Azure file service as well that is worth being aware of. Some of these are related to restrictions of the underlying Azure storage service. Each share has a maximum of five terabytes. You can not nest shares inside one another. There's a limit of 250 subdirectories in the share and each file cannot exceed one terabytes. Transfer rates per share are limited to 1000 IOPs. Creating a file share is simple to do. First, it can be achieved from the Azure portal. Simply select the storage account, navigate to the files area and then create the share. Alternatively, you can use PowerShell. First, create a handle to the storage account you wish to create the share in and then create the actual share itself. You can access a share in one of several ways. Firstly, you can remote desktop into a Windows VM in Azure and mount the share. Secondly, you can use AZCopy to both upload and download sets of files to or from the share. Next, you could use the PowerShell to upload and download files. Fourthly, there's the .NET SDK for Azure. This gives you a strongly typed object model from which you can navigate through a share and finally, there's the raw Azure Rest API.
In this demo, we'll see how to connect to an Azure file share in Windows. I'm here on the Azure portal and I want to show you how you can create an Azure file share. So, we select our storage account. In my case, I've selected the CA group 1769. On the overview pane, we can see that we've got the files section. We're going to click on that files section and from within here we're going to click files share and we're going to add a new files share. We'll say CA demo share for the name and we'll give it a quota of just one gigabyte. Click create and that's our final share created.
What we can do with this file share, is we can access some of the properties on here. So, for example, we can see that the URL will consist of CA group 1769 file corp windows.net. So, we need to retain that because we'll need that for one of our commands. Next thing we'll need to do is take a look at our keys because we'll need to copy our key so that we can use that in another command that we're going to do in PowerShell in a moment.
Let's go across to our Windows VM. Let's load up the IVP for that and connect to the machine and we're going to run a PowerShell command on that machine so we can set up our file share. I've logged into our VM and I've got a command that I'm ready to run into PowerShell which should set up our share. We've got the command key and we've got the flag of add and we're going to take that URL that we copied and we're going to use that as the share that we want to add. We're going to set it up with the user. So our user is the storage account URL without the file.corp.windows.net and then we need the pass which is the key that we copied. If we now copy all of this and paste it in this window. Now, our credential has been added. If we copy this group again because we're going to open up a command prompt and if we type into the command prompt, net use, we're gonna give it the y drive with the link to our share and now we can see that our share has been successfully set up.
If we open up Windows explorer, we can now see that we have our CA demo share set up ready and waiting for us to use. So, let's go ahead and use it. I'm going to create a folder and our folder is going to be called share and inside that folder we're going to add a file. We'll just add a text file and we'll just call it read me. I can now navigate to the Azure portal and access the file share and see the folder and the file inside. So, let's go and do that now. I'm here in the Azure portal and if I click on the file share, we can see that we have the folder called share and within there we have the file called readme.txt.
Stay tuned for the final section of this course where we'll cover how you can monitor your existing virtual machines.
About the Author
Isaac has been using Microsoft Azure for several years now, working across the various aspects of the service for a variety of customers and systems. He’s a Microsoft MVP and a Microsoft Azure Insider, as well as a proponent of functional programming, in particular F#. As a software developer by trade, he’s a big fan of platform services that allow developers to focus on delivering business value.