GithubHelp home page GithubHelp logo

techthoughts2 / diag-v Goto Github PK

View Code? Open in Web Editor NEW
21.0 6.0 4.0 1.1 MB

Hyper-V PowerShell Diagnostic Utility

License: MIT License

PowerShell 100.00%
diagnostics cluster powershell vms diagnostic-utility hyper-v vhdx vhdxfiles hyperv diagnostic diagnostic-tool virtual-machine eventlog allocation health

diag-v's Introduction

Diag-V - ARCHIVED

Minimum Supported PowerShell Version downloads Cross Platform

master Enhancements
Build Status Build Status

โ›” 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.

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

Installing Diag-V via PowerShell Gallery

#from an administrative 5.1.0+ PowerShell session
Install-Module -Name 'Diag-V' -Scope CurrentUser

Quick start

#-----------------------------------------------------------------------------
#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
#-----------------------------------------------------------------------------

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.

diag-v's People

Contributors

techthoughts2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

diag-v's Issues

Manifest Tags have spaces

Publish-PSArtifactUtility : Failed to publish module 'Diag-V': 'Failed to process request. 'An item's Tags property extracted from the PowerShell manifest may not contain spaces: 'Virtual Machines, Virtual Machine'.'. 
The remote server returned an error: (500) Internal Server Error..
'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1227 char:17
+                 Publish-PSArtifactUtility -PSModuleInfo $moduleInfo `
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : FailedToPublishTheModule,Publish-PSArtifactUtility

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.