Using a shared disk as drives on two VMs

Helge 40 Reputation points
2024-03-02T17:11:40.24+00:00

I like to share an existing Azure managed disk with an NTFS partition from a Windows Server 2016 with a Windows Server 2022 (could be read-only). Both are Azure VMs.

What I did:

  • Created a snapshot from the existing disk.
  • Created a new disk with shared disk enabled from the snapshot.
  • Detached the existing disk from the Windows Server 2016.

Attached the new shared disk to both VMs.

Now on the Windows Server 2016 everything is fine. The new disk is even mapped with the same drive letter as the old.

On the Windows Server 2022 though the new disk comes up as RAW without a detected file system and cannot be used.

Is is not possible to use a shared disk for this task or am I missing something?

Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
573 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 76,686 Reputation points
    2024-03-04T08:59:54.2+00:00

    Hi Helge,

    I don't think shared disk is what you want for your use case. Shared disk is typically used for cluster workloads. For example, SQL Server Always On Failover Cluster Instance, Hyper-V failover cluster, scale-out file server, etc. You would install Failover clustering on the servers, create cluster, cluster shared volume, servers would all need to be same version, etc.

    Windows Failover Clustering manages which node writes to the disk so there aren't problems.

    As an alternative, have you considered creating an Azure Files share that you could access from both servers?

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP


2 additional answers

Sort by: Most helpful
  1. Vahid Ghafarpour 18,130 Reputation points
    2024-03-02T20:33:50.5+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    If the shared disk was previously attached to another VM, it may have a conflicting disk signature. You can use Disk Management to change the disk signature.

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **


  2. Nehruji R 2,051 Reputation points Microsoft Vendor
    2024-03-04T13:06:57.2266667+00:00

    Hello Helge,

    Greetings! Welcome to Microsoft Q&A forum.

    Shared managed disks do not natively offer a fully managed file system that can be accessed using SMB/NFS. You need to use a cluster manager, like Windows Server Failover Cluster (WSFC) or Pacemaker, that handles cluster node communication and write locking. So while it is possible to mount like you have you will need some cluster specific software for this to work. Please refer to the Sample Workloads section for some examples.

    You might consider using Azure Files. This will allow you to read and write to the same location without extra software. Azure Files offers fully managed file shares in the cloud that are accessible via the industry standard Server Message Block (SMB) protocol or Network File System (NFS) protocol. Azure file shares can be mounted concurrently by cloud or on-premises deployments.

    Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.

    0 comments No comments