Notes on upgrading VMWare ESXi 4.x to 5.x




ESX is no longer being developed from what I read on VMWare’s site, who cares right?  I was using ESXi so I got lucky ;-).  Anyway, if you don’t have any fancy plugins or their Data Management Suite to mange BILLIONS of servers, VMotion from here to the nearest quasar and only dropping one ping or a total HA server cluster that won’t go down if you shot it with an elephant gun THEN all you need to do is:

1 – Download the new version of ESXi

2 – Pop the disk in, reboot your server (make sure your VM’s are shut off)

3 – Follow the prompts, it pretty much detects your disks and file system.  Do an “upgrade” and leave your files alone, I think it said something about keeping your file system (VMFS) in tact.

4 – Next > then sweat a little bit, bit your nails and eventually you’ll see a “success” message.  Then pop the disk out and reboot again.

* I sweated over this too!

One gotcha for me was when it came up my thinly provisioned disks were now “thick” thus I ran out of real estate since in a way I “over promised” disk sizes in my VM’s knowing I probably wouldn’t really need 80 gig for a Linux machine.  BE CAREFUL not to make the same mistake.  IF you find your disks are thick and you want to put things back and make all right with the world you can convert the thick one’s into thin by this command below…thanks BTW to TooMeeK who had the correct command syntax for me.  I was a bit stumped until he/she showed me the way!

1 – You need to go into the config options on your VMWare server and enable SSH.

2 – SSH into the server, I assume you know how to do this since it’s Linux and if now well go look online and come back when you’re in :P

3 – Migrate to your VM storage area.  This might take some poking around.  The server I was working on was in:

/vmfs/volumes/4c5d465f-c17a75db-572b-001c23c9ca24/MyVMHere/

…so, if you cd /, then cd vmfs/volumes, then do an “ls -la” or just “ls” you might see a few folders with LONG numbers.  One of these (ore more really, I only had one) are where your VM’s are stored!

4 – Now,  you need to “cd” to your VM folder for your VM’s that you want to shrink / convert from thick to thin.

5 – Run this command and wait – note that it DOES in fact take a hit on your server performance, I think it’s doing some serious disk i/o:  vmkfstools -i old_vms_name.vmdk -d thin new_vms_name.vmdk

6 – This is where I got a but stumped on number 5 – I kept looking at the actual VMDK file for the guest OS, really what I wanted was the name of the tiny VMDK file that DEFINES what the bigger thick VMDK is!  That’s what tells vmkfstools what the heck it is and HOW to convert it :-)

Special thanks to this site and TooMeeK for the help on this:  Tutorial and TooMeeK’s comment was the fix!

7 – Then – when done, go into your VCenter, delete the current OS disk (it’s ok you’re not really “deleting” it :P) and then add a new disk, go find your VM’s folder on the store and inside that folder there’s your newly converted THIN disk!  Add it, button it up with however many next’s and OK’s you have.  Then go start your VM.  Magic!

I was very cautious about everything and I even backed up my VM’s with the “gzip” command.  “gzip yourvm.vmdk”.  It can take a LONG time depending on your disk config.  For me, I had an 80 gig VM shrink down to just a few gig zipped, then you can “download” it from the VCenter app you use to manage your server.  This is a technique to manually back up your raw images.  It’s tedious to say the least but at least you know you have a solid backup before you try and take VMWare server from 4.0 to 5.0 or 5.1.  Sometimes caution and tediousness pay off!