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

4

12

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?

Belden answered 5/6, 2013 at 21:10 Comment(2)
You can't do this directly. You'll have to host that disk on one server and use network shares to share it to other servers. Be very careful with that since that can easily be done insecurely!Ferrate
You could layer 2 independent differencing images against the same base vhd using diskpart and then point the VM(s) to as many differencing disks. Every mount instance will have the same base but a different writable layer.. works with diskmgmt should work with hyper-v as well.Hunkers
M
5

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.

Manysided answered 5/6, 2013 at 21:10 Comment(0)
T
2

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.

Toque answered 5/6, 2013 at 21:17 Comment(0)
A
1

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.

Alcove answered 6/8, 2013 at 12:45 Comment(0)
P
0

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.

Palaeolithic answered 15/8, 2017 at 8:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.