How to Upload a Virtual Machine to the Cloud for Microsoft Azure
How to Upload a Virtual Machine to the Cloud for Microsoft Azure
22nd Jan, 2017
Introduction
This post will describe how to create and manage a virtual machine (VM) in Microsoft Azure. You will see a step by step guide on how to upload your local virtual machine to Microsoft Azure Cloud and create a fully functional virtual machine on the cloud.
Step 1: Check-out the Container created in the Storage
In order to upload the Virtual Machine, you need to have a container inside the storage. If you do not have that already you will need to create one.
From the navigation pane, click on Storage.
Click on the storage created inside which you have created container.
Click on the container created for your uploaded VHDs <uploadedvhds>.
Step 2: Install Azure-Powershell
You would need a machine to upload .vhd file, in this case, we will use Azure PowerShell. If you do not have Azure PowerShell, you will need to download it.
Click on the downloaded .msi file to install Azure-PowerShell.
Click on the License Agreement check box.
Click on Install.
Step 3: Upload .Vhd File
When you upload .vhd file, you can place it anywhere within your blob storage.
Run Microsoft Azure PowerShell.
PowerShell console will open up. Type ‘Add-AzureAccount’ and press enter.
Note: Type ‘help azure’ to get all the cmdlets.
You will be prompted to sign in to your Microsoft account. Type your email address and password then press enter.
Type a command with the following syntax and press enter:Add-AzureVhd [ -Destination ] [ -LocalFilePath ]Where:· Add-AzureVhd cmdlet allows you to upload on-premises virtual hard disks (in .vhd file format) to a blob storage account as fixed virtual hard disks.· -Destination specifies the URL of a blob in Blob Storage. The parameter supports SAS URL, although patching scenarios destination cannot be an SAS URL.· -LocalFilePath specifies the path to the local .vhd file.In our case we will type:Add-AzureVhd –Destination https://vmsmra.blob.core.windows.net/uploadedvhds/vsalm.vhd -LocalFilePath “E:VisualStudio2013 Update3 ALMWMIv2Virtual Hard Disks2012R2Eval.vhd”
It would calculate MD5 Hash, detect empty blocks then upload vhd file. The total elapsed time can be around 1.5 hours, of course it depends on your
internet speed and the size of the VHD.
Step 4: Check-out uploaded .Vhd File in the Container
The uploaded .vhd file would be saved in the designated container inside the storage.
From the navigation pane, click on Storage.
Click on the storage <vmsmra>.
Click on the container <uploadedvhds> to view uploaded VHDs.
You can now view your uploaded vhd <vsalm.vhd>.
Step 5: Create a Disk from a VHD
After you transfer .vhd file from your local machine to the container in Microsoft Azure, you must create a disk.
From the command bar at the bottom of the Portal screen, click on Create.
Under Virtual Machines, click on Disks.
From the command bar at the bottom of the Portal screen, click on Create.
A pop up window <Create a disk from a VHD> will be displayed. In Name field, type a unique disk name. In this case we have named it VSALMDisk.
In VHD URL field, click on the folder icon.
Browse to the container location. Click on vmsmra.
From the containers within vmsmra, click on uploadedvhds.
Click on uploaded vhd <vsalm.vhd>.
Click on Open.
Click on The VHD contains an operating system check box.
Note: In Operating System Family, select your OS. In this case we will select Windows.
Click on check mark.
After few minutes, it will show up the notification that the disk has been successfully created.
You can then see the disk created <VSALMDisk> in the list of disks.
Step 6: Create a New Virtual Machine using From Gallery Method
The Microsoft Azure Portal provides two basic methods to create a new virtual machine: Quick Create and From Gallery. We will be using the From Gallery Method.
Under Virtual Machines, click on Instances.
From the command bar at the bottom of the Portal screen, click on New.
A pop up window will open up. Under Virtual Machine options, click on From Gallery.
On the Choose an Image page, click on My Disks.
Click on the disk you created <VSALMDisk>.
Click on proceed arrow icon.
On the first Virtual Machine Configuration page, specify the name for the virtual machine in Virtual Machine Name field. In this case we have used VSALM-mra.Note: In Tier field, make sure Standard is selected.
Note: In Tier field, make sure Standard is selected.
Under the Size field, select D2 (2 cores, 7 GB memory).
Click on the proceed arrow icon.
On the second Virtual Machine Configuration page, set the following virtual machine attributes as shown in figure.
Cloud Service – This is a cloud service container for virtual machines that you create. You can create a new cloud service container for a single virtual machine or place multiple virtual machines in the same cloud service for load balancing.
Cloud Service DNS Name – This is the global DNS name that is used to contact the virtual machine.
Region/Affinity Group/Virtual Network – This is the Region where you want the virtual machine resources to be physically deployed. The Affinity Group attribute allows Azure to keep all services in a group physically close. The Virtual Network attribute allows you to define the network to connect to the virtual machine.
Availability Set – This is used to define a group of virtual machines that are deployed across fault and update domains.
Endpoints – These are the communication ports through which the virtual machine can be contacted.
Click on proceed arrow icon.
On the third Virtual Machine Configuration page, set the following virtual machine attributes as shown in figure.
VM Agent – The VM Agent installs extensions that enhance the interaction with the virtual machine. This option cannot be disabled when installing a Linux image. For Windows data disks and Linux images and disks, a version of the VM agent that supports extensions must already be installed in the operating system.
Configuration Extensions – These are extensions that enhance the management of the virtual machine, including the execution of custom scripts.
Security Extensions – These are extensions that enhance the security of the virtual machine, such as antivirus support.
Click on check mark.
You can see near the command bar at the bottom left of the Portal screen, the Virtual Machine being created. It will first create the virtual machine, provision the virtual machine and then install extensions in the virtual machine.
After a few minutes, it will show up the notification that the virtual machine has been successfully started.
You can then see the new virtual machine created in the list of VM Instances.
Step 7: Connect to Windows Azure Virtual Machine
In the Azure classic portal, you use the Connect button to start a Remote Desktop session and log on to a Windows VM.
From the navigation pane, click on Virtual Machines.
Under Virtual Machines, click on the name of the virtual machine.
From the command bar at the bottom of the Portal screen, click on Connect.
Click on OK. It creates and downloads a Remote Desktop Protocol file (.rdp file).
Open downloaded .rdp file from your local machine.
In the Windows Security window, type the credentials for an account on the virtual machine.
Click on OK.
You can now access the machine of Brian Keller that you uploaded in Windows Azure.
Conclusion
The Microsoft Azure Portal provides multiple, simple methods to create and manage virtual machines in the Microsoft public cloud. Using the Quick Create method, you can quickly create new virtual machines and go back later to set more configuration options. Using the From Gallery method, you can fully customize the virtual machine configuration before deployment into the physical region as a standalone or load balanced service. Microsoft Azure virtual machines scale in processor, memory, and storage, allowing you to create virtual machines with a large number of cores & memory, and data disks up to 1 TB in size. As an added benefit, you can easily move a virtual machine created in Microsoft Azure to Hyper-V and back since both use the same virtualized hardware and VHD format. This allows you to quickly reconfigure services on premise or redeploy to the public cloud to adjust to changing business conditions.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptRejectRead Privacy Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.