Resizing VMWare Server Virtual Disk

Today I needed to resize a VMWare Virtual Disk (vmdk) for a Windows Server 2003 image running on a Red Hat Enterprise Linux 5 host using LVM to manage the physical, local disk space.  In my case, my logical volume was too small to accommodate the vmdk expansion and so I had to grow my logical volume before I could begin the VMWare portion of the work.

I must preface all of this, of course, by stating that you must make a complete backup of your virtual machine before doing something as invasive as this.  While this process is reasonably safe there is always the potential for disaster.  Take precautions.

The lvextend command is used to increase the size of the logical volume.  You can view your current logical volumes with lvdisplay.  I use the -L+ syntax as a safety measure to be sure that my drive is getting larger and not shrinking accidentally due to a typo.  In this example I am expanding the /dev/VolGroup00/lvxen logical volume by an additional 80GB.

lvextend -L+80G /dev/VolGroup00/lvvmware

This first step can be completed while the virtual machine is still running.  It will happily extend your available space in the background.  Our next step, however, requires that you power down your virtual machine before continuing.

Now that we have created space on our logical volume we need to expand the Linux local filesystem before we can expand the virtual filesystem running on top of it.  Assuming that we are using the current standard Ext3 this is very simple:

umount /dev/VolGroup00/lvvmware

e2fsck -f /dev/VolGroup00/lvvmware

resize2fs /dev/VolGroup00/lvvmware

mount /vmware/

Obviously for my purposes I use a /vmware directory structure for holding all of my disk images.  You will need to adjust as needed for your own setup.  /var/vmware is another common option.

Now we just enlarge the virtual disk itself.  We will do this through the vmware-vdiskmanager command.  You will need to execute this command on your vmdk and not your flat-vmdk even though this seems counter-intuitive when looking at your directory structure.

vmware-vdiskmanager -x 22GB ph-w2k3-ad.vmdk

This concludes the easy part.  Now you have plenty of logical disk space available for Windows but in order to expand the System drive of Windows you will need to use a third party tool.  Windows Server 2003 is unable to make partition changes that affect the running system.

If you are like me, you will want to fire up your virtual machine just to make sure that everything is okay after the disk change, but you will need to turn it off again before we make changes to the partition table.

There are many tools that can be used for this task but I decided to use GParted, which is available as a live CD which you can download for free.  For the version that I used, I just cd’d into /tmp and used this command to get my copy of GParted’s bootable CD ISO file.

wget http://downloads.sourceforge.net/gparted/gparted-live-0.3.9-4.iso?modtime=1222872844&big_mirror=0

Using your VMWare Server Console (or through the command line) you will need to set your Windows Server image to boot from the GParted ISO which you just downloaded.  Then go ahead and “start this virtual machine.”

You will likely need to hit “Esc” as soon as the virtual machine starts so that you can select to boot from CD.  I keep my Virtual BIOS set to boot directly to the hard drive under normal circumstances because it is faster and I don’t want to accidentally boot to some CD media unless I really, really mean it.

Once GParted starts you will be given a boot menu.  The default option works fine in more cases and worked fine for me.  You will need to select your keyboard layout and then you will be taken to GParted’s graphical partition manager screen.

Once in the GParted Partition Manager you should see the current partition that you had before we started, in my case called /dev/sda1 and marked as being an NTFS file system.  Mine also shows the “unallocated” partition space into which I will be expanding my /dev/sda1 partition.

Start by selection the partition which you are seeking to resize (sda1 for me) and then select “Resize/Move”.  This will open the Resize/Move window.  Do not alter the first numer – “Free Space Preceding”, this is for “moving” your partition.  You only want to alter the second number – “New Size.”  If you are doing like me and have created some empty space specifically for this purpose then you will simply set this number to the “Maximum Size” as displayed in the window.  Then select “Resize/Move” to continue.

Once you have completed that step you can visually confirm that the disk now looks the way that you want it to look.  If you look at the bottom of the window you will see that there is “1 operation pending.”  If everything looks alright go ahead and click “Apply” to commit your changes and to resize your partition.

