5

I have an existing Azure CloudDrive that I want to make bigger. The simplist way I can think of is to creating a new drive and copying everything over. I cannot see anyway to just increase the size of the vhd. Is there a way?

woaksie
  • 89
  • 1
  • 3
  • 13

3 Answers3

1

Since an Azure drive is essentially a page blob, you can resize it. You'll find this blog post by Windows Azure Storage team useful regarding that: http://blogs.msdn.com/b/windowsazurestorage/archive/2010/04/11/using-windows-azure-page-blobs-and-how-to-efficiently-upload-and-download-page-blobs.aspx. Please read the section titled "Advanced Functionality – Clearing Pages and Changing Page Blob Size" for sample code.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
  • While the technique does increase the size of the blob, it also seems to break the vhd image. My Worker Role that uses the drive just keeps recycling after I have increased the size. P.S. we use your Cloud Storage Studio product and like it a lot! ;-) – woaksie May 02 '11 at 22:16
  • cloud drive failure Microsoft.WindowsAzure.StorageClient.CloudDriveException: Unknown Error HRESULT=D000000D Microsoft.WindowsAzure.CloudDrive.Interop.InteropCloudDriveException: Exception of type 'Microsoft.WindowsAzure.CloudDrive.Interop.InteropCloudDriveException' was thrown. at Microsoft.WindowsAzure.CloudDrive.Interop.InteropCloudDrive.Mount(String url, SignatureCallBack sign, String mount, Int32 cacheSize, UInt32 flags) at Microsoft.WindowsAzure.StorageClient.CloudDrive.Mount(Int32 cacheSize, DriveMountOptions options) – woaksie May 02 '11 at 23:07
  • Thanks for using Cloud Storage Studio and I'm glad you liked it. I think the reason why your VHD is breaking could be because the process of increasing the size writes the empty bytes at the end of page blob thus messing up with the 512 byte page footer of VHD. You may want to ask this question on MSDN forums and somebody from Windows Azure storage team could give you an answer as to what exactly happens when you resize a page blob which happens to be a VHD. Thx. – Gaurav Mantri May 04 '11 at 10:45
  • Would there be any updates to this answer in 2018. Has the file format changed? The resizer program is no longer available, I tried the hyperv vhd resize tool from Windows 10 Pro, but that doesn't work – nwaltham Jan 03 '19 at 20:37
1

yes you can,

please i know this program, is ver easy for use, you can connect with you VHD and create new, upload VHD and connect with azure, upload to download files intro VHD http://azuredriveexplorer.codeplex.com/

Jesus
  • 11
  • 1
0

I have found these methods so far:

  • “the soft way”: increase the size of the page blob and fix the VHD data structure (the last 512 bytes). Theoretically this creates unpartitioned disk space after the current partition. But if the partition table also expects metadata at the end of the disk (GPT? or Dynamic disks), that should be fixed as well.
    I'm aware of only one tool that can do this in-place modification. Unfortunately this tool is not much more than a one-weekend hack (at the time of this writing) and thus it is fragile. (See the disclaimer of the author.) But fast.
    Please notify me (or edit this post) if this tool gets improved significantly.
  • create a larger disk and copy everything over, as you've suggested. This may be enough if you don't need to preserve NTFS features like junctions, soft/hard links etc.
  • plan for the potential expansion and start with a huge (say 1TB) dynamic VHD, comprised of a small partition and lots of unpartitioned (reserved) space. Windows Disk Manager will see the unpartitioned space in the VHD, and can expand the partition to it whenever you want -- an in-place operation. The subtle point is that the unpartitioned area, as long as unparitioned, won't be billed, because isn't written to. (Note that either formatting or defragmenting does allocate the area and causes billing.) However it'll count against the quota of your Azure Subscription (100TB).
  • “the hard way”: download the VHD file, use a VHD-resizer program to insert unpartitioned disk space, mount the VHD locally, extend the partition to the unpartitioned space, unmount, upload. This preserves everything, even works for an OS partition, but is very slow due to the download/upload and software installations involved.
  • same as above but performed on a secondary VM in Azure. This speeds up downloading/uploading a lot. Step-by-step instructions are available here.

Unfortunately all these techniques require unmounting the drive for quite a lot of time, i.e. cannot be performed in high-available manner.

Community
  • 1
  • 1
robert4
  • 1,072
  • 15
  • 20