Steps to attach unmanaged OS Disk to a Windows Azure VM

Steps to attach unmanaged OS Disk to a Windows Azure VM

In this blog, we will show you the steps to attach unmanaged OS Disk to a Windows Azure VM through the portal.

 

REQUIREMENTS

  • Microsoft Azure Subscription
  • Azure Storage Explorer
  • OS VHD Disk

 

OVERVIEW

  • We have already created a Windows 2016 VM named az-unman-vm-01 using traditional (Blob) storage.

Steps to attach unmanaged OS Disk to a Windows Azure VM

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • For demo purpose, we are deleting the above VM and reattach the OS disk using the Azure storage explorer.

 

INSTALLING STORAGE EXPLORER

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • Follow the on-screen instructions and install the tool on your PC. Open the Azure Storage Explorer.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

Note: We are using windows 2016 VM for this demo

 

CONFIGURING STORAGE EXPLORER

  • First, add our existing Azure account to access the storage blobs.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • After successful authentication, our storage blob will be displayed in the explorer.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • We are using the webtierstorage01 storage account to store the az-unman-vm-01 az-unman-vm-01 VM VHD.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

VM CONFIGURATION

  • Login to our demo VM az-unman-vm-01 through RDP.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • We have created few files and folder for demo purpose on the desktop. Need to verify that we are using the existing VHD for newly creating VM.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

DELETING THE VM

  • Go-to azure portal and click on virtual machines link from services list.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • First, stop the VM and delete it.

Steps to attach unmanaged OS Disk to a Windows Azure VM

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • Open the storage explorer and make sure that VHD is available in the blob storage.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

DELETING EXISTING VM CONFIGURATION

  • Delete the existing associated IP for az-unman-vm-01 VM from virtual networks before creating the new VM.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

CREATING NEW VM

  • Create a new VM using virtual machines link from the Azure service list.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

Note: Make sure that you are selecting exactly the same configuration of your deleted VM.

 

  • We are using windows 2016 image to create a new VM for this demo.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • During VM provisioning, Azure will create a new IP and VHD file under the blob storage.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • Cancel the VM provisioning now.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • It will take few minutes to complete the operation.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

RE-CONFIGURING THE VM

  • Open the storage explorer and right click on the new created VHD and click Break Lease.

Steps to attach unmanaged OS Disk to a Windows Azure VM

  • It prompts for confirmation, click Yes to continue.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • Make a note of the new VHD name and delete it.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • Rename the existing VHD file with new name as az-unman-vm-0120171128011004.vhd using the rename option.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • Provide the new name and click on Rename button.

Steps to attach unmanaged OS Disk to a Windows Azure VM

  • The VHD has been renamed successfully.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

VERIFICATION

  • Open the Azure portal and select the VM and start it. For this demo, it’s az-unman-vm-01.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • It will take few minutes to complete the operation.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • Log in to the VM using RDP.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

  • You can see our old files & folders available on the desktop.

Steps to attach unmanaged OS Disk to a Windows Azure VM

 

VIDEO

Thanks for reading this blog. We hope it was useful for you to learn about attaching the existing unmanaged VHD to a new VM.



Author: Loges
Logeswaran holds Microsoft certified engineer & solution architect certifications with over 11+ years of experience in the fields of hosting technologies and IMS/Cloud consulting. At AssistanZ, Logeswaran spearheads the strategic planning and execution of the company’s Microsoft based core technologies to Enterprise clients.

8 Comments

  • anam

    hi i am when i doing break lease , i got the error that “the blob is being used by the system”
    will you please help is this?

  • Hi Anam,

    Thanks for contacting us.

    Please make sure that the provisioning task was stopped completely. It will take few minutes to cancel the provisioning task.

    You can check the status from the notification tab. Once it’s canceled completely then you can break the lease.

  • Sercan

    When I follow your instructions and stop the provisioning of the VM I don’t see any VM machine in the list. The entire operation stops and no VM is been created. Are the steps changed in the azure portal?

  • Hi Sercan,

    Before stopping the VM make sure that the OS disk was created properly. You can verify it through Azure storage explorer.

    Regards,
    Loges

  • Daniel

    Hi Loges,

    I followed your instruction to attach unmanaged disk as OS disk of azure vm. However I can’t remote to Azure vm after attached the disk and started vm. Do you have any idea?

  • Hi Daniel,

    Thanks for contacting us. Please make sure that public IP has been added to that machine. If yes, then enable the boot diagnostics for the VM to troubleshoot further.

    Regards,
    Loges

  • VIKRAM CHAUHAN

    I have tried almost 20 times to stop the provisioning after watching carefully that the network IP and disk is created. But still after the VM is stopped successfully, it does not allow to break the lease and gives the error that the disk is in use. Exactly at what time of the provisioning you are suppose to STOP it? Please help.

  • VIKRAM CHAUHAN

    Can you let me know exactly at what time of the provisioning you are suppose to STOP it. I have tried almost 20 times and it stops but unable to break the lease.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.