Once the resizing completes you are safe to reboot your virtual machine into Windows again.  Double click the “Exit” button on the GParted desktop.  Reboot should already be selected so just choose OK to continue.

When Windows starts it will detect the drive configuration change and force a disk consistency check.  Allow it to run through this process and when it completes the system will restart automatically.  Once Windows restarts you should see that your drive has been resized.

November 19, 2008: New Basement Furniture

2 Days to Baby Day! (39 Weeks and Five Days Pregnant)

One Laptop Per Child XO Linux laptop is available again, this year from Amazon.  The program is just like it was last your.  For $199 you can donate an XO to a child somewhere in the developing world or, for $399, you can donate one and get one for yourself.  Makes a great gift for the techie in your life (this thing is just plain cool) or for a child.  If you are a technology collector like me this is a must have for your collection, and the first $199 is tax deductable and buying a laptop for a child is just plain awesome.

I forgot to set my alarm last night but fortunately woke up on my own before five thirty this morning.  That could have been very bad.  I got up, did some reading, deployed some packages for the office, got ready and Dominica drove me down to the train station.  We ended up being just a minute or two behind the train and ended up missing the 6:42.  It was really cold out this morning so Dominica waited at the train station with me and we sat in the car until I caught the 7:08 train instead.  That was crappy.

Katie turned me on to having my Twitter feed go directly into FaceBook so that my FaceBook Status is updated automatically by my tweets on Twitter.  Now I only have to update Twitter and the FaceBook users will see me automatically.  That is great since I have that handy Twitter command line client and, as of today, my office has opened up the firewall to let us access Twitter but not FaceBook.  Now I am only updating one microblogging location instead of two.  Much better.

Danielle got hooked up with Twitter today as well.

Dan and I went swimming over lunch today.  Katie was not able to go.  I did 1,500 yards today.  Not a major workout but it was a good hour of cardio which is what I need the most.

Our new basement theatre seating arrived today from Bob’s Discount Furniture.  The new chest that is going to our bedroom is back ordered and is expected to arrive on Friday.  Dad loves the new seating in the basement and is thinking about possibly sleeping down there tonight rather than in the living room.

Today was a brutal day for the stock markets.  The Dow Jones Industrial Average fell below the 8,000 mark as the US considers the very real possibility that it is going to let the big three American automakers just fail without any hope of a bailout.  Overall, Americans seem very favourable to watching the automakers fail.  No one wants their taxes to go up to pay for bloated, paperwork heavy, inefficient American manufacturing to be saved when they have had decades to figure out how to operate like lean, competitive companies.  Citi shares closed today at just $6.25.  This is a crazy market.

Consumer pricing was released today and we have had the biggest one month downturn in consumer prices since 1947.  So while the market is doing poorly and no one is making any money (whatever that means) the price of things is going down, way down.  Normal goods are getting cheaper and fuel is practically free compared to where it was just six months ago.

I was stuck in the office until after six thirty.  I made the 7:18 train out of Grand Central so Dominica was able to pick me up at 8:13.  I’ve been reading “Spellfire” by Ed Greenwood while on the train.  I’ve been reading this book for months (read: started it months ago and haven’t gotten back to it.)  So I am trying to finish it now.  Ramona will be very pleased that I am reading a fiction book for a change.  Although it really isn’t a very good one.

For dinner Dominica made Quorn fake-chicken with gruyere and goat cheese, mixed vegetables and cornbread stuffing.  It was delicious.

After dinner I went down to the basement to work on some projects.  There is always so much to be done.  I have no spare time now that I am commuting so much.  I feel like I get home just barely in time to get to bed.  My readers will notice that I have all but stopped watching any shows at all.  I am not getting a lot of sleep either.  I am looking forward to the more relaxed schedule of having a baby!  😉

Oreo has really been missing me.  He comes down to the basement to lay beside me or sits with me in the chair in the living room.  It has been a long time since he has been so snuggly.

I worked until well after eleven.  I spent the entire night trying to get connectivity to a VMWare Server.  VMWare has made even their simplest packages so hard to find on their website and so large and cumbersome to download that it took all evening to get anything at all working.  In the end I had to abandon even the simplest project for the evening as there was enough time to get one working install of the VMWare Client before it was well past time to go to bed.  I am going to be very tired tomorrow.

