Tải bản đầy đủ
Objective 2.1: Deploy workloads on Azure virtual machines

Objective 2.1: Deploy workloads on Azure virtual machines

Tải bản đầy đủ

This objective covers how to:
■■

Identify supported workloads

■■

Create a Windows VM

■■

Create a Linux VM

■■

Create a SQL Server VM

Identifying supported workloads
A workload describes the nature of a solution, whether it is an application that runs on
a single machine or it requires a complex topology that prescribes the operating system
used, the additional software installed, the performance requirements, and the networking environment. Azure enables you to deploy a wide variety of VM workloads, including
“bare bones” VM workloads that run various versions of Windows Server and Linux; database
and big-data workloads (such as Microsoft SQL Server, IBM DB2, Couchbase, Cloudera, and
Hortonworks Data Platform); complete application infrastructures (for example, those requiring server farms or clusters like SharePoint, Biztalk Server, SQL Server AlwaysOn, and SAP);
workloads that provide security and protection (such as antivirus, intrusion detection systems,
firewalls, data encryption, and key management); and workloads that support developer
productivity (such as the Windows 7 and Windows 8 client operating system, Visual Studio, or
the Java Development Kit).
There are two approaches to identifying supported Azure workloads. The first is to
determine whether the workload is already explicitly supported and offered through the
Marketplace, which provides a large collection of free and for-pay solutions from Microsoft
and third parties that deploy to VMs. The Marketplace also offers access to the VM Depot,
which provides a large collection of community provided and maintained VMs. The VM configuration and all the required software it contains on the disk (or disks) is called a VM image.
The second approach is to compare the requirements of the workload you want to deploy
directly to the published capabilities of Azure VMs or, in some cases, to perform proof of
concept deployments to measure whether the requirements can be met. The following is a
representative, though not exhaustive, list of the requirements you would typically need to
take into consideration:
■■

CPU and RAM memory requirements

■■

Disk storage capacity requirements, in gigabytes (GB)

■■

92

Disk performance requirements, usually in terms of input/output operations per
second (IOPS) and data throughput (typically in megabytes per second)

■■

Operating system compatibility

■■

Networking requirements

■■

Availability requirements

■■

Security and compliance requirements

CHAPTER 2

Create and manage virtual machines

This section covers what is required to deploy the “bare bones” VM (that is, one that has
the operating system and minimal features installed) that can serve as the basis for your more
complex workloads and describes the options for deploying a pre-built workload from the
Marketplace.

Creating a VM
Fundamentally, there are two approaches to creating a new VM. You can upload a VM that
you have built on-premises, or you can instantiate one from the pre-built images available
in the Marketplace. This section focuses on the latter and defers coverage of the upload
scenario until the next section.

Creating a Windows Server VM (existing portal)
To create a Windows Server VM in the management portal, complete the following steps:
1. Navigate to the management portal accessed via https://manage.windowsazure.com.
2. Click New on the command bar, and then click Compute, Virtual Machine, From Gallery.
3. Select a Windows Server image (such as Windows Server 2012 R2 Datacenter) from

which to create the VM, and then click the right arrow.
4. Provide a name, tier, instance size, and administrator credentials, and then click the

right arrow.
5. On the Virtual Machine Configuration screen, click Create A New Cloud Service, and

then provide a DNS name, region, and storage account.
6. Leave the availability set value configured to none. (Availability sets are covered later in

the chapter.) Leave the endpoints at their defaults, and click the right arrow.
7. Leave the Install VM Agent check box selected, and leave the remaining extensions

cleared.
8. Click the check mark to provision the Windows Server VM.

Creating a Windows Server VM (Preview portal)
To create a Windows Server VM in the Preview portal, complete the following steps:
1. Navigate to the management portal accessed via https://portal.azure.com.
2. Click New on the command bar.
3. To navigate to the Marketplace, click the Everything link located near the upper-right

corner of the blade that appears.
4. On the Marketplace blade, select Virtual Machines.
5. On the Virtual Machines blade, select Windows Server in the Recommended area.



Objective 2.1: Deploy workloads on Azure virtual machines

CHAPTER 2

93

6. On the Windows Server blade, select the image for the version of Windows Server you

want for your VM (such as Windows Server 2012 R2 Datacenter).
7. Click Create.
8. On the Create VM blade, provide a host name, user name, and password for the new

VM.
9. Review the Pricing Tier, Optional Configuration, Resource Group, Subscription, and

Location settings and change as necessary.
10. Click Create to provision the Windows Server VM.

