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

Working with the Add Disk Operation of the Windows Azure REST API

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.

Working with the Add Disk Operation of the Windows Azure REST API

Rate This
  • Comments 2

Recently I was looking at a forum question of someone trying to add a disk to the Azure Virtual Machines using the Windows Azure REST API.

You have two types of Disks.  You have a Data Disk that do not have an operating system and are used to store user files.  You also have OS Disks.  The OS Disks contain the operation system and is the main disk used when creating an Azure Virtual Machine.

These can be created using the REST API, PowerShell, or the Management Portal. 

The REST API documentation outlines the following body for the post to create a new disk.

<Disk xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
   <HasOperatingSystem>true|false</HasOperatingSystem> 
   <Label>disk-description</Label>
   <MediaLink>uri-of-the-containing-blob</MediaLink>
   <Name>disk-mame</Name>
<OS>Linux|Windows</OS>
</Disk>

While these are the right items to send to create the Disk, the order matters if you want to create an OS Disk.  I found that the OS Element needed to be first in order to create an OS Disk vs. a Data Disk.

The correct body for the post to create an OS Disk should be:

<Disk xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
   <OS>Linux|Windows</OS>
   <HasOperatingSystem>true|false</HasOperatingSystem> 
   <Label>disk-description</Label>
   <MediaLink>uri-of-the-containing-blob</MediaLink>
   <Name>disk-mame</Name> 
</Disk>

Hope this helps someone out.  More to come in the next few days on working with the Windows Azure REST API.

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
  • Stephen,

    Requesting you to post few examples on how we can use this during vm creation. I got confused on how to make use of existing available disks while creating a new vm.

  • The above will just add the VHD Blob as a DISK so you can add it to a VM.  You would then need to call Update Role or use the UI to add the Disk.  You can read more here: msdn.microsoft.com/.../jj157187.aspx

Page 1 of 1 (2 items)