master | Enhancements |
---|---|
⛔ This project is no longer actively maintained ⛔
04/03/2022 - I have decided to archive this project. The module is also now unlisted on the PSGallery.
If you are interested in picking up this project, feel free to reach out to me on Twitter.
Diag-V is a read-only PowerShell module containing several Hyper-V related diagnostics to assist with managing standalone Hyper-V Servers and Hyper-V clusters.
Diag-V is a PowerShell Module collection of primarily Hyper-V diagnostic functions, as well as several windows diagnostic functions useful when interacting with Hyper-V servers. Hyper-V functions are cable of automatically detecting if being run against a standalone or Clustered Hyper-V instance. If a cluster is detected, data will be gathered from all nodes in the cluster. Diag-V is a read only, data gathering module that can provide rapid insight into your Hyper-V environment.
Diag-V provides the following functions:
- Get-AllVHD
- Get-BINSpaceInfo
- Get-CSVInfo
- Get-FileSizeInfo
- Get-HyperVLogInfo
- Get-IntegrationServicesCheck
- Get-SharedVHD
- Get-VMInfo
- Get-VMLocationPathInfo
- Get-VMReplicationStatus
- Get-VMStatus
- Test-HyperVAllocation
Current Hyper-V and Failover cmdlets are typically scoped to the host they are run on. ie If you run Get-VM it only returns VMs from the host specified.
Diag-V aims to leverage these cmdlets to provide more complete, and rapid operational insights into a Hyper-V environment.
Diag-V can quickly answer questions like these:
- How many VMs are in this cluster?
- Where are all the VMs stored?
- Where are all the VHDXs stored?
- Does the Hyper-V deployment have enough storage to accommodate dynamic VHD growth?
- What is the health status of the CSVs?
- Are any of the VMs using shared VHDXs?
- What is the replication status of my VMs?
- Do my Hyper-V servers have enough resources? Do I have room to grow?
- Can my Hyper-V cluster withstand a node failure?
- Designed and tested on Server 2012R2 and Server 2016 Hyper-V servers running PowerShell 5.1
- Nearly all functions require the console session to be running as administrator
- Diag-V must be run as a user that has local administrator rights on the Hyper-V server
- If running diagnostics that interact with all cluster nodes Diag-V must be run as a user that has local administrator right to all members of the cluster
#from an administrative 5.1.0+ PowerShell session
Install-Module -Name 'Diag-V' -Scope CurrentUser
#-----------------------------------------------------------------------------
#import the Diag-V module
Import-Module -Name "Diag-V"
#-----------------------------------------------------------------------------
#I need to know where all my VHDX files are, and how much space they could grow to
Get-AllVHD
#-----------------------------------------------------------------------------
#could I potentially save a lot of disk space based on my VMs BIN settings?
Get-BINSpaceInfo
#-----------------------------------------------------------------------------
#I need the current state, and detailed information about my CSVs
Get-CSVInfo
#-----------------------------------------------------------------------------
#i need to find out how big this folder is, and what's taking up so much space
Get-FileSizeInfo
#-----------------------------------------------------------------------------
#what errors did my hyper-v server have in the last 12 hours?
Get-HyperVLogInfo
#-----------------------------------------------------------------------------
#what version of Integration services are my VMs running (2012/R2) - or what features are activated?
Get-IntegrationServicesCheck
#-----------------------------------------------------------------------------
#are any of my VMs using shared VHDs?
Get-SharedVHD
#-----------------------------------------------------------------------------
#I want detailed VM information for all discovered VMs in my Hyper-V deployment
Get-VMInfo
#-----------------------------------------------------------------------------
#I want to know exactly where each component of my VMs are stored
Get-VMLocationPathInfo
#-----------------------------------------------------------------------------
#what is the current replication status of my VMs?
Get-VMReplicationStatus
#-----------------------------------------------------------------------------
#what is the current status of my VMs?
Get-VMStatus
#-----------------------------------------------------------------------------
#I want a complete health report of my Hyper-V deployment
#I want to know if my Hyper-V cluster can withstand a node failure
Test-HyperVAllocation
#-----------------------------------------------------------------------------
Jake Morrison - https://techthoughts.info/
Justin Saylor - Logo
This PowerShell project was created with Catesta.
Diag-V leverages numerous existing cmdlets to provide rapid operational insight into your Hyper-V deployment. This makes it tricky to make Diag-V fully remote capable as some of these cmdlets support -ComputerName
and -Credential
while some do not. Diag-V is also cluster aware, and will scope your current or provided credentials to connect to other nodes in the cluster to retrieve operational data. This runs into the 'double-hop' issue as the remote machine has to pass credentials on to the other nodes to get data back.
For best results log into one Hyper-V server in the cluster and run your desired diagnostic. That said, I've enabled the majority of functions with a credential parameter. I've had success establishing a PSSession to a remote Hyper-V server, and I can specify the credential parameter which bypasses the double-hop issue. The configuration of your WinRM may affect your results. Consult each functions help for additional information.