Reputation: 9160
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?
Upvotes: 12
Views: 12390
Reputation: 93
Each server can control multiple access to single files, but this is only because it controls that access, having files accessed from outside of the OS control is a very tricky area to get into, with a high chance of corruption.
To share a files or more likely volumes then it is better to share it from one of the servers, rather than from outside.
Remember that you do have a network in the Azure services, so from within one of your VMs you can share it's drive space to another VM, as you would with in house servers, or a virtual client. It is a much safer way to do this.
Upvotes: 0
Reputation: 1102
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.
Upvotes: 5
Reputation: 1032
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.
Upvotes: 1
Reputation: 1045
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.
Upvotes: 2