Automation and reporting dashbaord for VMware and Hyper-V systems


#1

Hi,
i build this automation and reporting dashbaord for my current customer. It is managing 3800 vmware and hyper-v hosts with 16000 vms running. You can see the performance and config details for every single host and vm and can do basic actions like start, reboot, shutdown, snapshot etc. The data displayed is a mix of sql querys and live querys to the displayed system.

Currently running on IIS, UD version 2.1.0 Enterprise.

So it starts with a AD based login:

On the dashbaord page you can see the overall status and count of all systems. Every text field a clickable and takes you to the deatil page of the object/site

Global search to find every object

Also a query like search to filter the results and display the results in a dynamic generated grid

Display the migration progress over time (vmware to hyper-v)

Detail pages for hosts and vms with some more information not displayed in the screenshots like vms running on that hosts or logedin users on a terminal server, running processes and services

Just ask if you want to get parts of the code.

And @adam, thank you so much for this amazing module!


#2

that is exctly what I’m looking for. I’d love to have access to it all :slight_smile: As a service provider with both VMware and Hyper-V …it looks ideal. Please share


#3

This is awesome! Love it!


#4

I’m on a tide schedule right now and at the momet the code is ugly and heavily bound to the customer environment, but i’ll try the generalize it and eventually share (at least parts of) it.


#5

Great job! I haven’t had the pleasure of working with the Enterprise version due to lack of funds, so I haven’t been able to play with any authentication yet. Did you find it easy to setup an AD based auth?


#6

Thanks.

AD auth is easy, even a txt file with user names would be possible. This is how it do it atm:

$FormLogin = New-UDAuthenticationMethod -Endpoint {
  param([PSCredential]$Credentials)
  
  # only member of this group have access
  $adgroupname = 'ad group name'

  # add context for current domain
  Add-Type -AssemblyName System.DirectoryServices.AccountManagement
  $DS = New-Object System.DirectoryServices.AccountManagement.PrincipalContext('domain')
  
  # check if the credentials are correct
  $username = $Credentials.GetNetworkCredential().UserName
  if($DS.ValidateCredentials($username,$Credentials.GetNetworkCredential().Password)){
    # check if user is a member of that ad group
    if(Get-ADGroupMember -Identity $adgroupname | Where-Object{$_.Name -eq $username}){
      # Success -> redirect to dashbaord
      New-UDAuthenticationResult -Success -UserName "$username"
    }
    else{
      New-UDAuthenticationResult -ErrorMessage "Only members of $adgroupname have access."
    }
  }
  else{
    New-UDAuthenticationResult -ErrorMessage 'Wrong username or password.'
  }
}

$LoginPage = New-UDLoginPage -AuthenticationMethod @($FormLogin)

New-UDDashboard -Title 'xxx' -Page $pages -LoginPage $LoginPage


#7

Looks very much straight forward. Thanks for sharing!


#8

Hi @psott,

What you’ve done is stunning ! I’m very much interested if you’re up to share some of your code.

Many thanks in advance for getting back to me :blush:

Cheers !


#9

Hi @psott,
you have does a beautiful Dashboard.
it’s possible to share a part of script?
I have a question for manage the variable “DefaultViserver”. between the page, i have a error message :
“You have modified the global:DefaultVIServer and global:DefaultVIServers system variables. This is not allowed. Please reset them to $null and reconnect to the vSphere server.”
have you encountered this problem?
if so, how did you handle this problem?

thank you in advance,
and congratulations for the dashboard.
excuse me for my poor English.


#10

I don’t have access to my code right now, but you have to connect to your viserver(s) at the start of the dashboard and then reconnect via the $global:defaultviservers variable with the session secret.
I‘ll post an example on monday.


#11

@Fox_Zoulou
Here is the code:


#12

It’s perfect
Thanks @psott for your explanations :slightly_smiling_face:


#13

This is awesome, any chance you’ll post the code at some point? If not, could you share some samples of the tables of hosts/vms pages? (second image, the one after the ad auth image)


#14

This is absolutely brilliant! I would also like to see some of your code


#15

Hi, @psott Alex

I was looking for an easy way to read and display data about my hyper-v network, as we have approaching 400 VM’s running on our network. I wondered if you have had a chance to sanitise the work you did for the Hyper-v segment, and might share it? Hopefully things have become a little less busy for you! :slight_smile: