I am using two node Hyper-V csv cluster(windows2016).
I have created a shared disk(.vhds) and attached that shared disk to two VMs(both windows 2016)
I have followed all requirements required to use and take backup of Hyper-V VMs with shared disk:
Like guest failover cluster should be enabled in guest VMs, and nodes should be online, permission on folders etc etc.
When I try to fetch information of shared disk either by powershell commands or by methods, it gives proper information when VM IS TURNED OFF:
PS C:\Users\Administrator> Get-VHDSet -path "C:\ClusterStorage\Volume2\VMs\chidanand\2016-vhds1\Virtual Hard Disks\vhds1.vhds" -GetAllPaths
ComputerName Path SnapshotIdList AllPaths
H2K16-3DFS2 c:\clusterstorage\volume2\vms\chidanand\2016-vhds1\virtual hard disks\vhds1.vhds {4ECCDCBA-D8FA-40F0-996F-79A04019EC1A} {VHDS1_2ece7366-f62a-4b03-945d-c6...
But if I power ON VM and try to fetch information related to shared disk, it FAILS.
For example:
PS C:\Users\Administrator> Get-VHDSet -path "C:\ClusterStorage\Volume2\VMs\chidanand\sharedDisk1\sd2.vhds" -GetAllPaths
Get-VHDSet : Failed to get the disk information.
At line:1 char:1
- Get-VHDSet -path "C:\ClusterStorage\Volume2\VMs\chidanand\sharedDisk ...
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: (:) [Get-VHDSet], VirtualizationException
- FullyQualifiedErrorId : InvalidParameter,Microsoft.Vhd.PowerShell.Cmdlets.GetVHDSet
WITHOUT adding "-GetAllPaths", it will succeed(actual disk path won't be there). But I need to fetch information related to actual disk(disk name) associated with ".vhds". Hence I need it to work with GetAllPaths.
Same result with Get-VHDSnapshot also- fails when VM is RUNNING
PS C:\Users\Administrator> get-vhdsnapshot -Path "C:\ClusterStorage\Volume2\VMs\chidanand\2016-vhds1\Virtual Hard Disks\vhds1.vhds" -SnapshotId 4eccdcba-d8fa-40f0-996f-79a04019ec1a -GetParentPaths
get-vhdsnapshot : Failed to get the disk information.
At line:1 char:1
- get-vhdsnapshot -Path "C:\ClusterStorage\Volume2\VMs\chidanand\2016-v ...
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: (:) [Get-VHDSnapshot], VirtualizationException
- FullyQualifiedErrorId : InvalidParameter,Microsoft.Vhd.PowerShell.Cmdlets.GetVHDSnapshot
WITHOUT adding "-GetParentPaths", it will succeed. But I need to fetch information related to actual disk(disk name) associated with ".vhds".
I tried corresponding methods(when VM is ON)- GetVHDSetInformation and GetVHDSnapshotInformation. Behavior is same as above.
How to get information of actual disk associated with .vhds even when VM is running ?