www.vmwareadmins.com

how many VMs can you put in a box?

  • Increase font size
  • Default font size
  • Decrease font size
Welcome to VMwareAdmins.com!

Trying to find some cluster stats...

E-mail Print PDF

So, I've been sending a monthly report to my supervisor, which was a convoluted mess of scripts that I had.

Today, I decided to quit being lazy and throw them all together.

 
foreach ($cluster in get-cluster)
{
$guestcount = $cluster | get-vm | measure-object
$hostcount = $cluster | get-vmhost |  measure-object
$view = Get-View $cluster.id
"" | select-object @{Name="Cluster"; Expression={$cluster.name}},
       @{Name="Hosts"; Expression={$hostcount.count}},
       @{Name="VM's"; Expression={$guestcount.count}},
       @{Name="HA Enabled"; Expression={$view.configuration.DasConfig.Enabled}},
       @{Name="DRS Enabled"; Expression={$view.configuration.DRSConfig.Enabled}},
       @{Name="Admission Control Enabled"; Expression={$view.configuration.dasconfig.Admissioncontrolenabled}},
       @{Name="CurrentFailoverCapacity"; Expression={$view.Summary.CurrentFailoverLevel}},
       @{Name="TotalCPU(MHz)"; Expression={$view.Summary.TotalCpu}},
       @{Name="TotalMemory(GB)"; Expression={([double]('{0:#.##}' -f ($view.Summary.TotalMemory / 1GB)))}}
}
 

Last Updated on Tuesday, 30 June 2009 12:46
 

How to find the name, when you only know the MAC?

E-mail Print PDF

 So, after the mess this weekend (see my twitter)... I had an IP conflict on my vCenter test server... Luckily Server 2008 told me the MAC of the offending machine. Which just happened to have a VMware Mac :)

 

I busted out the trusty PowerCLI and this is what I came up with!

 

 
$report =@() 
Get-VM | Get-View | %{ 
 $VMname = $_.Name 
 $_.guest.net | where {$_.MacAddress -eq "00:50:56:4b:29:33"} | %{
        $row = "" | Select VM, MAC
        $row.VM = $VMname 
        $row.MAC = $_.MacAddress 
        $report += $row 
  } 
  } 
$report 

Last Updated on Tuesday, 30 June 2009 06:38
 


Page 20 of 22

Follow Me On...

Facebook linkedin twitter youtube

Polls

What Version of vSphere are you purchasing?