Tricking around in ESX VirtualCenter

April 2nd, 2009 No comments

Virtualization is great…it’s the current hot item in IT. Everyone is doing it; it’s the future of datacenter consolidation.

…it’s my current project.

After a few days of research, some CBTs, and a few meetings, we finally decided to start implementing our grand master plan. Brand new 16 core server with 128GB RAM…check, ESX licensing…check, sanity…check.

After deciding on our virtual network and disk architectures, we finally went to work. VMware is ungodly easy to setup, it’s almost scary.

Next step was getting our VirtualCenter server up and running, and this is when the fun begins (and by fun, I really mean WTF). In the title of the post, I mentioned something about “tricking” around in this particular portion of the setup process, so allow me to explain.

VirtualCenter is basically just a consolidated ESX host management solution. Instead of connecting to each ESX host individually to manage it, VirtualCenter (VC from now on) allows you to manage all your hosts from one area. In VC, you can make ESX clusters, manage Distributed Resources, manage VMotion, and a whole bunch of other goodies. It runs on top of a basic Windows server, uses Active Directory for authentication, and is supposed to make everything nice and easy. Indeed, it does; the interface is great, and manageability is superb…it makes my job all that much easier.

Installation is pretty straightforward, and after clicking “Next” a few times for the VI Client and for the VC server, you think you’re golden. Of course, there are some steps you have to perform as pre-requisites for VC.
First, you need to create a database for it. Well, I’m lying, you don’t particularly HAVE to create a database for it, since it would offer to install MSDE in the same step, but we have a SQL 2005 Cluster…why not take advantage of it? So, created a database, and assigned a domain user myDomain\esxdb as db_owner to it.
Next, create a system DSN to point to that database using NT Authentication. Make sure you use the SQL Native client since it’s SQL 2005, and you’re ready to roll.
Finally, during install, provide the installer with the DSN name, the username, and the password that it will need to connect to the database.

Wait wait wait…so what about this trickery you keep talking about?
Let me get to that!

Next up…installing the Update Manager and the Converter. Go through those steps…and wait…it tells me that the VirtualCenter server is not running? I JUST INSTALLED THE DAMNED THING…on a brand new clean server, no less.

Ok then…I go to the Services menu and try to start it manually….fail. Fail? FAIL?!

Looking through logs (which are in C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\Logs …yea don’t ask why they are there, they just are), I see this:

[2009-04-01 16:20:21.613 'App' 1784 error] ODBC error: (28000) – [Microsoft][SQL Native Client][SQL Server]Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’.
[2009-04-01 16:20:21.613 'App' 1784 error] Failed to intialize VMware VirtualCenter. Shutting down…
[2009-04-01 16:20:21.613 'App' 1784 info] Forcing shutdown of VMware VirtualCenter now

Now wait a minute…why the hell is it trying to login to the SQL server as anonymous when I damned clearly provided a username and password for it, and I’m logged into the VC server as a domain admin, so even if it was passing active credentials, it should work. However, it was not.

So ok…what if I go back to the DSN and specify credentials there. Nope, can’t do that…it’s either NT authentication (which does not let you pass credentials), or SQL authentication (which does). Putting domain credentials into the SQL authentication fields result in a whole bunch of fail.

Ok then, next step: create a local SQL user, and use that instead. So I create a local user called esxlocaldb on the SQL server, make that user the db_owner, and re-run the installer for VC. I give it the credentials of the esxlocaldb user (after changing my DSN to use those SQL credentials, obviously), and it comes back and tells me that the credentials are incorrect. I doublecheck everything, do a test in the DSN config window, and everything is dandy…but the VC installer simply wont work.

So now, the trickery begins. In order to install this F-ing thing, I basically had to have both the esxlocaldb user as db_owner AND the domain\esxdb user as db_owner to the ESX database. For the DSN, I gave it the esxlocaldb credentials using SQL authentication, but for the ESX installer, I gave it the domain account. This seemed to work flawlessly.

I think that the installer is just wacked…it uses the DSN credentials to query the DB, but VirtualCenter actually requires a domain user to have access to it. Really, makes no sense to me, but we basically tried everything else. Every other possible combination of database rights and DSN configurations.

Makes no sense to me, but it works now…if anyone has any comments on what we may have missed, I’m all eyes and ears.

Categories: me = geek, work Tags:

William Shakespeare’s Land of the Dead

March 23rd, 2009 No comments

No, really…I’m not confused; I did just say William Shakespeare’s Land of the Dead.

Official Link

I highly suggest you go see this. It’s hilarious. As much as I’d love to give you a synopsis, it would kind of ruin the fun of seeing it.

However…just imagine this: Shakespeare….and zombies. I mean, really, do you need to know more? GO SEE THIS!

Do: Sit in the first three rows.
Do: Laugh
Do: Wear clothes that you don’t mind getting splattered in stage blood.
Don’t: Be a pansy.
Don’t: Bother to look for parking (it’s pretty much next to impossible, unless you get there early)