Creating a Linux VM (existing portal)
To create a bare bones Linux VM in the management portal, complete the following steps:
1. Navigate to the management portal accessed via https://manage.windowsazure.com.
2. Click New on the command bar, and then click Compute, Virtual Machine, From Gallery.
3. In the navigation pane, select Ubuntu.
4. Choose an Ubuntu Server image (such as Ubuntu Server 14.04 LTS) from which to cre-

ate the VM, and then click the right arrow.
5. Provide a name, tier, instance size, and administrator user name.
6. Clear the Upload Compatible SSH Key For Authentication check box.
7. Select the Provide A Password check box, and provide the password for the

administrator. Click the right arrow.
8. On the Virtual Machine Configuration screen, select Create A New Cloud Service, and

enter a DNS name, region, and storage account.
9. Leave the availability set value configured to none. (Availability sets are covered later in

the chapter.)
10. Leave the endpoints at their defaults, and click the right arrow.
11. Leave the listed extensions cleared.
12. Click the check mark to provision the Ubuntu Server Linux VM.

Creating a Linux VM (Preview portal)
To create a bare bones Linux VM in the Preview portal, complete the following steps:
1. Navigate to the management portal accessed via https://portal.azure.com.
2. Click New on the command bar.

94

CHAPTER 2

Create and manage virtual machines

3. To navigate to the Marketplace, click the Everything link located near the upper-right

blade that appears.
4. On the Marketplace blade, select Virtual Machines.
5. On the Virtual Machines blade, select Ubuntu Server in the Recommended area.
6. On the Ubuntu Server blade, select the image for the version of Ubuntu Server you

want for your VM (such as Ubuntu Server 2014.04 LTS).
7. Click Create.
8. On the Create VM blade, provide a host name and user name for the new VM.
9. Use an external tool to generate a public SSH key, and then copy and paste it in the

SSH Public Key text box. See the More Info readeraid titled, “SSH key generation” for
instructions on how to do this.
10. Review the Pricing Tier, Optional Configuration, Resource Group, Subscription, and

Location settings and change as necessary.
11. Click Create to provision the Ubuntu Server VM.
MORE INFO  SSH KEY GENERATION

To create the SSH public key that you need to provision your Linux VM, run ssh-keygen on
a Mac OSX or Linux terminal, or, if you are running Windows, use Puttygen. A good reference for the latter, if you are not familiar with it, is available at http://azure.microsoft.com/
en-us/documentation/articles/virtual-machines-linux-use-ssh-key/.

Creating a SQL Server VM (existing portal)
The steps for creating a VM that has SQL Server installed on top of Windows Server are
identical to those described earlier for provisioning a Windows Server VM using the existing
portal. The only difference surfaces in the third step: instead of selecting a Windows Server
image, select a SQL Server image (such as SQL Server RTM 2014 Enterprise).

Creating a SQL Server VM (Preview portal)
The steps for creating a VM that has SQL Server installed on top of Windows Server are
identical to those described earlier for provisioning a Windows Server VM using the Preview
portal. The only differences surface in the fifth and sixth steps: instead of selecting a Windows
Server from the Recommended area, select SQL Server from the Database Servers area, and
on the SQL Server blade, select the SQL Server version you want (such as SQL Server RTM
2014 Enterprise).



Objective 2.1: Deploy workloads on Azure virtual machines

CHAPTER 2

95

Thought experiment
Complex topologies
In this thought experiment, apply what you’ve learned about this objective. You can
find answers to these questions in the “Answers” section at the end of this chapter.
Assume you are accustomed to running SQL Server AlwaysOn Availability Groups
on-premises. This form of SQL Server deployment requires a cluster of three
machines along with a domain controller (with primary and secondary instances).

1. How would you determine whether the scenario represents a supported workload for Azure?

2. What would be the least labor-intensive way to deploy the scenario to Azure if it
is supported?

Objective summary
■■

■■

■■

■■

■■

There are two approaches to identifying supported workloads in Azure: looking for
explicit support by a listing in the Marketplace and performing a manual comparison
of the workload requirements against the capacities of VMs.
New VMs can be created by uploading a VM you have already created on-premises
or by instantiating one from a selection of pre-built images that are available in the
Marketplace.
Azure supports the creation of “bare-bones” VMs that provide just Windows or Linux
operating system from pre-built images available in the Marketplace.
The Marketplace provides the ability to provision single VMs with pre-configured
applications. The example shown in this chapter provisions SQL Server in a VM.
The Marketplace provides images that can configure a complex topology consisting of
multiple VMs, such as a SQL Server AlwaysOn or a SharePoint farm.

