vmware

VMware Scripts

PowerCLI get list of vMotion IP’s in use



$Array = @()
$Clusters = Get-Cluster | Sort Name
ForEach ($Cluster in $Clusters){
$VmHosts = $Cluster | Get-VmHost | Where {$_.ConnectionState -eq “Connected”} | Sort Name
ForEach ($VmHost in $VmHosts){
$Array += Get-VMHostNetworkAdapter -VMHost $VmHost.Name -VMKernel | Where {$_.VMotionEnabled -eq “True”} | select VmHost,IP
}
}
$Array | Out-GridView

 

Source: http://blog.jgriffiths.org/powercli-get-list-of-vmotion-ips-in-use/

Read More »

Script based vmware "DRS" (Distributed Resource Scheduler)

Recently I found a very interesting script to do something like vmware DRS.

https://ryanmangansitblog.com/2013/03/08/vmware-host-cluster-vm-memory-balancing-script-implementation/

There are some points to improve and the you can use it very well.


Use it only on a certain cluster

change the line 5 from

before
$objHosts = get-vmhost;