In my previous post I showed how to provision a Virtual Machine in Windows Azure. The Virtual Machine was used to create a BizTalk 2010 Development environment. Now in this post I would like to go into creating an image of this Virtual Machine and then use it to create a new Virtual Machine.
An image is a virtual hard disk (VHD) file that is used as a template for creating a virtual machine. This can be useful when you want to create multiple virtual machines that are set up the same way. Another reason can be to capture the image as you do not want to use it for a while and prevent incurring costs.

Capturing a Virtual Machine

To capture a Virtual Machine you need to perform a few steps. One is to sysprep the virtual machine. For Window Server 2008 R2, like my BizTalk Development environment, I followed instructions from article “How to Capture an Image of a Virtual Machine Running Windows Server 2008 R2“. After sysprepping your machine you need to capture it. Sysprepping the machine according to the article will shutdown the virtual machine and changes the status of the machine in the Management Portal to Stopped. Capturing the VM means selecting it. You will then fill some details in dialog box.
21. Capture Image
Now notice the name I gave to the image. This name was deemed invalid after I clicked check mark. The error was:

Failed to capture image BizTalk_Development of virtual machine BTS2010.
The image name is invalid.

I renamed it to BizTalkDev. It went trough and took a while before image was captured.

22. Capturing Image

That is basically it. Image is created and Virtual Machine is deleted and you’ll not be billed.

Creating a virtual machine from the Image

If you want to create a new virtual machine you can select your image from the Gallery. Steps below a similar if you create a Windows 2008 R2 machine from scratch. From My Images you will see images you have created. In my case only BizTalkDev is available.

image

Next step (2) is filling in details for the VM Configuration.

image

Following step (3) is filling in details for VM mode.

image

Last step (4) is selecting the availability set in case you require a group a virtual machine in case of outages (i.e. higher availability).

image

Click the check mark and Virtual Machine is being provisioned. This may take a while before it is up and running. When it is up and running I can connect to machine again through remote desktop. Machine will need a few minutes to warm up again, before I could fire up BizTalk administration, SQL Server and Visual Studio.

image

This way I can spin up a Virtual Machine with BizTalk when I want it and remove it when I done. I can use it to spin up a few machines in case I want to work with a team or for training purposes at a client. There can be many more useful scenario’s than the ones I mention here.

If you are experiencing problems with Virtual Machines you can ask questions in the Windows Azure Virtual Machines for Windows forum or study the online documentation.

My experience so far with Virtual Machines and the Windows Azure Portal are positive. I am seeing more and more its potential. The User Experience (UX) with Portal is very satisfactory to me personally. I must say Microsoft Windows Azure team have done a good job.

Finally I also like to thank Thiago Almeida (Microsoft New Zealand) for giving me some tips that lead to this post.

Cheers,

– Steef-Jan