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.

 
 
 
 
 
4.9 Star
(96)
30,929 times
Add to favorites
Servers
3/5/2015
E-mail Twitter del.icio.us Digg Facebook
  • Error op_division
    12 Posts | Last post January 13, 2015
    • Script is reporting in French :
      
      PS C:\scripts> .\Get-HyperVReport.ps1 -VMHost laa-host04, laa-host05, laa-host06, ml310e31
      [INFO]    - 08:00:40 - Started! Hyper-V Environment Reporting Script (Version 1.0)
      [INFO]    - 08:00:44 - Logging started: C:\scripts\ScriptLog.txt
      [INFO]    - 08:00:47 - Checking prerequisites to run script on the LAA-PROTECT2012...
      [INFO]    - 08:00:56 - Checking prerequisites for standalone Hyper-V host(s) reporting...
      [INFO]    - 08:01:07 - Available Hyper-V server(s) for reporting: laa-host04 laa-host05 laa-host06 ml310e31
      [INFO]    - 08:01:10 - Gathering Hyper-V Host information...
      [INFO]    - 08:01:20 - Gathering Disk/Volume information...
      Échec lors de l'appel de la méthode, car [System.Object[]] ne contient pas de méthode nommée « op_Division ».
      Au caractère C:\scripts\Get-HyperVReport.ps1:494 : 13
      +             $DiskVolumeSpace =  "{0:N1}" -f ($DiskVolumeSpace/1024/1024/1024)
      +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation : (op_Division:String) [], RuntimeException
          + FullyQualifiedErrorId : MethodNotFound
    • Hi,
      
      Can you paste the all error messages that you are getting in the Powershell console? (All of the next lines of the "[INFO] - 08:01:20 - Gathering Disk/Volume information")
    • Hello, 
      
      I've have the same problem, please find below the complete log : 
      
      [INFO]    - 09:08:49 - Gathering Disk/Volume information...
      Method invocation failed because [System.Object[]] does not contain a method named 'op_Division'.
      At C:\Temp\Get-HyperVReport.ps1:494 char:13
      +             $DiskVolumeSpace =  "{0:N1}" -f ($DiskVolumeSpace/1024/1024/1024)
      +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (op_Division:String) [], RuntimeException
      + FullyQualifiedErrorId : MethodNotFound
      
      Method invocation failed because [System.Object[]] does not contain a method named 'op_Division'.
      At C:\Temp\Get-HyperVReport.ps1:494 char:13
      +             $DiskVolumeSpace =  "{0:N1}" -f ($DiskVolumeSpace/1024/1024/1024)
      +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (op_Division:String) [], RuntimeException
      + FullyQualifiedErrorId : MethodNotFound
      
      Method invocation failed because [System.Object[]] does not contain a method named 'op_Subtraction'.
      At C:\Temp\Get-HyperVReport.ps1:1810 char:17
      +                 $outmsftDiskUnallocatedSize = sConvert-Size -DiskVolumeSpace ($m ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (op_Subtraction:String) [], RuntimeException
      + FullyQualifiedErrorId : MethodNotFound
      
    • sConvert-BusTypeName : Cannot process argument transformation on parameter 'BusTypeValue'. Cannot convert the
      "System.Object[]" value of type "System.Object[]" to type "System.Byte".
      At C:\Temp\Get-HyperVReport.ps1:1823 char:74
      +                 $outMsftDiskBusType = sConvert-BusTypeName -BusTypeValue $msftDi ...
      +                                                                          ~~~~~~~
      + CategoryInfo          : InvalidData: (:) [sConvert-BusTypeName], ParameterBindingArgumentTransformationException
      + FullyQualifiedErrorId : ParameterArgumentTransformationError,sConvert-BusTypeName
      
      sConvert-DiskPartitionStyle : Cannot process argument transformation on parameter 'PartitionStyleValue'. Cannot
      convert the "System.Object[]" value of type "System.Object[]" to type "System.Byte".
      At C:\Temp\Get-HyperVReport.ps1:1824 char:95
      + ... tionStyleValue $msftDisk.PartitionStyle
      +                    ~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidData: (:) [sConvert-DiskPartitionStyle], ParameterBindingArgumentTransformationException
      + FullyQualifiedErrorId : ParameterArgumentTransformationError,sConvert-DiskPartitionStyle
      
      Method invocation failed because [System.Object[]] does not contain a method named 'op_Division'.
      At C:\Temp\Get-HyperVReport.ps1:494 char:13
      +             $DiskVolumeSpace =  "{0:N1}" -f ($DiskVolumeSpace/1024/1024/1024)
      +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (op_Division:String) [], RuntimeException
      + FullyQualifiedErrorId : MethodNotFound
      
    • Method invocation failed because [System.Object[]] does not contain a method named 'op_Division'.
      At C:\Temp\Get-HyperVReport.ps1:494 char:13
      +             $DiskVolumeSpace =  "{0:N1}" -f ($DiskVolumeSpace/1024/1024/1024)
      +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (op_Division:String) [], RuntimeException
      + FullyQualifiedErrorId : MethodNotFound
      
      Method invocation failed because [System.Object[]] does not contain a method named 'op_Subtraction'.
      At C:\Temp\Get-HyperVReport.ps1:1810 char:17
      +                 $outmsftDiskUnallocatedSize = sConvert-Size -DiskVolumeSpace ($m ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (op_Subtraction:String) [], RuntimeException
      + FullyQualifiedErrorId : MethodNotFound
      
      sConvert-BusTypeName : Cannot process argument transformation on parameter 'BusTypeValue'. Cannot convert the
      "System.Object[]" value of type "System.Object[]" to type "System.Byte".
      At C:\Temp\Get-HyperVReport.ps1:1823 char:74
      +                 $outMsftDiskBusType = sConvert-BusTypeName -BusTypeValue $msftDi ...
      +                                                                          ~~~~~~~
      + CategoryInfo          : InvalidData: (:) [sConvert-BusTypeName], ParameterBindingArgumentTransformationException
      + FullyQualifiedErrorId : ParameterArgumentTransformationError,sConvert-BusTypeName
      
    • sConvert-DiskPartitionStyle : Cannot process argument transformation on parameter 'PartitionStyleValue'. Cannot
      convert the "System.Object[]" value of type "System.Object[]" to type "System.Byte".
      At C:\Temp\Get-HyperVReport.ps1:1824 char:95
      + ... tionStyleValue $msftDisk.PartitionStyle
      +                    ~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidData: (:) [sConvert-DiskPartitionStyle], ParameterBindingArgumentTransformationException
      + FullyQualifiedErrorId : ParameterArgumentTransformationError,sConvert-DiskPartitionStyle
      
      Sorry but it's too long to be send in just one reply ;-)
    • I think, physical disk signatures may be empty on your Hyper-V host. Could you please run the following commands on your Hyper-V host (locally) and paste its output here?
      
      gwmi Win32_DiskDrive | select DeviceID,SerialNumber
      gwmi -Namespace root\Microsoft\Windows\Storage -Class MSFT_Disk | select SerialNumber
    • Please find below the result of your commands : 
      
      PS C:\Temp> gwmi Win32_DiskDrive | select DeviceID,SerialNumber
      DeviceID                                                    SerialNumber
      --------                                                    ------------
      \\.\PHYSICALDRIVE0                                          50014380101468D0
      \\.\PHYSICALDRIVE3                                          6fa8da2a33d34b73930aa257e425e6c0
      \\.\PHYSICALDRIVE2                                          942007b8e9d5408bac8375ab05cebe05
      \\.\PHYSICALDRIVE1                                          50014380101468D0
      \\.\PHYSICALDRIVE4                                          a6ce632e71c34d8aa80299ba8f4828f0
      
      PS C:\Temp> gwmi -Namespace root\Microsoft\Windows\Storage -Class MSFT_Disk | select SerialNumber
      SerialNumber
      ------------
      50014380101468D0
      6fa8da2a33d34b73930aa257e425e6c0
      942007b8e9d5408bac8375ab05cebe05
      50014380101468D0
      a6ce632e71c34d8aa80299ba8f4828f0
      
      
    • For information, I tried on several host it works on part of them, and failed on other ... It seems it's failed on host with Local Storage.
    • OK. I have a few questions about your infrastructure to clarify the situation and I will send a test copy of script with fixed. Could you please contact me through this e-mail? serhatakinci@gmail.com
    • Hi Serhat,
      Very nice script! But I have the same Problem:
      [INFO]    - 18:05:50 - Gathering Disk/Volume information...
      sConvert-Size : Das Argument kann nicht an den Parameter "DiskVolumeSpace" gebunden werden, da es NULL ist.
      In C:\scripts\Get-HyperVReport.ps1:1484 Zeichen:71
      +                     $clusterDiskSize = sConvert-Size -DiskVolumeSpace ($msftDisk ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidData: (:) [sConvert-Size], ParameterBindingValidationException
          + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,sConvert-Size
      
      I use SAS storage on W2k12R2.
      
      Reinhard
    • Hi again. This issue affects only limited number of Standalone Hyper-V host reportting process. The physical disk serial numbers conflict is the reason of this issue.
      
      I'll release a new minor update (v1.1) within a few days which fixes several issues (including this) and some minor improvements.
      
      Gigant Olivier, thank you for your cooperation to fix this issue.
101 - 101 of 101 Items