Archive for August, 2009

Monitoring Tasks with PowerCLI

August 31, 2009

I’m posting this here more so I don’t forget it (Besides, every time I learn something new, it pushes some old stuff out of my brain. Remember when I took that home winemaking course, and I forgot how to drive?), but I think some of you will also find it useful if you don’t know about it already.

There are many times when we delve under the hood of the PowerCLI interface and go straight to the .NET Toolkit, and while things like Onyx will go a looooong way towards simplifying this, it won’t necessarily show you some of the tricks Carter and team have built into PowerCLI to help us with stuff, such as forcing a loop to wait for the task in each iteration to complete before moving to the next iteration.

It’s probably easier to do this with an example. So lets say for example, you have a situation where you want to reconnect all hosts in your inventory. To do so, you could use the following code (after first connecting to your target vCenter server):

# Get a Managed Object Reference to all ESX hosts managed by the VC
$esxMoRefs = Get-VMHost | % {Get-View $_.Id}
# Loop through each host
foreach($esxMoRef in $esxMoRefs)
# If the host is not already disconnected (ie status is gray)
# disconnect it first
if ($esxMoRef.OverallStatus.ToString() -notcontains "gray")
# disconnect host

Write-Host "Reconnecting host :" $esxMoRef.Name
# Build HostConnectSpec to force reconnect
# if host is already managed by another VC
$hostConnSpec = New-Object VMware.Vim.HostConnectSpec
$hostConnSpec.force = $True
# Now reconnect the host

Now that all looks well and good, however there are 2 problems.


Create Users with the HP iLO CLI

August 22, 2009

I must admit, configuring stuff on HP boxes via their Integrated Lights Out (iLO) is something you don’t have to do often… generally you do it when you set a new box up and that’s it. But with the amount of blades coming into the lab these days, I figured it was about time I started using the CLI to do stuff rather than the web based UI.

Of course the interface is fully documented here, but the commands, contexts and properties are documented in different sections so it doesn’t flow that well. So I thought what the hell, I might as well put up a few posts on the quickest way to do some common tasks. Starting with this one.

The task at hand was to create some users on each blade in order to play around with vSphere’s Distributed Power Management feature. You can do this in 2 simple commands:

create /map1/accounts1 username=dpm_usr password=a_strong_password
set /map1/accounts1/dpm_usr group=oemhp_power

This will result in a user being created with only the ‘Virtual Power and Reset’ privilege, which is all that is required for DPM to work. Do we like the principle of least privilege? Yes we do :). This looks as follows in the iLO UI:

Pretty cool. Doing this via the CLI on 16 blades sure was a lot faster than pointing and clicking my way through. Will post up some more examples as I come across them!

Workaround for vCenter 4.0 Unattended Installer Bug

August 22, 2009

As I mentioned in the video that accompanied my Ghetto vCenter 4.0 Unattended Installer post, the vCenter 4.0 command line installer has a minor bug, in that if you don’t have Named Pipes enabled on your remote SQL Server, a warning message will pop up and halt the installation until you hit OK. You don’t get this warning message if you run the GUI installer.

Today I inadvertently found a workaround for this however, which involves simply adding one of the available command line arguments that isn’t really relevant for a fresh install, which is FORMAT_DB=1. This option is for where you have an existing database that you want to blow away, however it seems that using it also eliminates the annoying and unnecessary Named Pipes message box.

VMware already confirmed that this was a bug in the installer, but since the workaround doesn’t involve any code changes maybe it’s easier to just change the installer documentation to say that FORMAT_DB=1 is mandatory unless you’re actually doing an upgrade.

I’ll have to recut the video now and leave NWA playing the whole way through 😀

vSphere 4.0 Quick Start Guide – Nearly Here!

August 21, 2009

As you’ve probably read on a few other blogs more popular than this one (only just though :D), I have penned a chapter in an upcoming book, vSphere 4.0 Quick Start Guide. It was a collaborative effort amongst 6 of us, EMC gun Bernie Baker, Vizioncore Technical Architect Thomas Bryant III, Licensed to vKill Duncan Epping, forum legend Dave Mishchenko, the PoSh Frenchie Alan Renouf and little ol’ me. I dare not call these people peers, they are indeed a league above me and I am honoured to have my name in print alongside theirs.

