Recently I need to resize (increase) a VHD on azure.
The following are steps that I used and they worked just fine. Please keep in mind that this process does
take some time but is faster than doing it on your own premises.
Tools you will need.
- A tool to download your data to a vm such as Cloud Storage Studio
- Be sure to adjust your settings to download and upload large files with 4MB blocks. Do this before starting the download or upload steps.
- A tool to resize your VM such as VHD Resizer
- A VM that can host the drive and conversion process (probably a small or medium).
Step 1.
- For resizing an OS disks, remove the VM that’s attached to it from your virtual machine list.
- You will still have the disk image to use later.
Step 2.
- Using either a new VM or an existing one, attach a new disk to it that’s large enough to hold at least one copy of your current VHD and a copy of the resized VHD. Let’s call this our working volume.
- If your source is 30GB and you want it to be 100GB then provision 150GB to fit them both.
- You can add a disk to a VM under Virtual Machines > [Your VM] > Attach (it’s at the bottom of the page).
- Then set the size of your disk and add it to your VM. This working volume will be used to temporarily store a copy of the vm to resize as well as the resized version.
Step 2.
- Remote into the working VM and download the vhd to your working volume.
- I did this using Cloud Storage Studio
Step 3.
- Once downloaded, use VHD Resizer to create a new copy of your vhd on the same volume that is the larger size that you wanted.
- This step usually takes a while
Step 4.
- Upload the new VHD back to the cloud as a page blob.
- Unlike a regular blob, page blobs let your specify larger amounts of space to use without being billed for that space unless it’s used. This is required for a VHD.
Step 5.
- Once uploaded you need to add that disk to your disk list under virtual machines.
Step 6.
- Reattach your disk or recreate your vm using the new disk.
- At this point you no longer require your working disk and can delete it along with any temporary resources that you used to get to this point.
Hi Andrew; are you still using this approach? Works fairly well for me as well, sure beats copying contents manually.
ReplyDeleteThanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
ReplyDeleteMS Azure Online Training
one of the best articles you shared thanks a lot.
ReplyDeleteFull Stack Training in Chennai | Certification | Online Training Course | Full Stack Training in Bangalore | Certification | Online Training Course | Full Stack Training in Hyderabad | Certification | Online Training Course | Full Stack Training in Pune | Certification | Online Training Course | Full Stack Training | Certification | Full Stack Online Training Course