Freigeben über


Checking Out System Wide Disk Operations in Hyper-V

Recently I was working on a Hyper-V server, and was about to restart it, when I remembered that I had logged in with a different user account earlier on in the day.  I had used this other user account to start the creation of a large fixed size virtual hard disk – and I did not know if this operation had completed or not.

Rather than logging out of my current session – and logging back into the first session – I used a handy WMI query to see what was going on.  Opening a PowerShell Window, I ran this command:

gwmi –class “MSVM_StorageJob” –namespace “root\virtualization\v2” | ft Caption, jobStatus, Owner, PercentComplete

clip_image002

As you can see – this command returns the key information about all virtual hard disk related operations that are currently running on the system.  This way I was able to keep an eye on what was happening under each account, and only restart the server once the virtual hard disk creation had completed.

Cheers,
Ben