Objective review
Answer the following questions to test your knowledge of the information in this objective.
You can find the answers to these questions and explanations of why each answer choice is
correct or incorrect in the “Answers” section at the end of this chapter.
1. Which of the following are true regarding the types of workloads that you can deploy

from the Marketplace? (Choose all that apply.)
A. Single instance virtual machines
B. Linux virtual machines
C. Clusters of virtual machines
D. None of the above
96

CHAPTER 2

Create and manage virtual machines

2. Which of the following is not true about the Marketplace?
A. All images are community provided.
B. Some of the images have no additional costs beyond the Azure VM pricing.
C. Some of the images have additional costs for the software they provide.
D. There is a mixture of first-party, third-party, and community images.
3. Which of the following is a supported VM workload? (Choose all that apply.)
A. Running Visual Studio (with an MSDN account)
B. Running Windows 8
C. Running Ubuntu
D. Running the Java Development Kit

Objective 2.2: Create and manage a VM image or
virtual hard disk
The previous section covered how to create VMs by using an image from the Marketplace.
But what if you already have the VHDs for an on-premises VM that you would like to use as
the basis for future VMs in Azure? Alternately, what if you have already created a VM and
have its VHD disks in Azure Storage in one region (for example, in the West US region) but
want to create the VM in another region (for example, in the Japan West region)? To answer
these questions, this section examines the definition of a VM image more closely, compares it
to a disk, and examines how images and disks are managed.

This objective covers how to:
■■

Create specialized and generalized VM images

■■

Upload VHDs to Azure

■■

Copy images between storage accounts

Creating specialized and generalized VM images
Before getting into the details, you should understand a few important concepts. The first
is the relationship between virtual hard drives (VHDs), VM disks, and VM images. On a high
level, VHDs are ultimately the file format a running VM uses to store its data. These VHDs
must be packaged into disks so that they can be attached to a VM. When your VM is provisioned, you can create a VM image that captures all the details about the VM, its disks, and
VHDs and creates a template that you can use to create new VM instances.
Creating this template generates a question: Should the operating system settings in these
VM templates be exact copies of the VM instance, including things like the machine identifiers


Objective 2.2: Create and manage a VM image or virtual hard disk

CHAPTER 2

97

and the administrator credentials, or can some of these settings be “generalized” or “reusable”
so that they can be changed when the VM instance is provisioned from a template?
This notion surfaces important operating system disk terminology: specialized images and
generalized images. Think of these concepts as two different scenarios in which you might
provision a VM.
In the specialized image scenario, you are interested in creating a golden copy of a VM, or
in other words, a snapshot, from which you can create exact duplicates of the VM. You might
stop the VM, capture a snapshot of it in an image, re-create that exact VM somewhere else,
and then turn on the VM again. Any time you provision an instance of the image, it maintains
the identity it had at the time of the snapshot. It is like turning on the original VM from the
point in time at which the snapshot was taken, except that any modifications you make as the
VM runs do not alter the image from which it was created.
Compare this with the generalized images scenario, where you want to turn the VM you
have created into a template from which you can stamp out new cloned instances of the VM,
each of them unique with respect to certain settings in the operating system. For example, to
scale out a cluster, you add new instances of the template VMs, each of them similarly configured but uniquely identified. In this case, each instance has its own identity and is therefore
slightly different. The instances identify themselves as “VM-A,” “VM-B,” and “VM-C” instead
of always being “VM-A.” In fact, when you create VMs from images available in the Marketplace, you utilize generalized images.
A VM created from the Marketplace consists of a set of VHDs—an operating system disk
and zero or more data disks are attached to the VM. Each of these disk VHDs were created
from an image, which is also a VHD. So what is the difference between an image and a disk?
With an understanding of the difference between specialized and generalized images, you
can consider the steps necessary to create these two forms of images.
At the highest level, if you are starting with a VM created in Azure (such as one from the
Marketplace), you follow these steps:
1. Create the source VM. Start with a VM you created from an existing image, such as

one from the Marketplace.
2. Generalize the VM. To create a generalized image, you must take specific steps to

prepare the VM before you create an image from it. You do not perform these steps to
create a specialized VM.
3. Capture the VM image. With the VM in the desired state, take a snapshot of it by

capturing a VM image.
4. Instantiate instances of the image. With an image ready, you can launch specialized

instances that act like a copy of the original, right down to operating system details like
the administrator user name and password. Generalized images start up differently as
they configure themselves to take on new identities during their first start up and can
be configured to draw their administrator user name and password from an Azureprovided configuration during startup.
98

CHAPTER 2

Create and manage virtual machines