I may have to stay home simply because I am getting too tired with everything that is going on and all of the commuting.  At the current rate, Dominica is not going to be going into labor anytime soon and having me get worn out is not a good way to be prepared for things.

November 18, 2008: Big Swimming Day

3 Days to Baby Day! (39 Weeks and Four Days Pregnant)

On the ride home on the train last night I finished reading “Day of the Barbarians”.  This train riding is really giving me a chance to read a lot more than I was reading before.  That is my third book since Friday morning!

We grabbed dinner at Burger King on the way home from the train station.  There was still no power when dad and Dominica left to come to get me so there was no chance of cooking at home.  Once we got back, a little after eight, the lights were back on.  That was very good as Oreo is just about out of food and we needed to cook for him tonight.

Dominica taught me how to make Oreo’s special chicken stew (mostly chicken, sweet potatoes, celery, rosemary, garlic, carrots, peas, zucchini, barley, oatmeal and kelp.  The chicken is high grade skinless, boneless, of course.)  That took about half an hour.  I will be making his stew soon since Dominica will be busy with the baby.

My evening was very short.  I read a few chapters in “Agile Web Development with Rails” and then headed off to bed at twenty after ten.  Not much of an evening.

I woke up, on my own, at five thirty this morning.  Not too bad.  Twelve minutes ahead of the alarm.  That put me in good shape to grab the earlier train which I have been trying to grab for a week now.  I even managed to log into the office, get caught up with my mail and make sure that no one needed me before heading out.  Five thirty is, apparently, a good time to get up if I can do it.  Considering that I often don’t get home until between eight thirty and ten thirty it means that there is no way for me to even approach eight hours of sleep let alone get sleep and eat and do anything else whatsoever.

I managed to make the 6:42 train, which is harder to catch because the road closers earlier as there is an Amtrak train that comes through just before the Metro North line, and was at my desk in the office at a quarter after eight.  On the walk down Wall Street there was snow.  This is the first falling snow that I have seen this season.

Dad and Dominica made a run out to get wall-anchor parts today so that the basement bookshelves can be anchored to the wall so that we can begin to put books on them.  The books have to be up off of the floor tonight so that tomorrow, just after lunch, the new furniture can be delivered.  We have the new dresser for our bedroom coming as well as the multiplex theatre seating for the basement set to be delivered.

I forgot to mention that yesterday a new washer was delivered to our house.  We didn’t order it, of course, so it was a bit of a surprise.  Luckily Dad and Dominica were both home and were able to explain that it definitely was not supposed to be for us.  It turned out that it was for the people who owned the house before us.  We are guessing that they ordered it for their new house but somehow gave them our address.

This morning was pretty slow at the office.  It would figure that on a day when I managed to get in nice and early that no one was waiting for me at all.

Talked to Josh around lunch today, he said that he had six inches of snow this morning.  Ick.

No Dan today so I had to go to the gym by myself.  I managed to do 1,450 yard before Katie arrived and did 2,250 total by the end of my workout.  That was a really good workout for me.  Then we went to Flavors to get soup and salad.  Very healthy day for Scott.

The afternoon was not all that busy either.  I decided to not stay late today and managed to catch the 6:15 train out of Grand Central Terminal.  On the ride home I finished reading “The Business Analyst as Strategist” which I had started this morning.  Boy am I ever reading quickly.  When I was thinking about the impact of commuting by train like this it never occurred to me just how little time I normally actually had allotted to reading regular paper books and how much additional time I would now have.  I’ve read four books in the last five days!  Tomorrow I am taking along a fiction book which I have been reading slowly for some time.  I should be able to polish it off in no time.

Dominica made meatball subs tonight.  Boy are they good.  I am so glad that she figured out this new recipe.  It is delicious and not too complicated for her to make.  I figured out to get some BBQ potato chips to crush up and put into the sandwich.  It tastes just like a sandwich from Hot Truck in Ithaca.  I added a little mayo although we have no hot sauce in the house right now.  Pretty much, though, it tastes just like an MBC with Kate sauce from Hot Truck.  Awesome.  One of the few pre-vegetarian foods that I really missed and this tastes just as good as the original.  Can you believe that I haven’t eaten at hot truck in over seven years?

