Technical


I noticed that I must always suspend or shutdown my VMs before I suspend the laptop. If not, vmware causes heavy swapping when I resume from suspend.  I can normally take care of this when I intentionally suspend my laptop.  The problem is with my ACPI configurations.   My preferences on battery power is to suspend after 30minutes of inactivity or when the lid is closed.  Sometimes, when an accidental closing or power failure or pulling out the cable while the lid is closed causes the laptop to suspend automatically.

I was looking for an option to avoid this.  Then, I came across the sleep.d scripts.  You can place a script in

/usr/lib/pm-utils/sleep.d 

directory.  This has the format of pam scripts and will be executed based on the prefixed number on the filename.  I have the following file in my sleep.d to suspend my running VM before the laptop is suspended.

/usr/lib/pm-utils/sleep.d/11pm-suspend-vm
#!/bin/bash

. /usr/lib/pm-utils/functions

suspend_vm()
{
vm=`vmrun list | grep winxp`
if [ -n "$vm" ]; then
logger "pm-suspend-vm: suspending the running $vm"
vmrun suspend "$vm"
stopservice vmware
else
logger "pm-suspend-vm: no running vms found"
fi
return 0
}

resume_vm()
{
return 0
}

case "$1" in
hibernate|suspend)
suspend_vm
;;

thaw|resume)
resume_vm
;;
*)
;;
esac

exit $?

I must start with openSUSE 11.1.  openSUSE 11.0 started with some hickups on my laptop, but finally, I got it configured completely. I was enjoying this distro and was eagerly waiting for 11.1.  However, I must say that I’m kind of disappointed with 11.1

My first disappointment started with desktop itself.  I have been upgrading my desktop from openSUSE 10.2 days.  So, I decided to go for a re-install instead of upgrade.  The first blow was in terms of inability to restore my MBR using grub.  I have a dual boot system and I knew that I will not be able to boot into Windows  XP if I format my ‘/’ volume without restoring MBR.

I tried all possible windows CDs and they all _consistently_ failed to restore MBR.  Further googling helped me to locate mbrfix.  mbrfix is a nice little windows executable that helps you repair some of the low level issues (if you know what you are doing)

I decided to create a small partition for /boot because of this bad experience.  Obvious choice was to split / partition and create a 100MB volume for /boot.  My partition table looked something like this now.

fdisk -l

Disk /dev/sda: 100.0 GB, 100030242816 bytes
240 heads, 63 sectors/track, 12921 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x00000021

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        2174    16435408+   7  HPFS/NTFS
/dev/sda2           12193       12921     5511240   12  Compaq diagnostics
/dev/sda3            2175        2452     2101680   82  Linux swap / Solaris
/dev/sda4   *        2453       12192    73634400    f  W95 Ext'd (LBA)
/dev/sda5            3808        5433    12292528+   7  HPFS/NTFS
/dev/sda6            5434        8142    20480008+   b  W95 FAT32
/dev/sda7            8143       10174    15361888+  83  Linux
/dev/sda8           10175       12192    15256048+  83  Linux
/dev/sda9            2453        3795    10146937   83  Linux
/dev/sda10           3795        3807       96358+  83  Linux

Partition table entries are not in disk order

You might notice an out of order start point for sda10 and that was exactly what fdisk was trying to tell me. After successfully installing VMWare Workstation 6.5.1, I tried to bring up my existing VM. VMWare continues to complain about its inability to retrieve disk information.

Unable to retrieve disk information: The partition table on the physical disk has changed since the disk was created. Remove the physical disk from the virtual machine, then add it again

I tried to contact VMWare and no one could help me here.  I figured out after a lot of research that an out of order partition table can cause problems with many applications and VMWare is one of them.  The suggestion was to reorder partition table.  Fun started here.

Note: Do not try the following instructions unless you know what you are doing.  These changes require some knowledge about your disk layout and linux boot process.  I will not take any responsibility if you can’t boot into your machine after following the instructions.

I used fdisk’s expert mode and re-ordered my partition table.  I noted down my old partition table layout and mapped the start, end and Id with the new layout.  This is required to adjust some of the configuration files. It looks like this now.

