SOLVED
Home

How to locate storage account belongs to azure VM disk

%3CLINGO-SUB%20id%3D%22lingo-sub-116085%22%20slang%3D%22en-US%22%3EHow%20to%20locate%20storage%20account%20belongs%20to%20azure%20VM%20disk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116085%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20i%20click%20on%20azure%20virtual%20machine%20--%26gt%3B%20disk%20--%26gt%3B%20OS%20disk%2C%20i%20can%20see%20storage%20account%20type%20is%20general%20purpose%20(LRS)%20but%20how%20do%20i%20find%20out%20which%20storage%20accout%20it%20is%20using%20and%20where%20actually%20VHD%20is%20being%20stored%20on%20the%20backend%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-116085%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116746%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20locate%20storage%20account%20belongs%20to%20azure%20VM%20disk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116746%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116744%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20locate%20storage%20account%20belongs%20to%20azure%20VM%20disk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116744%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Suhag%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20see%20no%20issues%20with%20that.%20You%20just%20go%20to%20a%20target%20VM%20(the%20one%20you%20want%20to%20copy%20and%20use%20locally%20via%20Hyper-V).%20You%20need%20to%20go%20to%20'Disks'%20blade%20and%20select%20the%20VMs%20disk.%20In%20the%20panel%20you'll%20see%20the%20disk's%20properties%2C%20including%20an%20url.%20Copy%20that%20URL%20and%20download%20either%20via%20browser%20or%20download%20manager%20(more%20reliable).%20See%20the%20image%20attached%20for%20more%20info%3A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F22228i8282CAAB32F601C7%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22Disks.jpg%22%20title%3D%22Disks.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20not%20forget%20the%20VM%20should%20be%20shut%20down%20when%20you%20copy%20VHD.%20I%20assume%20that%20downloading%20of%20100-150Gb%20would%20take%20some%20time.%20The%20next%20step%20is%20to%20use%20Hyper-V%20to%20create%20a%20VM%20locally.%3C%2FP%3E%3CP%3EIn%20Hyper-V%20management%20tool%20of%20choice%20to%20create%20a%20Generation%201%20virtual%20machine%20%3CSTRONG%3Ewithout%20any%20virtual%20hard%20disks%20on%20your%20Hyper-V%20host%20or%20cluster%3C%2FSTRONG%3E.%20Try%20to%20match%20the%20CPU%20and%20memory%20configuration%20that%20the%20Azure%20virtual%20machine%20used.%20This%20process%20will%20recreate%20the%20metadata%20of%20the%20virtual%20machine%20for%20a%20Hyper-V%20host%2Fcluster.%20Make%20sure%20you%20noted%20the%20storage%20location%20of%20the%20virtual%20machine.%20After%20that%20you%20would%20to%20specify%20a%20hard-drive%20to%20use%20(your%20downloaded%20VHD)%2C%20once%20its%20done%20you%20have%20two%20choices%2C%20i.e.%20keep%20using%20standard%20VHD%20or%20attempt%20to%20convert%20it%20to%20VHDX%20(for%20better%20performance).%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20use%20this%20VHD%20in%20Azure%2C%20you%20may%20need%20to%20perform%20a%20reverse%20process%20(i.e.%20convert%20VHDX-%26gt%3BVHD).%20Once%20you're%20done%20with%20all%20that%20stuff%2C%20edit%20VM%20settings%20in%20Hyper-V...%20system%20disks%20should%20be%20attached%2Fadded%20to%20IDE%20controller%20and%20data%20disks%20(if%20any)%20to%20SCSI%20controller.%20That's%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116741%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20locate%20storage%20account%20belongs%20to%20azure%20VM%20disk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116741%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20%3CU%3E%3CFONT%20color%3D%22%230066cc%22%3EPaulish%20and%20Alex%2C%3C%2FFONT%3E%3C%2FU%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3E%3CFONT%20color%3D%22%230066cc%22%3Ei%20was%20wondering%20what%20if%20someone%20simply%20wants%20to%20copy%20the%20VHDs%20to%20make%20a%20local%20copy%20without%20backup%2Fexport...just%20like%20what%20we%20do%20at%20hypervisor%20level%20(Hyper-V%20and%20VMware).%3C%2FFONT%3E%3C%2FU%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116729%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20locate%20storage%20account%20belongs%20to%20azure%20VM%20disk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116729%22%20slang%3D%22en-US%22%3E%3CP%3EAlex%2C%20thanks%20for%20chiming%20in.%20I%20guess%20I%20had%20the%20same%20reaction%2C%20and%20to%20emphasize%20your%20point%2C%20it%20would%20be%20incredibly%20helpful%20if%20you%20could%20explain%20your%20underlying%20goal%20Suhag.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116710%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20locate%20storage%20account%20belongs%20to%20azure%20VM%20disk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116710%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20Suhag%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20is%20the%20purpose%20to%20'see'%20that%20vhd's%3F%20To%20list%20vhd's%20attached%20to%20VM%20you%20can%20simply%20use%20PS%20commands%20%3CA%20href%3D%22http%3A%2F%2Fpipe2text.com%2F%3Fpage_id%3D2596%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edescribed%20here%3C%2FA%3E.%20If%20you%20need%20to%20see%20the%20disks%20for%20backup%2C%20you%20can%20perform%20a%20backup%20in%20many%20ways%3A%3C%2FP%3E%3CP%3E-%20Create%20a%20snapshot%20(more%20about%20it%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fsnapshot-copy-managed-disk%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E)%3C%2FP%3E%3CP%3E-%20Use%20Azure%20Backup%20service%3C%2FP%3E%3CP%3E-%20Copy%20vhd%20to%20a%20local%20disk%20or%20another%20storage%20account%20(VM%20should%20be%20shut%20down%20and%20the%20target%20disk%20detached).%20Attaching%20disk%20back%20to%20VM%20is%20well%20described%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fattach-disk-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116585%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20locate%20storage%20account%20belongs%20to%20azure%20VM%20disk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116585%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20are%20right%2C%20it%20was%20managed%20disk.%20Thanks%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20there%20is%20no%20way%20we%20can%20see%20the%20managed%20VHD.%20the%20only%20way%20we%20can%20export%20is%20through%20restore...right%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116538%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20locate%20storage%20account%20belongs%20to%20azure%20VM%20disk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116538%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20the%20VM%20utilizing%20managed%20disks%3F%20If%20so%2C%20managed%20disks%20handle%20storage%20for%20you%20so%20they%20no%20longer%20rely%20on%20a%20storage%20account.%20You%20may%20still%20see%20a%20storage%20account%20associated%20with%20your%20VM%2C%20but%20it's%20used%20for%20storing%20files%20other%20than%20the%20VMs%20disks%2C%20e.g.%2C%20screenshot.bmp%20and%20serialconsole.log%20if%20you%20have%20boot%20diagnostics%20enabled.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Suhag Desai
Contributor

