SVC: Find WWPN

Today we had (once again) hardware troubles. We ended up replacing a lot of things, but in the end it was a) the HBA and b) apparently some memory DIMMs. Now, that isn’t SVC related. However, we built in another HBA (from our Standby hardware), which apparently already had been assigned to a host. Now, since you can’t search for a WWPN (at least not that I know of), I ended up writing a little script (yup, AGAIN) in order to do that for me! ...

November 15, 2010 · 2 min · 277 words · christian

TSM Client: Service Script for Solaris 10

Today I’ve been fighting with Solaris 10 and the SMF Manifest (others would call it init-script …). Since I wanted to do it the proper way (I could have used a “old-style” init-script, but I didn’t wanna ..), I ended up combing the interweb for examples .. As it turns out, not even IBM has documented a way, on how to do this. In the end this is what I’ve come up with: ...

October 27, 2010 · 2 min · 255 words · christian

Install issues with Proliant BL460c G6 and Windows Deployment Services

We’ve been dealing with authentification issues on newly delivered HP Proliant BL460c G6 blade servers. Most threads on HPs customer forum, suggests changing the NIC driver, embedded within the WDS boot image. We tried that, but still were getting the following error: WDS: installation issues As it turns out, it ain’t really so damn hard .. we tried several times changing various things within the boot image, but it still didn’t change anything. Somehow it was rather easy. ...

October 22, 2010 · 1 min · 190 words · christian

Create an offline snapshot of a VM

We’re currently thinking about automating Windows Updates and the involved disaster snapshot-copy to a degree, where we don’t need to intervene anymore. Right now, we already have a rudimentary scheduler in place, which does the reboots for some (200 ..) systems already. Now, we’d like to extend it to also cover the bi-weekly Windows Update spree. Since PowerShell (and PowerCLI) work quite well with vSphere automation, I cooked up the below script to first shutdown a virtual machine (for snapshot consistency reasons), then take a snapshot and power on the virtual machine again afterwards. ...

October 22, 2010 · 2 min · 331 words · christian

Locking down Firefox

Once again, I had the task of locking down Firefox, so users couldn’t use it to do any harm on a terminal server. Thankfully there’s the guide over at the Faculty of Engineering of the University of Waterloo (by David Collie), who shows which parts to modify. However, finding the particular part in the Javascript is rather hindersome, so here a short Unix-Diff (for thos who’re able to read unified diffs) as well as the whole file. ...

October 12, 2010 · 1 min · 171 words · christian

Modified SnapReminder

Well, PowerCLI makes my life a little bit easier. Believe it or not, each of us vCenter infrastructure admins has one of these: a Windows admin, thinking a snapshot is also a backup. Thankfully, Alan Renouf over at virtu-al.net wrote the SnapReminder, which already helped me a lot! However, occasionally the script isn’t finding the snapshot author (for whatever reason). Since I want a notification in that case, I modified the script a little bit to suit my needs. ...

October 8, 2010 · 3 min · 604 words · christian

Fix Path Selection Policy for a whole vCenter Cluster

These last few weeks, I’ve been toying with PowerCLI (and PowerShell for that matter). One thing I do have to say, is that Microsoft finally did it right! It’s a useable, program-able command line interface for Windows after all! Thanks to Ivo Beerens and his post " Best practices for HP EVA, vSphere 4 and Round Robin multi-pathing", I was able to come up with the below: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 # LICENSE: GNU General Public License v2. (see LICENSE.txt) # COPYRIGHT: Copyright 2010 Christian Heim <christian.heim@barfoo.org> # Add the VI-Snapin if it isn't loaded already if ( (Get-PSSnapin -Name "VMware.VimAutomation.Core" -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapin -Name "VMware.VimAutomation.Core" } if ($args.length -lt 2) { Write-Host Write-Host "fix_multipathing: " Write-Host " - Display-Name of the vCenter cluster, we should check all LUNs" Write-Host " on all available Hosts, and set the Path Selection Policy" Write-Host " to the selected one." Write-Host "" Write-Host " - Path Selection Policy" Write-Host " Possible:" Write-Host " - RoundRobin (VMW_PSP_RR, Round Robin)" Write-Host " - Fixed (VMW_PSP_FIXED, Fixed)" Write-Host " - MostRecentlyUsed (VMW_PSP_MRU , Most Recently Used)" Write-Host exit 1 } $vcserver = "vcenter.home.barfoo.org" $cluster = $args[0] $target_policy = $args[1] # Since I do have only SVC-Disks connected to my hosts, I limit the search to those $canonical_name = "naa.6005076801808021*" Write-Host "Target vCenter Cluster: " $cluster Write-Host "Target PSP: " $target_policy Write-Host switch ($target_policy) { RoundRobin { $display_policy = "VMW_PSP_RR"; } MostRecentlyUsed { $display_policy = "VMW_PSP_MRU"; } Fixed { $display_policy = "VMW_PSP_FIXED"; } default { Write-Warning "Unknown PSP selected! Please consult the help and try again."; exit } } Connect-VIServer $vcserver >/dev/null 2>&1 Write-Host "Found "@(Get-VMHost -location ( get-cluster $cluster ) | Get-ScsiLun -CanonicalName $canonical_name -LunType "disk" | where {$_.MultipathPolicy -ne $target_policy }).Count" LUNs in "$cluster" not using Path Selection Policy "$display_policy Get-VMHost -location ( get-cluster $cluster ) | Get-ScsiLun -CanonicalName $canonical_name -LunType "disk" | where {$_.MultipathPolicy -ne $target_policy } | Set-ScsiLun -MultipathPolicy $target_policy >/dev/null 2>&1 This works great, however you could make it work on the whole vCenter inventory, which I don’t want. We usually add LUNs to a single cluster at one time. Only thing you might need to change, is the canonical name. Mine simply says “find all SVC LUNs” and you might need to change it, if you’re using a different storage.

