3

Normally in Windows, you can create a Virtual Hard Disk (VHD), see it in the Disk Management, right-click, and remove it:

enter image description here

No problem.

Storage Spaces Hides Disks

I want to test the resiliency of Storage Spaces, and the ability to migrate them between servers. Once a disk has been added to a Storage Pool, it no longer appears in Disk Management. I need to surprise remove a VHD from the server, but there's no UI option to do it.

If i were using a physical disk, it would be trivial to disconnect the drive from the computer (thus ensuring that Storage Spaces doesn't expect it, and has no chance to rebalance beforehand):

enter image description here

How to unplug a vhd?

But once a disk is added to a storage pool, there is no longer any UI options for that disk. I don't want to use the Storage Spaces UI to Remove a physical disk from the pool:

enter image description here

Because:

  • storage spaces will migrate data from that disk onto other disks in the pool (defeating the point of a surprise removal)
  • storage spaces will migrate data from that disk onto other disks in the pool (defeating the point of the test of migrating disks to another server)

enter image description here

I need the surprise removal

In the same way i can unplug a physical hard disk, how do i unplug a virtual hard disk?

Microsoft has the exact PowerShell commandlet to disconnect a vhd:

Dismount-VHD

Dismounts a virtual hard disk.

PS C:> Dismount-VHD –Path c:\test\testvhdx.vhdx

Unfortunately it doesn't work - for the same reason. The VHD is "gone", "invisible", absorbed into the Storage Pool, gone from any ability to interact with it:

PS C:\Windows\system32> Dismount-VHD –Path D:\VirtualMachines\StorageSpaceTest\StorageSpaceTest1.vhdx
Dismount-VHD : Windows cannot dismount the disk because it is not mounted.
At line:1 char:1
+ Dismount-VHD –Path D:\VirtualMachines\StorageSpaceTest\StorageSpaceTest1.vhdx
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Vhd.P...mountVhdCommand:DismountVhdCommand) [Dismount-VHD], VirtualizationOperationFailedException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.Vhd.PowerShell.DismountVhdCommand

It seems once a VHD has been added to a storage pool, it cannot be dismounted.

How do i dismount a VHD that has been added to a storage pool?

Bonus Chatter

The current VHDX files are sitting in D:\..., which itself is a Parity Space. I cannot simply turn off the PC and simply rename the files. Not only is turning off the server not a viable option right now, it defeats the point of the test: having Storage Spaces react while it is running

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.