The evening was very short.  I helped dad a tiny bit as he worked on setting up the bookshelves in the basement.  He managed to repair our glass-doored bookshelf that had become unsettled during shipping from Newark and has all three of our basement shelving units in place and ready to be bolted to the wall tomorrow for safety.  The black, Ikea shelves look awesome in the basement and we are thinking that we will get three more exactly the same (two large shelving units and one, small corner unit that is half the width) to put behind Dominica’s desk so that they match.  We will probably expand the bookshelves by one more unit behind my desk as there are so many books to put on there that we have no idea where they will all go.  There is the low, teak bookshelf that will go upstairs as well for cookbooks.  That is the bookshelf on which Mr. Humphries, our little hamster, lived on several years ago in Geneseo.

My main job tonight was to move all of the stacks of books that were in the basement from the big, open area to the limited space behind the desks.  The books were in the way of where the furniture will be going tomorrow afternoon.  That will be exciting to come home to tomorrow night.

I managed to head to bed at eleven.  Not as early as I would like but if I go to bed much earlier I might as well not even bother to come home.  My evenings are extremely short.  I will be on Wall Street tomorrow.

November 17, 2008: First Loss of Power in Peekskill

4 Days to Baby Day! (39 Weeks and Three Days Pregnant)

Good Washington Post article about Martin Waldseemueller, the cartographer who named America and produced the first known map detailing the American Pacific coast – long before Europeans supposedly knew anything of the west coast.

Alarm went off at 5:48 this morning.  I am trying to move it up farther and farther so that I can start to make the earlier trains.  Today we just missed our window to make it for the 6:42 so I grabbed the 7:08 instead.

My morning was exceptionally busy.  Mostly this was because of a large network issue so I was on conference calls most of the morning.  Also, the office is abuzz after the announcement of, according to the BBC, 75,000 layoffs!  That is a lot of people.  Like eliminating three entire Eastman Kodaks.  That is definitely going to have an impact on things.  That is one in every five people in the entire company.

Our house in Peekskill had its first power-outage this morning.  No obvious reason either.  The power just went out.  We have been warned that this is a major problem in the Peekskill area.  Even with a power plant right in town, Indian Point, our power, we are told, just goes off regularly.

I was reading today about the plans of NASA to decommission the space shuttle fleet in 2010 after 29 years of service.  America is planning to be without any operable space vehicles from 2010 until 2014 when we are scheduled to launch to Orion class space capsules which harken back to the Apollo missions.  The Orion capsules will go through a similar as did the Apollo missions.  However, the first Apollo manned flight was in 1968 and Americans were on the lunar surface by 1969.  The Orion program is not targeting putting a man on the moon until 2019.  That’s five times the development window that we had fifty years ago.  I get the feeling that NASA is losing ground rather rapidly.  We appear to have significantly less capability today than we did long before I was born.  It is hard to believe that private spaceflight companies won’t have people on the moon before 2019.  At the rate of private development NASA will be completely inconsequential long before they are ready for another moon shot.

I grabbed a quick salad up at Flavors for lunch today.  Then, around two, Dan and I headed down to the gym to do some swimming.  It was much later than I had been hoping to have been able to have swum but it was a really slow afternoon so it seemed like it would be alright.  We did a short day today.  I kept track of my distance for a change.  I swam 1,150 yards.

I found out today that Eli Phillips (from my Pavilion Baptist School days) has just moved to Scotch Plains very near my Warren office.  In fact, it is almost exactly halfway between downtown Newark and my office in Warren.  It is almost a suburb of Newark to the south west.

The power went out again this afternoon in Peekskill.  I called, again, and discovered that the phone was not ringing.  This is a real problem if we don’t keep all of our phones charged.  Westchester’s horrible reception means that our phone batteries drain very quickly, but we have to be able to maintain contact for when Dominica goes into labor.  It’s been a very long time since we lived someplace that didn’t have reliable power.  We haven’t even considered the disaster that will occur if I don’t have my CPAP!  What will I do?  There is no way for me to sleep without it.  If they don’t get the power back on I have to go stay in a hotel.  If it goes out in the middle of the night I guess that I just get up and go to work.  No worries about me not waking up, if the power goes on to the CPAP it is like someone is choaking me.  It wakes you up pretty abruptly.