October 7, 2010 · 2 min · 426 words · christian

SAN reporting

We do have some customers, who get charged on a monthly basis for their SAN usage. We already had “reporting” in place, but that wasn’t very flexible. So I went ahead and rewrote the current reporting script from scratch, and this is what I’ve come up with: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 #/bin/bash # LICENSE: GNU General Public License v2. (see LICENSE.txt) # COPYRIGHT: Copyright 2010 Christian Heim <christian.heim@barfoo.org> svc_sshkey="~/.ssh/svc-id_dsa" svc_addr="10.144.0.150" svc_user="admin" if [ -z $1 ] ; then echo "Please rerun this script with some kind of filter value" echo "(for example '$0 NAS')" exit 1 else filter=$1 fi IFS=" " DISK="$( ssh -i $svc_sshkey -l $svc_user $svc_addr svcinfo lsvdisk -nohdr -bytes -delim : | egrep -i "V.*$filter" | cut -d: -f2,8 | sort )" # Get a unique list of systems SYSTEMS="$( echo $DISK | sed "s, ,n,g" | cut -d -f1 | sed 's,^V,,' | cut -d_ -f1 | sort -u )" for system in $SYSTEMS ; do VDISKS="$( echo $DISK | sed "s, ,n,g" | grep $system | sed "s,:,: ," )" SYSTEM_TOTAL="$( echo $DISK | sed "s, ,n,g" | grep $system | cut -d: -f2 | awk '{SUM += $1} END { printf "%.2f", SUM }' )" for vdisk in $VDISKS ; do NAME="$( echo $vdisk | cut -d: -f1 )" SIZE="$( echo $vdisk | cut -d: -f2 | sed "s,^ ,," )" GB_SIZE="$( echo "$SIZE / 1024 / 1024 / 1024" | bc )" if [ $GB_SIZE -eq 0 ] ; then GB_SIZE="$( echo "scale=2; $SIZE / 1024 / 1024 / 1024" | bc )" GB_SIZE="${GB_SIZE/./0.}" fi echo "$NAME: ${GB_SIZE/./,} GB" done SUB_TOTAL_SYSTEM="$( echo "scale=2; $SYSTEM_TOTAL / 1024 / 1024 / 1024" | bc )" echo "SUB TOTAL: ${SUB_TOTAL_SYSTEM/./,} GB" echo done TOTAL="$( echo $DISK | sed "s, ,n,g" | cut -d: -f2 | awk '{SUM += $1} END { printf "%.2f", SUM }' )" TOTAL="$( echo "scale=2; $TOTAL / 1024 / 1024 / 1024" | bc ) GB" echo "------------------------------------------------" echo $TOTAL exit 0 I gotta say, once again I learned a lot … two new things about awk! ...

August 20, 2010 · 2 min · 406 words · christian

Displaying Windows Architecture with bginfo

On all our servers in the basement, we do have bginfo installed, in order to quickly get certain information. Now as I was struggling with a big Service Pack roll out, I looked into making bginfo also display the OS architecture. But apparently it isn’t that easy … At least bginfo doesn’t provide it by default. After (yet another hour in front of Google), I finally found what I was looking for. At first I didn’t limit the query on a specific CPU, but that turned out to be shitty (x32 being displayed twice, once for each CPU). But after limiting it to DeviceID=‘CPU0’ it works like a charm 😉

June 18, 2010 · 1 min · 110 words · christian

AutoYAST and custom swap partitioning

Well, we’ve been discussing our swap partitioning the last few days at work, and I finally got around to implementing it. Again, it proved to be kinda hard, basically because AutoYAST decides to do things differently.

June 3, 2010 · 2 min · 329 words · christian