Rescanning your storage in an ESX cluster
Nothing is more annoying then having to rescan your VMFS filesystems or HBA’s in ESX3. Going from node to node and click all the time. If you have one or two nodes this is do-able, but i’m maintaining multiple clusters with a grand total of 30 nodes..
However VMWare created PowerCLI, perhaps the most powerfull piece of management software VMWare has released to date. With PowerCLI you can automate the most annoying of jobs with ease.
Here is a little script to let all your nodes scan their HBA’s and VMFS filesystems.
You can add an host as argument to the script (FQDN), to let it run the commands at the host only.
connect-viserver your.virtualcenter.box
if ($args -eq $null)
{
get-vmhost | foreach-object
{
get-vmhoststorage -VMHost $_.name -RescanAllHba -RescanVmfs
}
}
else
{
get-vmhoststorage -VMHost $args -RescanAllHba -RescanVmfs
}
*UPDATE* changed the script, see comments for more info.
Gentoo world update 08/11/2009
Well the Gentoo DEV team messed up the current world build, i’ve just upgraded the first of 8 servers to the new “CURRENT” version and i’ve already walked into a world of hurt that should never have been necessary.
- syslog-ng updated to 3.0
the config is not backwards compatible so you need to rewrite the whole thing. Now that’s ok, it happens, but the default config supplied by the gentoo team also does not work. They made an error in the init.d file causing the config to always fail the checkconfig statement (just add the -f flag). And for some reason the syslog filter doesn’t exist/work anymore, causing my beautifull scriptings that use that log to fail on me
- open-vm-tools updated to 0.0.20091015.201664
the .la files in /etc/vmware-tools/plugins/common get installed causing vmtoolsd to never start, remove them and it works fine. Furthermore you now need open-vm-tools-kmod and don’t forget to add the modules to the /etc/ modules.autoload.d/kernel.2.x file or you’ll have very poor VMWare performance.
- /bin/setfont moved in the config file, but the file self didn’t move
- /bin/loadkeys moved in the config file, but the file self didn’t move
all in all a very bad world upgrade. Hope they start taking a better look at these things. The gentoo install base isn’t extremely wide like a debian, ubuntu or redhat. But this will give their user unnecessary headaches and make the consider to switch to another distro…
I’ll wait with the other servers until they fixed this stuff…
Retrieving Missing WMI classes
When missing WMI classes in the namespaces you can take ages getting something to work.
However you can easly regenerate the WMI classes that should be there in the first place using the command
wmiadap /F
I’ve been using it in windows 2003 and it works like a charm!
EX2007 Queue monitoring
Here is the same Queue monitoring script, but then written for exchange 2007.
##
# Exchange queue monitoring for exchange 2007
# Written by Marcel Stangenberger
#
# Created on 27/10/2009
# Version 1.0
##$queuecount = (get-queue | where {$_.MessageCount -gt “20″})
$queueview = (get-queue)
$messageview = (get-queue | where {$_.MessageCount -gt “20″} | get-message)
$redalert = “red ” + (get-date)
$greenalert = “green ” + (get-date)
$tmppath = “C:\Program Files (x86)\Quest Software\Big Brother\BBNT\tmp\queue”
$logpath = “C:\Program Files (x86)\Quest Software\Big Brother\BBNT\Logs\queue”if ( test-path $tmppath )
{
remove-item $tmppath
}if ( $queuecount -eq $null )
{
$greenalert | out-file -encoding ASCII $tmppath
$queueview | out-file -encoding ASCII $tmppath -append
$messageview | out-file -encoding ASCII $tmppath -append
}
Else
{
$redalert | out-file -encoding ASCII $tmppath
$queueview | out-file -encoding ASCII $tmppath -append
$messageview | out-file -encoding ASCII $tmppath -append
}if ( test-path $logpath )
{
remove-item $logpath
}move-item $tmppath $logpath