The aim of the book started out as a no bullshit guide for both those who are new to vSphere and those who are new to the VMware platform, but after reviewing the chapters I can say that it is much, much more. Although it won’t have the depth of some of the other books on the market, it won’t have the price either and has been laid out to facilitate fast access to the most common tasks a VMware admin needs to do. But we went one step further – every task is covered from 3 angles, the vSphere Client, the ESX CLI / rCLI and PowerShell. There is something in there for everyone.

Keep an eye out on any of our blogs for more details when it’s released. Hopefully it will be available in time for VMworld, via independent book publisher Lulu.

No More HP ESXi "Embedded"

August 17, 2009

I don’t know what is going on at HP these days, I really don’t. Either the VMware / HP relationship is souring a bit, or HP have appointed an imbecile in charge of their side of the deal.

For reasons unknown to man, HP never followed the path of Dell and IBM by integrating their CIM providers with VMware’s ESXi media – it was always a separate download. But at least that separate download was obtainable from VMware. With vSphere 4.0, they have gone one step further and removed the ability to download the HPified ESXi from VMware’s site – you now have to go to to get the bits. And what do you get for your trouble? Well to be honest – not a helluva lot. That annoying ProcHot System Board 3 warning is _still_ there on AMD hardware (I thought that was fixed in ESXi 3.5 U4???), but at least you get some storage information now. Local storage information. When ESXi boots it runs from RAM – you could rip the disks out that it was installed onto and nothing would happen. So it’s not really useful there. As for anyone running datastores on local disks, I guess it may be useful. But I’m sure those people are in the minority.

And now, in a somewhat contradictory move, it seems they have dropped their ‘ESXi on a stick’ part and are recommending people buy either PNY USB devices or Kingston SD cards if you are using their latest ProLiant G6 hardware, which have SD slots onboard (way to follow Dell).

So I need to download VMware software from HP, but buy a part for a HP server from someone other than HP. ESXi Embedded is as good as dead as far as HP are concerned. And as for VMware maintaing separate documentation for “ESXi Embedded” versus “ESXi Installable”, well it hardly seems worth the effort.

Either HP see the future like I do (PXE booting ESXi, no need for any media), or someone in there has got things seriously messed up. I’m not confident it’s the former.

This Cloud needs an enema!

August 11, 2009

In the words of Jack Nicholson’s Joker (well… almost), it’s time to clean out the crap from the Cloud and everything the IT media has associated with it over the past year or so, and get down to business.

I’m going to make a bold statement here, and don’t mean any disrespect to anyone in doing so, but I think a lot of the focus in the blogosphere currently is not quite on track with regards to Cloud. I’ll condition that statement further by saying if you deal with under 1000 servers and less than 3 datacenters in your environment, you can safely ignore that comment and the rest of this post. And I don’t mean that in a “my dick is bigger than yours” sense – as I’ve said many times before, I’ve only worked in large environments, it’s the only thing I know (and even that is arguable).

So what do I mean by not on track? I look at the cloud related stuff on the Planet V12n aggregator (which I _still_ seem to be dropped from, John :P) and I see stuff about UCS, about API’s from various Cloud providers, and general commentary about the Cloud not being ready for primetime etc etc. While UCS and API’s may be interesting (and important), and the Cloud may not be ready for primetime, it is becoming increasingly apparent to me that there is a lack of thought and dialogue surrounding a critical piece of the Cloud puzzle that you should start putting some thought into now. And you don’t need any new hardware or software to do it. I’m talking about metadata.

I’m not for a second claiming this is anything new, it seems there is no shortage of startups seeking venture capital for their cloud metadata based apps these days. But these startups are not offering guidance as to _what_ metadata should be defined – they’re developing products to store metadata and make decisions based on it. And really, that’s not such a big deal because there’s only so much of this metadata that is broadly applicable to all enterprises (and plus you cant really base a business model on IP associated with the metadata definition of itself), but you have to wonder how much success such software can have in the absence of the metadata itself!