项目作者: techthoughts2

项目描述 :
Hyper-V PowerShell Diagnostic Utility
高级语言: PowerShell
项目地址: git://github.com/techthoughts2/Diag-V.git
创建时间: 2015-12-06T02:31:09Z
项目社区:https://github.com/techthoughts2/Diag-V

开源协议:MIT License

下载


Diag-V - ARCHIVED

Minimum Supported PowerShell Version
downloads
Cross Platform

master Enhancements
Build Status Build Status

:no_entry: This project is no longer actively maintained :no_entry:

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.

Synopsis

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 PS Word Cloud

Description

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:

Why

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?

Installation

Prerequisites

  • 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
  1. #from an administrative 5.1.0+ PowerShell session
  2. Install-Module -Name 'Diag-V' -Scope CurrentUser

Quick start

  1. #-----------------------------------------------------------------------------
  2. #import the Diag-V module
  3. Import-Module -Name "Diag-V"
  4. #-----------------------------------------------------------------------------
  5. #I need to know where all my VHDX files are, and how much space they could grow to
  6. Get-AllVHD
  7. #-----------------------------------------------------------------------------
  8. #could I potentially save a lot of disk space based on my VMs BIN settings?
  9. Get-BINSpaceInfo
  10. #-----------------------------------------------------------------------------
  11. #I need the current state, and detailed information about my CSVs
  12. Get-CSVInfo
  13. #-----------------------------------------------------------------------------
  14. #i need to find out how big this folder is, and what's taking up so much space
  15. Get-FileSizeInfo
  16. #-----------------------------------------------------------------------------
  17. #what errors did my hyper-v server have in the last 12 hours?
  18. Get-HyperVLogInfo
  19. #-----------------------------------------------------------------------------
  20. #what version of Integration services are my VMs running (2012/R2) - or what features are activated?
  21. Get-IntegrationServicesCheck
  22. #-----------------------------------------------------------------------------
  23. #are any of my VMs using shared VHDs?
  24. Get-SharedVHD
  25. #-----------------------------------------------------------------------------
  26. #I want detailed VM information for all discovered VMs in my Hyper-V deployment
  27. Get-VMInfo
  28. #-----------------------------------------------------------------------------
  29. #I want to know exactly where each component of my VMs are stored
  30. Get-VMLocationPathInfo
  31. #-----------------------------------------------------------------------------
  32. #what is the current replication status of my VMs?
  33. Get-VMReplicationStatus
  34. #-----------------------------------------------------------------------------
  35. #what is the current status of my VMs?
  36. Get-VMStatus
  37. #-----------------------------------------------------------------------------
  38. #I want a complete health report of my Hyper-V deployment
  39. #I want to know if my Hyper-V cluster can withstand a node failure
  40. Test-HyperVAllocation
  41. #-----------------------------------------------------------------------------

Author

Jake Morrison - https://techthoughts.info/

Contributors

Justin Saylor - Logo

Notes

This PowerShell project was created with Catesta.

Running Diag-V remotely

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.