Giter VIP home page Giter VIP logo

hyper-v-reporting-script's Introduction

Hyper-V Reporting Script (Powershell & HTML)

It can be difficult to monitor and assess resources in large Hyper-V environments. This Powershell based script helps you to understand virtualization inventory, capacity and general resource availability in your Standalone or Clustered Hyper-V Environment.

Highlights

  • Creates a plain but detailed and user-friendly HTML report which is compatible with all modern browsers.
  • Has an Overview section which shows momentary cluster resource usage.
  • Storage Overcommitment (see details below)
  • Shows alerts in the report for certain situations (utilizations, vm checkpoints, replication status, etc.)
  • Provides more detailed information via tooltips in the HTML report. (cells with asteriks and highlighted)
  • Includes a mode that reports only alerts in the Hyper-V environment. (aka HighlightsOnly mode)
  • Collects information by using standard Hyper-V and Clustering PowerShell cmdlets and custom WMI queries.
  • Checks and installs required runtime environment prerequisites like Hyper-V and Clustering Powershells.
  • Can be used directly from command-line or as a scheduled Windows task.
  • Supports report delivery via e-mail with advanced options. (authentication, TLS/SSL, multiple recipients)
  • Advanced error handling and logging. (Console messages and log file)

Version History and Change Log

[x] Version 1.5 - 15.March.2016

  • Added

  • Windows 8 and 8.1 OS support for script runtime environment

  • New Cluster Overview section

  • Storage Overcommitment

  • Supports for Extended Replica reporting

  • Hyper-V host information extended

  • VM Virtual Network information

  • $ReportFileNameTimeStamp parameter

  • Removed

  • $ReportIsBodyHTML parameter is no longer available

Report Details

Cluster Overview (Applicable on clusters only)

  • Physical Resources

  • Node

  • Processor

  • Memory

  • Storage

  • Physical Resources

  • vMachine

  • vProcessor

  • vMemory

  • vStorage

Hyper-V Host Table (Clustered or Standalone)

  • Hostname *Computer Manufacturer, Model
  • Operating System Version
  • State
  • Uptime
  • Domain Name
  • Total and Running VM Count
  • Detailed as Clustered and Non-clustered
  • Processor Count
  • Logical processor count
  • Physical processor socket count
  • Processor Manufacturer, Model, Ghz
  • Hyper-Threading state for Intel processor (shown as tooltip)
  • Virtual Processors per Logical Processor ratio
  • Physical RAM capacity
  • Used, Free, Total

Disk/Volume Table (Clustered or Local)

  • Volume
  • Name (Local Volume, Clustered Volume, Cluster Shared Volume)
  • Label or CSV path (shown as tooltip)
  • Disk name (Physical Disk, Clustered Disk)
  • Total/Allocated/Unallocated physical disk size (shown as tooltip)
  • Disk/Volume State
  • Usage (Logical Partition, Cluster Volume, Cluster Shared Volume, Quorum, System Volume)
  • Owner
  • Physical Disk Bus Type
  • Volume File System
  • Active VHD (storage overcommitment)
  • Disk and volume capacity
  • Used, Free, Total

Virtual Machine Table

  • Instance
  • VM name
  • Configuration XML path (shown as tooltip)
  • Generation
  • Version
  • State
  • Uptime
  • Owner
  • Virtual Processor
  • Counts
  • Virtual RAM
  • Startup, Minimum, Maximum, Assigned
  • Integration Services
  • State like UpToDate, UpdateRequired, MayBeRequired, NotDetected
  • Version number (shown as tooltip)
  • Checkpoint
  • Checkpoint state
  • Checkpoint count (if exists, shown as tooltip)
  • Checkpoint chain (if exists)
  • Replica
  • Replication State and Health
  • Primary, Replica and Extended modes
  • Replica Server or Primary Server (shown as tooltip)
  • Replication Frequency (shown as tooltip)
  • Last Replication Time (shown as tooltip)
  • Disk
  • VHD Name
  • VHD File Path (shown as tooltip)
  • Current VHD file size
  • Maximum VHD disk size
  • VHD Type
  • Controller Type
  • VHD fragmentation percent
  • Including pass-trough disks (if exists)
  • Including differencing virtual disk chain (if exists)
  • Network Adapter
  • Device type
  • Connection status
  • Virtual switch name
  • IP address
  • VLAN ID
  • Advanced - MAC Address, MAC Type, DHCP Guard, Raouter Guard, Port Mirroring, Protected Network
  • Can detects missing VHD files
  • Can detects clustered VM configuration resource problems like offline
  • Can detects clustered VM failed state

