Microsoft Azure publishes OS image Inheritance products: New VM images

Source: Internet
Author: User
Keywords Azure azure os images VM images legacy products

Let's cheer! With the recent release of the Microsoft Azure runtime, we are delighted to announce the legacy product of the OS Image: The new VM image. Wait a minute... Some people may think it sounds familiar. Yes, this feature is included in many of the exciting new features introduced at the San Francisco Build developer conference one months ago. The engineering team has been working on the release of this new feature, and I'm happy to start publishing a series of articles about what this feature is, how it works, and all the details and practical content.

In a nutshell, you can consider a VM image as a more comprehensive Microsoft Azure virtual machine image. The improved new VM image contains a complete definition of virtual machine storage, including OS disks and all data disks. This feature captures the disk properties (such as host caching) that are required to deploy the VM on a reusable unit. Metadata and pointers to the VHD set (one VHD per disk) are stored as page blobs in Azure storage, similar to the OS image, which is a collection of these metadata and pointers.

Now, you might think that a VM image is similar to an OS image. Actually you are right! A VM image that contains a single VHD, if it has a generic operating system, is actually the OS image that you are now familiar with. Over time, you'll find that the VM image will be the mainstream of Microsoft Azure virtual machines.

There are two types of VM images-a generic VM image and a dedicated VM image, each of which has its own purpose. The generic VM image contains an OS disk, as the name implies, the OS disk has been generalized (you run Sysprep on Windows, you perform ' waagent–deprovision ' on Linux), and need to be supplied at deployment time. Today's OS images are universal. This type of VM image is designed to be a "model" for quickly creating similar virtual machines, such as extending the front end of your production application horizontally, or quickly building or releasing a similar development and testing environment.

The dedicated VM image contains an OS disk that has already been supplied. It is similar to today's disk in that it is "ready-to-use", but unlike disks, the VHD of a VM image is replicated as read-only when new virtual machines are deployed. A dedicated VM image is intended to be a "snapshot" for deploying a VM at a known-good point in time (for example, when a checkpoint is being performed on a developer's computer), or before a dangerous task is performed, preventing the task from making an error and causing the virtual machine to become unusable. It should not be used as a mechanism for cloning multiple identical virtual machines in the same virtual network because Windows has SYSPREP requirements for image replication.

How to create a VM image

After you set up and configure the virtual machine as needed, you can capture the virtual machine instance as a VM image. During the capture process, the system stores all the associated properties and disks for the virtual machine and creates a copy of the backing VHD page blobs. A copy of each VHD is stored in the same storage account and container as the original VHD being copied. If you want to find the replicated VHD in Azure storage, use the following naming convention to search page blobs: For OS VHD, we use the <VM image name >-os-YYYY-MM-DD<-ZZ>; for the replicated data VHD. The <VM image name >-datadisk-<lun>-yyyy-mm-dd (-ZZ) is used. The date is the capture date for the VM image,-zz as a number, and only added when there is a conflict, giving the name uniqueness. During the capture process, the system will not save the state in memory, so this feature should not be used to replace the current backup and restore options for Microsoft Azure. If you want more information about backup and restore, you can access http://msdn.microsoft.com/library/azure/jj573031.aspx.

If the OS has been generalized/canceled, the virtual machine must be shut down before it can be captured as a VM image. Once the VM is captured as a VM image, the virtual machine is automatically deleted. If the OS is specialized, you can capture the virtual machines when the virtual machine is running or shutting down. The captured virtual machine will remain unchanged. If you need the application to be consistent or cross disk capture, we recommend that you shut down the virtual machine before capturing the VM image.

How to use VM images

When you create a virtual machine, you can use the VM image as part of a new or existing deployment. To deploy a new VM, make sure that the virtual machine and VM images are in the same location, and then simply provide the name of the VM image to use. If the VM image is generic, it also needs to provide supply information and network configuration, similar to today's OS images. The behavior of post-deployment virtual machines is the same as any other VM created using an OS image or OS disk. You can update roles, attach additional disks, or detach existing disks.

If the VM image is specialized, no provisioning information is required, similar to today's OS disks. When you deploy a virtual machine using a VM image, a VHD copy is created for the new VM, in other words, the system does not attach the existing VHD directly. After you deploy a virtual machine with a dedicated VM image, the VM starts quickly after deployment and looks like it is running because no provisioning is required. However, the virtual machine may still be in the boot state, and a few minutes to prepare the Remote Desktop/SSH. When a virtual machine is deployed and run, it behaves the same as any other VM created using an OS image or OS disk. One of the things to note about this presentation is to capture the running VM as a dedicated Windows VM image, and then deploy a new virtual machine. When using such a VM image, if you are using Remote Desktop to connect to a newly deployed VM for the first time, a dialog box may pop up that prompts the VM not to shut down properly.

PowerShell

To spark your interest and get you started with the VM image, I've provided some PowerShell snippets that show how to create and use VM images. You may want more examples after looking at these snippets. Soon we will be releasing a comprehensive "how" series of blog posts on the VM image PowerShell.

Save-azurevmimage

To capture an existing virtual machine named "Myvmtocapture" as a VM image named "Myawesomevmimage", use Save-azurevmimage Commandlet:

Save-azurevmimage–servicename "myServiceName" –name "myvmtocapture" –osstate "Generalized" –ImageName " Myawesomevmimage "–imagelabel" is my Virtual Machine Image

Note that this is the same as the commandlet you use to capture the VM as an OS image. An additional set of parameters is now available to let you decide whether to capture the VM as an OS image or as a VM image. The Osstate parameter is the new parameter necessary to capture the VM image.

Get-azurevmimage

To list all VM images in the image repository, use Get-azurevmimage commandlet:

Get-azurevmimage

The Commandlet will return a combined list of OS images and VM images. The OS image is returned first, and then the VM image is returned.

If you only need a VM image, you can filter out the OS image by using several properties that are always null for the OS image:

Get-azurevmimage | where {(Gm–inputobject $_-name datadiskconfigurations) ne $null} | Select-property Label, ImageName

New-azurevmimage

Deploying VMS in the western United States using VM image "Myawesomevmimage"

New-azurequickvm–windows–location "West US" –servicename "MySvc1" –name "myVM1" –instancesize "Medium" –imagename " Myawesomevmimage "–adminusername" admin "–password" adminPassword123 "-waitforboot

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.