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,545 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.
958 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,891 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