I tried to leave the office to make the 5:52 train but discovered that my office BlackBerry was completely dead and that I couldn’t leave the office that early without at least having some sort of remote email access. So I waiting for the 6:15 but got stuck waiting for a deployment and had to wait for the 6:43 train which should get me to Peekskill at 7:39 which is not all that bad.

I opened a ticket with Con Edison (and corrected my phone number with them as they had the wrong one listed) and they said that the issue was known and that they were expecting to have the power back on around eight this evening.  Just in case, however, I am going to go ahead and post SGL from the office this evening before I leave.  There is every chance that there will be no time for me to do anything on a computer this evening.  At least, in theory, this will give me a little bit of a chance to do some reading.  It will likely require another fire in the fireplace.

November 16, 2008: Our First Fireplace

5 Days to Baby Day! (39 Weeks and Two Days Pregnant)

Dominica and I really slept in the morning.  Only five days to go until the baby is due so all the sleep that we can get now the better.  Dad was already awake and reading when I finally came downstairs.

I finished reading “Programming Ruby” this morning.  I am hoping that my next main book to be reading will arrive from Amazon tomorrow while I am at work.

We had breakfast at the house this morning.  We have some bolo levedo, Portuguese muffins, that we picked up at Stop and Shop last night.

This morning Dominica noticed that we have water leaking from somewhere on the second floor onto the first floor.  The water stain was first found during the house inspection but at the time they felt that the stain was old and not a current leak.  It appears to not be so.

We were sitting in the living room and Dominica looked up and noticed that the stain looked darker than usual.  I climbed up on a step-stool and felt it and it was definitely damp.  This is our first major issue with the house.  Now we have a serious plumbing problem to identify and fix.  We have no idea from whence the leak is coming.  There are two bathrooms upstairs, both of which are in use.  We are only using the one shower, though, so at the very least we are able to rule out the master shower, but that is about it.

Dad did some checking and there is no way that we are going to be able to do anything without taking out one of the bathroom walls.  There is also a slight possibility that the water is coming from the roof and that there is a leak somewhere in the attic.  We had the heaviest rain today of any day that we have been in Peekskill and its slightly possible, but very unlikely, that that is the source of the water.

We took an early afternoon trip out to Home Depot.  We needed to get some basic supplies.  Pretty much there is going to be a run to Home Depot every day until the baby arrives.  There is a ton of stuff to be done around the house.  No end to the potential work.  The big items in this trip were a new lighting fixture to replace the broken one in the upstairs hallway.  The previous occupants left some of the lightbulb sockets empty so that we would think that the fixture was just missing bulbs when, in fact, the fixture was broken and those sockets didn’t work.  So we took the opportunity to get a new fixture and to switch to florescent lighting.  We also got a matching lighting kit for the master bedroom that attached to the fan as our room is very dark almost all of the time.

After shopping we got a really early dinner (we had skipped lunch) at the Mohegan Diner.  We are always on the hunt for new places to eat.

I did a bit of work in the basement today.  Dominica came down for a while to hang out with me.

Tonight we lit the fireplace and had our first ever fire in our new home.  This is our first time owning a fireplace.  Dominica has never had one, except for the gas fireplace in our living room at Observatory in Ithaca which is not the same, but I grew up in a home with a fireplace and my parents’ second home has two.  So I am used to having them, but it is very exciting for her.

The LCD screen is mounted just above the fireplace so it is perfect for watching when there is a fire.  We rearranged the living room furniture to make the room feel more like a living room and to make the seating do a better job of facing the LCD.  We put on Underdog which we have in our Netflix queue.  It really is amazing how good the Netflix streaming movies look on the PS3.  It seems to me that they are pretty much at DVD quality!

It was nearly midnight when we finally got off to bed.  I have to be up early tomorrow to get down to Wall Street.