Requirements

Hyper-V Targets (Clustered or Standalone)

  • Active Directory domain membership
  • Supported Operating Systems
  • Windows Server 2012
  • Windows Server 2012 R2
  • Hyper-V Server 2012
  • Hyper-V Server 2012 R2

Script Runtime Operating System (Directly on a Hyper-V target or remote Windows operating system)

  • Same or trusted Active Directory domain membership with Hyper-V target
  • Supported Operating Systems
  • Windows Server 2012
  • Windows Server 2012 R2
  • Windows 8
  • Windows 8.1
  • Windows PowerShell 3.0 or 4.0 (installed by default on supported server operating systems)
  • Sets the Windows PowerShell execution policy to RemoteSigned or Unrestricted
  • Hyper-V PowerShell (if not, automatically installed by the Get-HyperVReport.ps1 for server oses)
  • Failover Clustering PowerShell (if not, automatically installed by the Get-HyperVReport.ps1 for server os')
  • The script requires administrative privileges on the target Hyper-V server(s)

Usage

1) Creates a Hyper-V Cluster report in the working directory.

.\Get-HyperVReport.ps1 -Cluster Hvcluster1

2) Creates a Hyper-V Cluster report that shown only highlighted events and alerts in the working directory.

.\Get-HyperVReport.ps1 -Cluster Hvcluster1 -HighlightsOnly $true

3) Creates one or more standalone Hyper-V Host(s) report in the working directory.

.\Get-HyperVReport.ps1 -VMHost Host1,Host2,Host3

4) Creates a Hyper-V Cluster report and sends it to multiple recipients as attachment without smtp authentication.

.\Get-HyperVReport.ps1 -Cluster Hvcluster1 -SendMail $true -SMTPServer 10.29.0.50 -MailFrom [email protected] -MailTo [email protected],[email protected]

5) Creates a Hyper-V Cluster report and sends it to multiple recipients as attachment with smtp authentication and TLS/SSL communication. -SMTPServerTLSorSSL is optional and used if forced by the smtp server.

.\Get-HyperVReport.ps1 -Cluster Hvcluster1 -SendMail $true -SMTPServer smtp.mailserver.com -SMTPPort 587 -MailFrom [email protected] -MailFromPassword P@ssw0rd -SMTPServerTLSorSSL $true -MailTo [email protected],[email protected]






Special Thanks



_Serhat Akinci_

hyper-v-reporting-script's People

Contributors

ghostinthewires avatar

Stargazers

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

hyper-v-reporting-script's Issues

Windows Server 2019

Does this script also work with Windows Server 2019 or has it been verified to work correctly on Windows Server 2019?

Update the script

This is a great script. have it updated for newer versions of windows operating systems...

Error on windows server 2022

Hi,

the script works on server 2012 R2 but i have this error on server 2022, could you help me ?

Get-VHD : Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At C:\Tools\Old\Get-HyperVReport.ps1:2226 char:83

  • ... $vmDiffDisk = Get-VHD -ComputerName $VMHostItem -Path $parentPath
  •                                                           ~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Get-VHD], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Vhd.PowerShell.Cmdlets.GetVHD

Getting Error in running Windows 2012 R2

Hi,
I am getting below error when running from Windows 2012 R2 Standard Edition..Let me know what I need to change in the script.

Get-SCVirtualMachine : A parameter cannot be found that matches parameter name 'ComputerName'.

Error in Line : 1339, 1609, 1610

Thanks,
Dinu

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.