About Virtual Machine Images in Azure

Images are used in Azure to provide a new virtual machine with an operating system. An image might also have one or more data disks. Images are available from several sources:

Azure offers a gallery of images -- recent versions of Windows Server and several distributions of the Linux operating system. Some images also contain applications, such as SQL Server. MSDN Benefit and MSDN Pay-as-You-Go subscribers have access to additional images.

A newer version of image that can be used in Azure was introduced in April -- VM image. A VM image includes an operating system as well as all the disks attached to a virtual machine when the image is created. Previously, an image in Azure contained only a generalized operating system, and no additional disks. A VM image that contains only a generalized operating system is basically the same as the original type of image, the OS image.

You can create your own images, based on a virtual machine in Azure, or a virtual machine running elsewhere that you copy and upload. If you want to use an image to create more than one virtual machine, you’ll need to prepare it for use as an image by generalizing it. To create a Windows Server image, run the Sysprep command on the server to generalize it before you upload the .vhd file. For more information, see How to Use Sysprep: An Introduction. To create a Linux image, depending on the software distribution, you’ll need to run a set of commands that are specific to the distribution, as well as run the Azure Linux Agent.

You can easily delete an image if you don’t need it as a template for creating virtual machines. If you create a virtual machine from an image, an operating system disk is created when the virtual machine is created. If you delete the image, the operating system disk is not deleted, which means you can create another image or a virtual machine from the disk. A .vhd file that you upload to create an image is not deleted when an image is deleted. You must delete an image before you can delete the .vhd file that is the source of the image.

The Azure Management Portal provides an easy way for you to create a virtual machine based on any of the images – those provided by Azure or through VM Depot, or images you’ve uploaded and captured. To create a virtual machine with custom settings, such as additional endpoints or as a member of an existing cloud service or availability set, see How to Create a Custom Virtual Machine.