Categories: People Tags:

More Links

March 20th, 2009 No comments

No, I have no intention of becoming Fark.com, but some of these things are just too hilarious/absurd/crazy to not post.

Too fat to work, eh….well, fuck you

Bat hangs on for dear life during space shuttle launch…stupid bat

Beer and titties….on the same bottle? Yes please!

Categories: Links Tags:

Linkage of the day

March 17th, 2009 No comments
Categories: Links Tags:

SEPTA Epic Fail

February 25th, 2009 No comments

7:45…7:50…7:55…8:05am. The previous times are scheduled stops for the High Speed Trolley that takes me to work in the morning, and all times that it did not arrive. I looked at my phone; 8:10am. I had been standing on the cold platform for 25 minutes now to no avail. At this point, I’m contemplating just driving in and saving myself the needless hassle of standing there like an idiot waiting for a trolley that may never come.

Of course, the logical mind is thinking that it has to come. There may be a broken down trolley that they have to move off the track, but eventually, in order to not block the trolleys coming from Norristown and to allow people to actually get somewhere, it would come. It finally did, shortly after 8:10. “Don’t worry about the fares, just come on in”, said the driver, both trying to save time and perhaps make up for the lateness, “first stop will be Bryn Mawr, so if you need to get off before then, there is another trolley coming in about a minute or two.” In essence, he was about to skip about 8 stops in an effort to make up time…awesome! Not that it would really help, since it would only save about 5 minutes total, but still, it made for a quicker ride. Quicker indeed, dude put the pedal to the metal, I don’t think I’ve ever traveled as fast in a trolley as this dude made it go. In fact, he overshot the Bryn Mawr platform due to his speed, and I’m pretty sure he almost jumped the track at one point. I want this dude to be my driver everyday.

“Next stop…40th street” was the last thing I heard before the subway stopped….in between 46th street and 40th street. Figures…only my luck would have it that my trolley is fucked, and my subway is fucked. A few minutes later, they announced “the train will be moving shortly”…right. Eventually we get moving, and make it all the way to 34th street, where we stopped again for another 10 minutes. They finally told us that the train in front of us was having mechanical problems, and we’d be moving again shortly.

SEPTA…epic…fail.

And now for some people much worse than me: Most unfortunate names ever, according to the BBC

And…wtf? Zombie…pinup…calendar?

Categories: General Stupidity, Links Tags:

The Awesomeness of IISADMPWD

January 29th, 2009 6 comments

First of all, I bet most of you are wondering what the hell IISADMPWD even is. Well, basically it’s a tool built into Windows 2000+ and IIS that allows password changes over the web. You go to a webpage, type in your username, current password, and new password, and it updates your information using ASP. This works on local workstations, domain accounts, you name it. It’s quite awesome.

I wish I had known about this tool two years ago, when I was asked if there was any way for VPN users to change their domain passwords (which they used to authenticate to the VPN) remotely, without having to be on the domain.

Setting it up is pretty easy, but it’s not really documented very well anywhere. A bunch of websites reference it as a tool to use for this purpose, but most just leave it at that; Microsoft tells you how it works, but not how to get it running initially. Well…here is how to get it running…after the jump:

Read more…

Hey, where’d you get that green shirt?

January 7th, 2009 No comments

“Hey, Hey…where’d you get that green shirt?” yelled a tall, crazed Septa rider as he admired the green Phillies “luck o’the Irish” shirt that I wore to the parade today, “I couldn’t find one of those anywhere.”
I turned to him and grumbled a response, something along the lines of “luck, I guess”.

In reality, it’s simply a mass produced shirt that I bought at the stadium one day, but who am I to diminish the Phillies Spirit in the guy.

I hate Septa. Riders of the lowest common denominator, the left half of the intelligence bell curve occupied the El I had ridden just a few minutes earlier, and it seemed that the 100 trolley would not be any better.

The Phillies parade was today, so people were traveling on Septa en masse, similarly to how the Japanese ride their subways at rush hour. For the first time ever, there was not even a place to breathe, no matter if you were sitting or standing. Surprisingly, the ride into work was quite normal, eerily normal actually, I guess it was a bit too early in the morning for even the most die hard of fans. The parade was not starting for another five hours, leaving plenty of time for the crowds to gather in every orifice of the city.

img_0037
We left for an early lunch to catch the parade. In reality, we simply skipped the lunch part and made our way along Walnut Street to where it intersected with Broad Street: The parade route. “Hi, remember that today is a regular work day, and no concessions of time off will be made to those wanting to attend the parade”, said an email earlier in the day. Pfft….yea, ok, get right on that chief. We managed to get a pretty decent spot to stand, only about ten feet or so from Broad, about six or seven lines of people back; not bad for having left an hour before the parade was to start.

