Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to attach the same disk to multiple Azure VMs

I have created a VHD for data and attached it to one Virtual Machine instance. Is there a way to attach that disk again to another VM? I basically want a shared drive for multiple VMs.

I see an "attach VHD" option in Server Manager for 2008 R2, but the only location I have to put in is my URL, and that is obviously wrong. When I try to attach the disk to another vm using the Attach Disk option in the management portal, it doesn't show this vhd in the list of available vhds. I know there are utilities in powershell which can do things, does anyone know if that would work?

like image 909
Anthony Potts Avatar asked Jun 05 '13 21:06

Anthony Potts


3 Answers

Azure Files is a feature introduced in 2014, that allows mounting the same VHD in multiple VMs over SMB 2.1.
Unfortunately I have no experience with it.

like image 187
robert4 Avatar answered Jan 26 '23 16:01

robert4


No you cannot not do this I believe. If you need to have shared storage best bet is Blob storage.

You could though create a share on from one of your VM's and allow access that way. But this has headaches with security and setup.

I would use blob storage.

like image 24
JamesKn Avatar answered Jan 26 '23 16:01

JamesKn


The underlying Hyper-V can do this. It's introduced in Server 2012 R2 and called Shared VHDX. I was told Azure Web sites is using this mechanism. Unfortunatly it's not (yet?) available for virtual machines. The only option I think of now is that you setup file sharing (SMB) and have your VMs in the same virtual network so that they can access this file share.

like image 24
lvmeijer Avatar answered Jan 26 '23 17:01

lvmeijer