The Unlicensed license for host…

Recently I spent some time upgrading our corporate VMware environment from ESX4.1 to ESXi 5. Fun times I know. For most of the hosts, I was able to use the update manager to upgrade and only one host was short on space that required a full re-install from CD.

The upgrades weren’t without incident. I had the unfortunate incident of running into an error of “The Unlicensed license for host <hostname> does not include vSphere HA. Upgrade the License”.

Doesn’t my ESXi 5 license include all the bells and whistles? Yes, yes it does. It wasn’t until I dug into this one a bit deeper that I noticed that the vCenter was reporting this for the host:

When looking at the console, you can clearly see that its a 5.0 host.

The Fix!

Luckily, the fix is really easy. Simply remove the host from your vCenter and re-add. Sure you’ll need to re-add it to your dVS if you have one and re-attach your host profile if you are using those. But in the end, its thankfully a very painless fix to what I would call a bug.

Powershell Error checking

Being a programmer by trade, I get thrown into many projects that aren’t always my forte, but I can figure them out and get them working the way that I want.

I’ve been messing with powershell for a while now with VMware, but never really getting into big time scripting with it. Its mainly be something to use to accomplish some various tasks on mutliple hosts. Very little error checking in the scripts since I’m watching them was they run. If I want to put them into a scheduled task or automate them from a web page, more error checking is needed.

Recently, we starting messing around with automation of Exchange 2010 provisioning using Powershell. There are some great cmdlets to accomplish this, but I ran into a particular issue that really bothered me as a programmer and since I spent more than 5 minutes unsuccessfully googling the answer, I figured I’d write this post.

My issue was this, I was attempting to put some wrappers around certain cmdlets to get back whether or not they completed successfully. I hate to be the bearer of bad news, but shit doesn’t always run as you think it would.
I think I found a good way of handling the powershell scripts that do not return a true or false and were causing some false positives.

The issue occurred in the functions such as remove-mailcontact where I would have something along the lines of:

if(remove-mailcontact -identity $ID -Confirm:$false)
    "+OK Contact Removed"
    "-ERR Unable to remove contact."

This would alway return the -ERR statement.

So now I have expanded upon that and have the following:

Remove-Mailcontact -Identity $ID -Confirm:$false -DomainController $DC -ErrorVariable:err
    "-ERR Unable to remove contact"
    "+OK Contact Removed"

This second method seems to be doing what I want and goes to the appropriate domain controller so I think I’m on the right track…we just need to update the various scripts now. For a little more information on the errorVariable adn other default switches you can pass a cmdlet, check out this blog post from the Microsoft PowerShell Blog.

HMC CreateFolder

Today I had the chance to get back to some code for CreateFolder which creates a public folder within our Exchange 2007 environment support by Microsoft’s Hosted Messaging and Collaboration frame work. I’ve been highly critical of Microsoft’s code before, and today has taken that to a new level.

Here is what I’m dealing with. First, let’s go to the documentation on TechNet:

Pretty clear that we have a few required parameters and a few optional ones to set some quotas. These optional parameters are what will soon drive me to uncontrollable rage.

Next, let’s look at the example directly from the web service. Here’s what it states we can pass:

POST /mpsws/ManagedEmail2007/Service.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: &quot;;

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;soap:Envelope xmlns:xsi=&quot;; xmlns:xsd=&quot;; xmlns:soap=&quot;;&gt;
    &lt;CreateFolder xmlns=&quot;;&gt;
      &lt;CreateFolderRequest xmlns=&quot;;&gt;

Again, everything looks great. postStorageQuota and storageQuota are both there and seem perfectly reasonable.

So let’s actually SEND that command to the web service. Here’s the error I get back:

The element 'CreateFolder_Request' in namespace '' has invalid child
element 'postStorageQuota' in namespace ''. List of possible elements expected: 'prohibitPostQuota, server, issueWarningQuota' in namespace ''.The element 'CreateFolder_Request' has invalid child element 'postStorageQuota' . List of possible elements expected: 'prohibitPostQuota, server, issueWarningQuota' .

You get this is you change PostStorageQuota to prohibitPostQuota.

The element 'CreateFolder_Request' in namespace '' has invalid child element 'storageQuota' in namespace ''. List of possible elements expected: 'prohibitPostQuota, server, issueWarningQuota' in namespace ''.The element 'CreateFolder_Request' has invalid child element 'storageQuota' . List of possible elements expected: 'prohibitPostQuota, server, issueWarningQuota' .

In case you missed it, they changed the variable with in the back end server code, and failed to tell anyone that they made this change. Awesome!

This appeared only after we made the jump up to HMC 4.5 rollup 9. Before the PostStorageQuota and StorageQuota worked as expected. Needless to say, I’m less than impressed that they changed properties on me and failed to update the documentation OR the web service example. I guess figuring this out with trial by fire is the way that Microsoft expects you to learn. Thanks Microsoft!

XCode Errors

By trade, I’m a PHP/C programmer and rarely have time to really work on some fun stuff at home. But recently, I have been trying to spend some more time working on some fun projects and getting my hands dirty with XCode and the iPhone SDK.

I recently downloaded the latest and greatest version of XCode and overwrote the beta versions I had been running with before. The installation went fine and I decided I would load up one of the demo apps to make sure that everything was indeed still working as I expected.

Unfortunately, I was greeted with this:
XCode Error

I know, pretty clear what that error is right?

If you’re new to XCode as I am, you were probably scratching your head thinking this is really messed up. The console logs didn’t make it much clearer so I figured that something got messed up during the installation. Since I had been running the beta version before, I must have missed something in the instructions or a check box in the installation that is not causing an issue.

I tried un-installing the iPhone SDK and re-installing to see if that fixed the problem…no luck there.

I tried removing the /Developer directory and re-installing. Still no luck.

I re-applied the 10.5.5. update as I had a few issues with it when I originally installed it. Then I removed the /Developer directory again and re-installed the iPhone SDK. STILL no luck.

At this point I was starting to think that I had some library that was b0rked beyond reason and the only easy way to take care of the issue was to blow away the machine and re-install.

Luckily, I happned to find this post.

Simply removing the Info.plist from my root folder on the hard drive solved the issue.

What a freaking pain in the ass it was to find that simple solution. Thanks to Google and some helpful coders on the internet, I’m happily playing around with iPhone development.

Hopefully this blog post will return the favor or at least get their page a higher rank so others can resolve this issue if they run into it.