Philly PhanaticComing from work, we were dressed business casual; no Phillies attire whatsoever, and Hasan had his Halloween costume with him….or…on him: The Wendy’s girl wig. We were heathens, getting perplexed looks. No Phillies gear at the parade…we must be mad! Are we not citizens of Philadelphia, are we not patriotic to the Phillies? At some points, I thought we were going to be clubbed like a baby seal.

The ride home was oh so very different from the ride in. That mass of people was also traveling back, much to my discontent. The 100 trolley was packed nuts to butts, with the crazy guy among us. He was loud…everyone was loud, some cheering the Phillies, others telling this particular rider to shut the fuck up.

Finally…Gulph Mills; head pounding, deaf in the ears, glad to be off.

As I threw out my October Transpass, and searched for my mustang keys…
“I would rather have stayed at work”.

Categories: Personal Tags:

Interesting links for the day

January 5th, 2009 No comments

We have the Patriot Act….but that’s NOTHING compared to this: YRO@Slashdot

The UK is being the Nanny state hardcore.

Your next link brought to you by Police Brutality/Stupidity: KTVU News Story

Categories: Links Tags:

My favorites and bookmarks

January 2nd, 2009 No comments

I’m not sure how many of you have heard of del.icio.us, but it’s fantastic.

I have been using it to collect all my bookmarks for a while now, and have replaced Firefox’s Bookmarks with it completely using the del.icio.us plug in toolbar.

Anyway, here is a link to my del.icio.us so you can get a better grasp of the crazy sites I visit and how I categorize them. My Del.ico.us

I have also added a link in the sidebar to it.

Categories: Links Tags:

Microsoft Scripting Stupidity

December 31st, 2008 No comments

The other day, I was tasked with writing a small maintenance script for work. The purpose of the script was to read a list of servers from a text file, go out to each of them, and perform certain operations on folders.

In order to do that, WMI had to be utilized, since that is the only way to perform actions on remote machines from a local workstation (or in this case, a task manager server).

In WMI, just like in most programming languages and frameworks, there are certain special characters that need to be escaped. For example, a simple quote character such as “, needs to be escaped because the compiler will interpret it as something else, such as the beginning or end of a text string. So, in PHP, for example, to assign this is my string to a variable, I would do:

$variable = "this is my string";

Notice how the string is enclosed in quotes. However, if I wanted to say something like And he said, “blah blah”, and then left, I would have to do it like this:

$variable2 = "And he said, \"blah blah\", and then left"; (Yes, in PHP, I could use single quotes to get around that limitation, but that’s not the point)

As you can see…the string had quotes in it, and they had to be preceded by a backslash so that they would not be interpreted as the end of the string. If I did not use them, and instead did:

$variable3 = "And he said, "blah blah", and then left";

the code would error out, because the first quote before blah would mean that I am done assigning my string to $variable3.

Ok…now that all the boring stuff is out of the way, back to VBScript and WMI. Let’s say that I wanted to delete a folder remotely and needed to write a script to do that, and let’s say that folder was C:\Documents and Settings\Luke, because for some reason, I wanted to break my remote machine by deleting my local profile. In WMI, and in almost everything else, a backslash “\”, is a special character, and must be escaped. In this case, any operation I would perform would need my ProfilePath variable to be C:\\Documents and Settings\\Luke.

So my code so far is:


Dim ProfilePath, server
ProfilePath = "C:\\Documents and Settings\\Luke"
server = myRemoteMachine.myDomain
Set serverWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & server & "\root\cimv2")
Set folder = serverWMIService.ExecQuery ("Select * From Win32_Directory Where Name = '" & ProfilePath & "'")

So far, I’ve basically asked WMI to go and grab me that folder, and it did, because I had the path properly escaped.

To delete stuff using WMI in the modern flavors of Windows, you can’t just say

folder.Delete

, as you could in Windows 2000, NT and the like. No…instead you have to get a big array, and enumerate every single file and folder inside every single folder. Basically, you have to prepare an entire directory tree, and work from the inside out.

This requires me to query WMI for the subfolders of that folder and the subfolders of that folder and so on.
We can do this pretty easily with another query like this: (note, I already have the objWMIService prepared and all that elsewhere in the script


Set colSubfolders = objWMIService.ExecQuery _
("Associators of {Win32_Directory.Name='" & ProfilePath & "'} " _
& "Where AssocClass = Win32_Subdirectory " _
& "ResultRole = PartComponent")

I ran that code (with all the other stuff I needed it to do), and it failed. Trying to find what failed took a few minutes since VBScript error reporting isn’t exactly perfect. End result was…it was failing on that query to get the subfolders. Through trial and error, I found that if I stripped the extra backslashes from ProfilePath…ie make it C:\Documents and Settings\Luke instead of C:\\Documents and Settings\\Luke, it would work.

Now wait a minute, wasn’t WMI just bitching at me at the beginning of my script that I had to escape the backslash because it was a special character?

All things considered, I have no idea why it chooses to work one way for some queries, and completely differently for others.

End result is: profilePath = Replace(profilePath,"\\","\") …and suck you very much VB

Categories: Programming, work Tags: