Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond

How to Create a Windows Azure Virtual Machine Image without using the Windows Azure Management Portal

BizTalk Blogs

This group is for blogs related to BizTalk Server. This includes Community Syndicated blogs and Stephen W. Thomas’s blog.

Stephen W. Thomas BizTalk MVP

Insight and guidance on Microsoft BizTalk Server, Windows Azure, Infrastructure as a Service, and related Microsoft technologies.

How to Create a Windows Azure Virtual Machine Image without using the Windows Azure Management Portal

Rate This
  • Comments 1

Currently the Windows Azure Management Portal is having some difficulty using the UI to create an Image from an existing Virtual Machine.

You have two different options to create an Image without using the UI.  The two options are using the REST API or PowerShell.  The details of each approach our outlined below.  I have tested both approaches and was able to create an Image and use that Image to create a new Virtual Machine.

Options 1:  Using Windows Azure REST API

1.  Sysprep the Virtual Machine and ensure it is shut down according to the instructions here.

2.  Download my REST API Helper Tool or use your own.

3.  Update the VM-CaptureImage.xml file to have the label name as the name of the Virtual Machine (it can really be anything) and the Image Name as the name of your output image.

4.  Set your Management Certificate, Subscription ID, and working folder path inside the App.config file as outlined in the blog post.

5.  Make an HTTP POST to: https://management.core.windows.net/<Subscription-ID>/services/hostedservices/<VM-Name>/deployments/<VM-Name>/roleInstances/<VM-Name>/Operations  (assumes the Service Name and VM Name are the same).

6.  Select the updated VM-CreateImage.xml as the POST Body.

7.  This is an Async call and the tool will return an Operations Request ID and auto populate the ability to check the status of that request.

8.  In about 3 to 5 minutes click on “Make REST Service Call” to check the status of the Async Request created above.  You will eventually see a HttpStatusCode 200 and Status Succeeded (rather than Status In Progress).

Options 2: Using Windows Azure PowerShell

1. Sysprep the Virtual Machine and ensure it is shut down according to the instructions here.

2. Setup and configure PowerShell as outlined here.  This takes about 10 minutes.

3. Run the following command: Save-AzureVMImage –ServiceName <Service-Name / Usually VM Name> –Name <Vm-Name> –NewImageName <New-Image-Name>  -NewImageLabel <SomeLabel>

4. In about 3 to 5 minutes the screen will update to show the process was successful.

Keep in mind that Windows Azure Virtual Machines are a Preview Feature so from time to time things like this will happen.  I am sure the Portal will be corrected soon to allow Images via the UI.  Never the less, it is always good to know how to do them programmatically.  Enjoy.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Post
  • Update - the Windows Azure Portal UI seemed have been updated to fix the issues with creating an Image. In any event, it is always good to know that other options exist to create an image.

Page 1 of 1 (1 items)