Things I didn’t know about ESXi

I’m setting up a development server using vmware ESXi virtual server running CentOS 5.5 x64 and FreeBSD 8.0 x64. Currently, the second installation pass is in progress. Being fresh to ESX/ESXi there were couple of things I didn’t realize:

First (the reason for the reinstall), if there is plenty of hard drive space available, it’s good idea not to deplete it all for the sytem installations. I split a 1.3Tb RAID 5 array between the two operating systems until I realized that 1) you can’t shrink vmfs partitions and 2) by consuming all hard drive space one limits the flexibility of the system down the line. Let’s say you want to install a newer version of an operating system and decide to do a fresh install. You need space for it while you want to keep the old version around at least long enough to migrate settings and data over.

Second, while I was aware of that ESXi doesn’t offer console access beyond the “yellow and grey” terminal, I didn’t realize you have no access to the VM consoles, either. So, with CentOS or FreeBSD installed, the only way to access their consoles is via the vSphere client (someone correct me if I’m wrong — I wish I were as I’d like to have local console access to the guest OS’es).

Finally, VMware Go “doesn’t currently support ESXi servers with multiple datastores”. So if you have, say, a 3ware/LSI/AMCC RAID controller which isn’t currently supported under ESXi as a boot device but which you likely still want to use as a datastore, you’ll end up with at least two datastores. So vSphere is really the only way to go for VM management also for this reason (since LSI provides a vmware-specific driver, one may also be able to direct-connect the LSI RAID array to the VM without it being an ESXi datastore, but that’s not the configuration I’m looking for—the boot device is small and houses just ESXi while the VMs and their associated datastores are located on the array).

In the end everything’s working quite well. I like the flexibility virtualization offers.. and consolidation is useful even in a small environment (one dev machine is less than two or three dev machines :) ).

LaserJet P2015dn duplexing on Windows 7

HP LaserJet P2015 models use “Universal” driver under Windows 7. When first installed, duplexing doesn’t work by default. This is a surprise for many who come from Windows XP environment where the dedicated drivers had P2015′s built-in duplexing availability turned on, of course, by default. In Windows 7, however, the duplexing selector for P2015 says by default: “Print on both sides (manually)”.

To enable P2012′s automatic duplexing on Windows 7 go to Devices and Printers, highlight the P2015, right click, and select Printer Properties from the context popup menu. Go to Device Settings tab and look for “Duplex Unit (for 2-Sided Printing)” option. It’s set to “Not Installed” by default. Change it to “Installed” and click on “OK”. Now when you go to Preferences when getting ready to print, the automatic (not “manually”) option is available on the Finishing tab, and automatic duplexing works.

Also if you use the excellent priPrinter utility, P2015 honors the “Double Sided” toggle on the Page Layout tab. Same goes for the “Double-sided” checkbox on FinePrint utility, and other applications that provide the option to turn automatic duplexing on or off.

Adding graphics, comments to PDFs

I needed to fill out a PDF document today, date it, and sign it. It took me a good hour to accomplish the task as while the latest incarnation of Acrobat has custom stamp feature, annotated text doesn’t print by default (I also wanted to avoid having to print out the document only to scan it back in). In fact, I found no way to print text annotations. Whether “Documents and Stamps” was selected in the Print properties or not, the text annotations would remain missing from the printout. It should not be this difficult to add a text box to a PDF document and then flatten it to be part of the document, and not an annotation per se.

After some more Googling later I happened on this page that outlines a simple way to add “flatten” options to the Acrobat document menu. The associated script to be placed in “Program Files/Adobe/Acrobat 9.0/Acrobat/Javascripts/” folder (the script works with older Acrobat versions, too, as the mentioned instructions are for Acrobat 7.0) is just two lines long:

app.addMenuItem({ cName: "Flatten page", cParent: "Document", cExec: "flattenPages(this.pageNum)",cEnable: 1, nPos: 16});
app.addMenuItem({ cName: "Flatten document", cParent: "Document", cExec: "flattenPages()",cEnable: 1, nPos: 17});

With the above script installed, the task was a snap: I added my signature from a transparent PNG as a custom stamp, added the text annotations, and then flattened the document. Done! Now the annotations print out as they should (whether or not “Documents and Stamps” is selected in the Print properties as now the annotations are part of the ‘base’ document). I can’t imagine why Adobe doesn’t include “flatten” as a default feature!

Ternary beauty

I love the ternary operator. It can often simplify a much more complex conditional into few characters. In PHP (and other c-like languages) it’s possible to do all sorts of things with the ternary. The following are examples from PHP.

If $b is true, print “true”, otherwise print “false”. Echo doesn’t work here.

$b ? print "true" : print "false";

Here’s something I learned today: it’s possible to assign a complex variable to an “internal” shorthand, and then in turn use the shorthand for the final assignment (based on the comparison). This way it’s not necessary to repeat the complex variable in the assignment section which makes the ternary much shorter and thus cleaner.

So instead of this:

$a = ($myObject->anotherObject->arr['somekey'] > 7 ? 7 : $myObject->anotherObject->arr['somekey']);

You can do this:

$a = (($b = $myObject->arr['somekey']) > 7 ? 7 : $b);

Awesome!! :)

How To Destroy Brand Confidence In One Hit

Couple of a weeks ago the power supply of one of our PCs failed. The system is about one and half years old, so fine – sometimes things break. I replaced the power supply and the system was back up and running. The failed OCZ power supply was under warranty, and so I sent it in for replacement. The usual way: I pay the shipping in, they pay the shipping back.

The replacement – a reconditioned unit – arrived yesterday. First thing I noticed that the “WARRANTY VOID IF BROKEN OR REMOVED” sticker was, well, broken. Hm. So today I went ahead and installed it back into the original system, taking out the temporary PSU. I really hate replacing power supplies when the case is even slightly congested and this one was pretty tough to get to. Finally, the replacement PSU was in place and I hit the power button. Nothing!

Few moments of testing later I had determined that the unit OCZ sent as a replacement was DOA. I had to rip it out and put the temp PSU back in. Note to self: from now on the PSU replacement protocol will include stand-alone testing the new unit before I touch the target system.

I very much doubt the unit broke in transit; I’m guessing they either didn’t test it after repairs were completed, or for some reason the unit was never serviced and so I got someone else’s failed PSU in exchange to PSU I sent in for warranty service. The only way OCZ can salvage the situation at this point and avoid getting on my bad list is if they offer to pay shipping both ways. It’s not that much money, but the time wasted on this far exceeded what the replacement is worth.

Many companies forget that the value of warranty they offer not only comes from what they can advertise but also from the PR – positive or negative – depending how they handle warranty.

UPDATE 21 January 2010: Five Star Damage Control

OCZ handled the situation about the only way they could’ve handled it to minimize the negative impression that had already been created: they offered a free upgrade to a new product, or a pre-paid shipping label to return the DOA unit to service/exchange (apparently in case I had to keep the same model, such as a component for a tightly specified system). I chose the upgrade. Let’s hope the new unit works! ;)

UPDATE 22 January 2010: Not so fast, my friend

More to come. Dealing with OCZ tech support turned out to be less than what the first impression promised.