Hi,

 

When i click on azure virtual machine --> disk --> OS disk, i can see storage account type is general purpose (LRS) but how do i find out which storage accout it is using and where actually VHD is being stored on the backend ?

 

Regards,

7 Replies

Is the VM utilizing managed disks? If so, managed disks handle storage for you so they no longer rely on a storage account. You may still see a storage account associated with your VM, but it's used for storing files other than the VMs disks, e.g., screenshot.bmp and serialconsole.log if you have boot diagnostics enabled.

You are right, it was managed disk. Thanks,

 

So there is no way we can see the managed VHD. the only way we can export is through restore...right?

 

 

Solution

Hey Suhag,

 

What is the purpose to 'see' that vhd's? To list vhd's attached to VM you can simply use PS commands described here. If you need to see the disks for backup, you can perform a backup in many ways:

- Create a snapshot (more about it here)

- Use Azure Backup service

- Copy vhd to a local disk or another storage account (VM should be shut down and the target disk detached). Attaching disk back to VM is well described here.

Alex, thanks for chiming in. I guess I had the same reaction, and to emphasize your point, it would be incredibly helpful if you could explain your underlying goal Suhag.

Thank you Paulish and Alex,

 

i was wondering what if someone simply wants to copy the VHDs to make a local copy without backup/export...just like what we do at hypervisor level (Hyper-V and VMware).

Hi Suhag,

 

I see no issues with that. You just go to a target VM (the one you want to copy and use locally via Hyper-V). You need to go to 'Disks' blade and select the VMs disk. In the panel you'll see the disk's properties, including an url. Copy that URL and download either via browser or download manager (more reliable). See the image attached for more info:Disks.jpg

 

 

 

Do not forget the VM should be shut down when you copy VHD. I assume that downloading of 100-150Gb would take some time. The next step is to use Hyper-V to create a VM locally.

In Hyper-V management tool of choice to create a Generation 1 virtual machine without any virtual hard disks on your Hyper-V host or cluster. Try to match the CPU and memory configuration that the Azure virtual machine used. This process will recreate the metadata of the virtual machine for a Hyper-V host/cluster. Make sure you noted the storage location of the virtual machine. After that you would to specify a hard-drive to use (your downloaded VHD), once its done you have two choices, i.e. keep using standard VHD or attempt to convert it to VHDX (for better performance). 

To use this VHD in Azure, you may need to perform a reverse process (i.e. convert VHDX->VHD). Once you're done with all that stuff, edit VM settings in Hyper-V... system disks should be attached/added to IDE controller and data disks (if any) to SCSI controller. That's it.