Disk /dev/sda: 100.0 GB, 100030242816 bytes
240 heads, 63 sectors/track, 12921 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x00000021

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        2174    16435408+   7  HPFS/NTFS
/dev/sda2            2175        2452     2101680   82  Linux swap / Solaris
/dev/sda3   *        2453       12192    73634400    f  W95 Ext'd (LBA)
/dev/sda4           12193       12921     5511240   12  Compaq diagnostics
/dev/sda5            2453        3795    10146937   83  Linux
/dev/sda6            3795        3807       96358+  83  Linux
/dev/sda7            3808        5433    12292528+   7  HPFS/NTFS
/dev/sda8            5434        8142    20480008+   b  W95 FAT32
/dev/sda9            8143       10174    15361888+  83  Linux
/dev/sda10          10175       12192    15256048+  83  Linux

This is not enough.  You need to readjust your boot order.  I did the following as well.

  1. Updated /etc/fstab entries based on the new partition layout
  2. Updated /etc/grub.conf and /boot/grub/menu.lst based. Note that, partition table starts from 1 and grub count starts from 0 (number Zero)

I rebooted my machine and it doesn’t find a valid boot record. I tried to use the recovery option from the install DVD. Though YaST says, grub is reconfigured, I still can’t boot. After further googling and some research, I decided to use grub command line option and re-intialize grub.

In grub command line mode,
grub> root (hd0, 5)
grub> setup (hd0)

Everything looks okay now and I’m writing this blog using Windows Live Writer from one of my Windows VMs hosted on my openSUSE 11.1.

Continuing on my building construction and software series…

Today, I took the following picture.

20052008025

Looks like this is a car parking area. As you notice some amount of work is done including the plastering and now, they can start construction on top of this.

For me, this is more like providing a library so that, my consumer can start using the interfaces from my library. But, there are differences.  Look at this picture…

  1. Only what is required for the next phase is completed.
  2. Finishing will be done once the basic structure is completed.

Can we do this when I deliver a library or module?  How much of the work should be done before some one just start using the library and build his/her component?  When do we do the finishing?

Re-usability

That’s when I started thinking about re-usability.  People always compare about building construction and software development.  The comparison is always about predictability of the schedule and design in a building construction.   But, do we ever think of re-using anything from a building when you move on to construct another one?  I think this is true for civil engineering and manufacturing.   All that we use are resources such as men(workers) and machineries.  But, in a software development, the emphasis is on integrating a bunch of components or modules and then spending 80% of the time on fixing integration issues.

More on this later….

Last time, I talked about our new facility.  I mentioned that this building was completed in a record time of 12 months.  There is a nice break out area on each floors.  Girish and myself have our lunch here daily.

Given below is couple of views from this break out area.  As you notice, another similar type of building is coming up next to our building.

blg1    blg2

Just imagine that you are designing and building a software.  Can you imagine that you are building the initial libraries or modules or what ever you call it here.  Does that look like these images.  How do we compare our low level libraries with these buildings.  For me, the foundation and the pillars that they raise  are the real backbone of a building.  Everything is constructed around these foundation and pillars.  You can not change the foundation or pillars once they are constructed unless you start from 0 level. 

If I take the above analogy to my software,  the components I choose are the foundation and the interfaces I define are my building blocks.  My interfaces are built on top of components.   Change in any of them is like starting the project from day 1.

I forgot to mention this. Early this month, we moved to our new facility. This is quite a distance for me. Though, the surrounding is better compared to where we were earlier, the facility itself was disappointing. Here is our new office building.

novell

and a new meeting room, where we can have our standup meetings.
scrum_room

Many of our executives came down for the inauguration of this building, including our CEO, Ron Hovsepian.

Plans to move to a new facility was announced in last February and it was mentioned that we will move to a new facility by next April. I must admit that the people managed this project kept their words and we were in our new facility in this April. What caught my attention is a mention about comparing Software projects with bringing up a facility like this during an opening address by our MD, Naresh Shah. He stated that our project managers should learn a lesson from this.

And, that made me think. What are our common excuses for schedule slippage?

  • Changing requirements
  • Technical challenges or change in technology
  • Slack in dependency management
  • People
  • Pressure in giving a schedule before you study the project

Now look at this scenario. Don’t you go back to your architect with a new idea when you construct a house or other buildings? How much does he accommodate? Don’t you think there are challenges when you construct a house such as new materials, delay in getting cement, steel etc. More over, handling construction work at Bangalore is another challenge where you can’t get anything done on time unless you sit with the workers.

On the other hand, I think I can always deliver the project on time, if

  • I decide what the customer needs
  • No beta deliveries and no feedback from customers
  • Customers don’t have a choice but to use my software
  • I deliver the project on the scheduled date in what ever condition it is and the customer is forced to use the product with or without my help
  • I will continue to build and deliver my product with no communication, though the customer has deployed the product in his production environment.

Do you think all projects will be successful in such a scenario?

« Previous Page