See Also Unfortunately, all VM configuration options and approaches cannot be covered in this
book. Please reference the Azure Virtual Machines documentation at
https://azure.microsoft.com/documentation/services/virtual-machines/
for additional detailed
information.
Disks
As mentioned earlier in this chapter, Azure VMs have two types of disks: an OS disk and a data disk.
These disks are durable (or persistent) disks backed by page blobs in Azure Storage. You have several
options on for configuring and using the disks for your VM.
Azure Storage uses page blobs to store the VHDs. For VMs that use Standard storage, the VHD is
stored in a sparse format. This means that Azure Storage charges apply only for data within the VHD
87
CHAPTER 3 | Azure Virtual Machines
that has actually been written. Because of this, it is recommended that you use a quick format when
formatting the disks. A quick format will avoid storing large ranges of zeros with the page blob, thus
conserving actual storage space and saving you money. However, if the VM uses Premium storage,
you are charged for the full disk size. Meaning, if you attach a P20 disk (which has a size of 512 GB) to
a VM and allocate 300 GB for the drive, you are charged the full price for the P20 disk (not just the
space used or allocated). Therefore, it is usually wise to allocate the full size for the drive because
you’re charged for it anyway
Disk caching
Azure Virtual Machines has the ability to cache access to OS and data disks. Caching potentially can
reduce transactions to Azure Storage and can improve performance for certain workloads. There are
three disk cache options: Read/Write, Read Only, and None.
The OS disk has two cache options: Read/Write (default) and Read Only.
The data disk has three cache options: Read/Write, Read Only, and None (default).
You should thoroughly test the disk caching configuration for your workload to ensure it meets your
performance objectives.
Attach a disk
To add a data disk to a VM, you can start with a new, empty disk or upload an existing VHD. Either can
be done using the Azure portal (or using Azure PowerShell or the Azure CLI).
By browsing to the Disks options in the Settings menu, as seen in Figure 3-10, you can view all the OS
and data disks that are attached to the current VM. This view also allows you to see the disk type
(Standard or Premium), size, estimated performance, and cache setting.
Figure 3-10 Number and size of disks.
To create and attach a new disk, first click the Disks options in the Settings menu to open the Disks
blade. On this blade, you will be able to attach a new disk or attach an existing disk.
88
CHAPTER 3 | Azure Virtual Machines
To attach a new disk, click Attach New. From the resulting Attach New Disk blade, as seen in Figure 3-
11, you will be able to provide several key settings:
Do'stlaringiz bilan baham: |