Attach VHD set (.vhds) hard disk to virtual machine

Hinterleitner Andreas 0 Reputation points
2024-04-17T08:05:49.63+00:00

I run 3 Windows Server 2022 virtual machines (VMs) on a HCI cluster as a Hyper-V guest cluster.

I now want to add another VHD set hard disk (.vhds) to the guest cluster, so I create Test.vhds in for example C:\ClusterStorage\Datastore01\VHDSets on the host cluster. The 3 guest cluster VMs can see this file, and in the Failover Cluster Manager GUI, I have no problems attaching this disk to a guest cluster VM.

When I try the same in PowerShell with:

add-VMHardDiskDrive -ComputerName '<HCI cluster node name running the guest cluster VM>' -VMName '<name of guest cluster VM>' -Path 'C:\ClusterStorage\Datastore01\VHDSet\Test.vhds'

I get the error:

Add-VMHardDiskDrive: Failed to add device 'Virtual Hard Disk'. Failed to configure 'C:\ClusterStorage\Datastore02\vms\ATNDFHVCL01-LAB\Test.vhds': Virtual hard disk sharing must be enabled on VHD Set files.

I found no way so far to enable that 'Virtual hard disk sharing' feature if it ever exists (to my knowledge, VHD sets have this automatically), and in the Failover Cluster Manager GUI there's no option to do this, too.

Anyone knows how to successfully attach a .vhds file to a guest cluster VM?

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,742 questions
Windows Server Clustering
Windows Server Clustering
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Clustering: The grouping of multiple servers in a way that allows them to appear to be a single unit to client computers on a network. Clustering is a means of increasing network capacity, providing live backup in case one of the servers fails, and improving data security.
1,014 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ian Xue 37,881 Reputation points Microsoft Vendor
    2024-04-18T04:56:41.21+00:00

    Hi Hinterleitner,

    Hope you're doing well.

    In the case of a powered-off virtual machine, right-click on the virtual machine and select "Settings". Then navigate to "Shared Drives", click "Add", and under "Shared Drive", you can add VHDs.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. Kluver, P. (ICT Amarant) 6 Reputation points
    2024-11-20T13:51:48.22+00:00

    Try the parameter –SupportPersistentReservations

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.