Saturday, October 9, 2010

Event Based Model-Ubuntu Boot Up Explained

http://www.linuxplanet.com/linuxplanet/tutorials/7033/1/

Ubuntu's Success Story: the Upstart Startup Manager (Linux Boot Camp p.2)
Controlling Boot Sequence, What is Event-Based

Akkana Peck
Thursday, April 8, 2010 11:32:09 AM

Boot Camp Part I explained how Linux boots, using the old "SysV init" system of scripts. But some modern Linux distros have been gradually migrating to a newer model, called Upstart.
Upstart has been around since 2006, but it's only in the last year or so that it's taken a major role in booting distributions like Ubuntu and Fedora. Debian and OpenSuSE are reportedly joining in soon, while it's available as an optional component on most other distros. No distro uses it as the sole boot method yet: even Fedora 12 and the upcoming Ubuntu 10.04 keep a lot of functionality in SysV scripts.

An event-based model

The normal SysV boot process is synchronous -- meaning things happen one at a time, one after the other. First you run S10sysklogd, and only when that's finished you can start running S11klogd. If anything in the boot process takes a long time, everything else has to wait.
Upstart, in contrast, is event based. An "event" can be something like "booting" ... or it can be a lot more specific, like "the network is ready to use now". You can specify which scripts depend on which events. Anything that isn't waiting for an event can run whenever there's CPU available.
This event-based system has another advantage: you can theoretically use it even after the system is up and running. Upstart is eventually slated to take over tasks such as or plugging in external devices like thumb drives (currently handled by udev and hal), or running programs at specific times (currently handled by cron).
Currently, however, Upstart is used primarily for booting and shutdown, and it's not clear when we'll see it used for other purposes.

New directories

Upstart eschews the old /etc/init.d and /etc/rcN.d in favor of a new directory containing "job definition files". And here's a point of confusion: it doesn't have a standard name.
On most systems, including Fedora and released Ubuntu systems, Upstart uses /etc/event.d. But in Ubuntu's upcoming release that changes to /etc/init. Yes, that means Ubuntu 10.04 systems have both /etc/init, for Upstart, and /etc/init.d, for the old SysV files. Not only that, but if you upgrade from an earlier version of Ubuntu and you've put anything nonstandard in /etc/event.d, you'll have to migrate it by hand -- the upgrader does not do any migration (bug 402759.)
I mentioned that Upstart doesn't use /etc/init.d. But all Upstart-using distros still include that directory. Some of the files in it are regular SysV Init scripts that haven't been migrated yet. But some services that have migrated maintain a link from /etc/init.d to /lib/init/upstart-job. If you run one of those, it works, but it prints a warning first:
$ sudo /etc/init.d/dbus restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service dbus restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart dbus

Boot sequence

How does the boot sequence change with Upstart?
The beginning of the boot sequence is still the same. The computer's BIOS boots grub (or another boot loader) from the disk; grub loads the kernel and then passes control to the init process.
But on an Upstart machine, init comes from upstart. Instead of running a master rc script that calls the scripts for a specific runlevel, Upstart's init takes jobs from its job directory.

Job definition files

A typical Upstart job definition file looks like this:
$ cat /etc/event.d/hostname.conf 
# hostname - set system hostname
#
# This task is run on startup to set the system hostname from /etc/hostname,
# falling back to "localhost" if that file is not readable or is empty and
# no hostname has yet been set.

description     "set system hostname"

start on startup

task
exec hostname -b -F /etc/hostname
In this simple case, the hostname job runs when Upstart sees a startup event.
Events can be more detailed than that, For instance, Upstart knows about runlevels. The file rc2.conf, whose job is to run all those old SysV files in /etc/rc2.d, includes this:
start on runlevel 2
stop on runlevel [!2]
udev.conf includes:
start on virtual-filesystems
stop on runlevel [06]
virtual-filesystems is an event indicating that filesystems such as /dev and /proc have been mounted. It's sent by another Upstart job:
$ cat mountall.conf
# mountall - Mount filesystems on boot
#
# This helper mounts filesystems in the correct order as the devices
# and mountpoints become available.

description     "Mount filesystems on boot"

start on startup
stop on starting rcS

expect daemon
task

emits virtual-filesystems
emits local-filesystems
emits remote-filesystems
emits all-swaps
emits filesystem
emits mounting
emits mounted

[ ... rest of script ]
All these signals will be emitted when the mountall job completes successfully. Then Upstart can start jobs like udev that are waiting for one of those events. Jobs can depend on more than one event:

Monday, September 27, 2010

Disk Aligment -Clarrion

 http://spiralbound.net/2008/06/09/creating-linux-partitions-for-clariion

Creating a properly offset slab of disk for Linux systems on your CLARiiON is not just a matter of creating a partition using the default fdisk values. The reason for this is that disk management utilities for Intel based systems generally write 63 sectors of metadata directly at the beginning of the LUN. The addressable space begins immediately after these initial sectors causing the CLARiiON to cross disks, especially when writing larger IO because it doesn’t match up with the stripe element size (usually 64k).
To get around this, you have to align the partition in such a way that it will start writing data on a sector that will mesh up nicely with the stripe element size. In this case, 128. Below is an example of how I create partitions on our CLARiiON for Linux systems. Check out the EMC Best Practices for Fibre Chanel storage white paper for more detail.
/sbin/fdisk /dev/emcpowera
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 39162.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-39162, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-39162, default 39162):
Using default value 39162

Command (m for help): x

Expert command (m for help): b
Partition number (1-4): 1
New beginning of data (63-629137529, default 63): 128

Expert command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Thursday, July 15, 2010

Ubuntu 10.04 Lucid Software Raid Bug

This is what you get after install.


mount: mounting /dev/disk/by-uuid/***uuid snipped*** on /root failed: Invalid argument
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /sys on /root/sys failed: No such file or directory
mount: mounting /proc on /root/proc failed: No such file or directory
Target filesystem doesn't have /sbin/init.
No init found.  Try passing init= bootarg.

Install any older version 8.04 or 8.10. Then install lucid and reformat the mds.

Thursday, May 27, 2010

Ubuntu-ext4 umount Takes Long time-BUG

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/543617

Fix Released in 10.04

Saturday, May 8, 2010

Ghetto VCB- ESXi Backup VMs

http://communities.vmware.com/docs/DOC-8760

Vsphere RCLI on Windows-7 -he ordinal 2821 could not be located in the dynamic link library LIBEAY32.dll Error-Fix

perl.exe - ordinal not found: The ordinal 2821 could not be located in the dynamic link library LIBEAY32.dll


Rename the libeay32.dll in c:\windows\system32 to libeay32.dll.old and then copy the one in the c:\program files\vmware\vmware remote cli\perl\bin into that folder.

Friday, May 7, 2010

vSphere client could not connect w/vCenter Server.... Operation Timeout

With ESX it is sometimes necessary to run the command services vmware-mgmt restart should you not be able to connect with the VI client or if you need the host to re-read the esx.conf configuration file because changes you have made at the console are not visible in VirtualCenter. The services command is not available on ESXi and the supported method is to access the Direct Console User Interface (DCUI) and then to select the restart option from there as in shown in the first image.
If you have console access or have enabled SSH on your ESXi host, you can run the command /sbin/services.sh restart to accomplish the same thing as is shown in the second image. This will restart the agents that are installed in /etc/init.d/ and with a default install that includes: hostd, ntpd, sfcbd, sfcbd-watchdog, slpd and wsmand. It will aalso restart the VMware HA agent (AAM) if that has been enabled on the host.

Thursday, May 6, 2010

Simplest Motor-Amazing

http://www.facebook.com/video/video.php?v=1401027819272

KVM-Vmware Vsphere ESXi 4.0

Seems like XEN is in its last breathing stages and the battle is going to heat up for KVM and Vmware. Let not talk about Hyper-V yet.

http://www.howtoforge.com/kvm-and-openvz-virtualization-and-cloud-computing-with-proxmox-ve

I am working on this and will update with some cool results.

Vpshere HA Cluster- Good Read

http://www.virtualizationadmin.com/articles-tutorials/vmware-esx-articles/vmotion-drs-high-availability/configure-vmware-high-availability-vmha.html

Kickstart Ubuntu Server( Intrepid Bug)

https://bugs.launchpad.net/ubuntu/+bug/293586

There's a fixed i386 initrd available here:
http://people.ubuntu.com/~cjwatson/tmp/intrepid-busybox-fix/netboot/ubuntu-installer/i386/

As per Marc.
This is a huge bug. I hit it when trying to kickstart Intrepid Ibex yesterday, and I tracked it down exactly to that missing CONFIG_GETOPT_LONG. When will the initrd...

http://archive.ubuntu.com/ubuntu/dists/intrepid/main/installer-$ARCH/current/images/netboot/ubuntu-installer/$ARCH/initrd.gz

...be regenerated to include the new version of busybox ? For those waiting for it to be regenerated, here is a workaround that consists of patching a broken initrd, to make kickstart's "url --url http://xxx" option work again (and only this option, others will remain broken):

$ mkdir i && cd i
$ zcat .. /initrd.gz | cpio --make-dir -i
$ patch -Np1 <.. /fix-kickseed-url-handler.patch
$ find . | cpio -o -H newc | gzip -9 >.. /initrd.gz

Wednesday, May 5, 2010

Exchange 2010 Cluster

http://www.shudnow.net/2009/10/29/exchange-2010-rtm-dag-using-server-2008-r2-%E2%80%93-part-1/

EMC SAN Hardware Failure

Customers of Exchange hosting provider Intermedia.net Inc. had their service interrupted earlier this month due to a hardware failure in Intermedia's EMC SAN, resulting in the hosting company crediting customers for failing to meet the terms of their service-level agreements (SLAs).

Intermedia Chief Operating Officer Jonathan McCormick sent a letter to impacted customers last week explaining the reasons for the April 16-17 outage. McCormick also posted an update last Thursday on Intermedia's official blog.

According to the statement sent to customers:

At approximately 6:15 a.m. PT on Thursday 4/16, a hardware failure occurred on one of the EMC storage area networks (SANs) located in Intermedia's New Jersey data center. The service processor for one of the controller nodes had a failure. This failure caused the entire load for that SAN to be shifted to the service processor on the redundant controller node.

The spare capacity on the single service processor was not enough to handle the entire load of all systems connected to the SAN, which caused a degradation of performance for the reading and writing of data to the SAN. The degradation of performance on the SAN in turn impacted the overall system's ability to process email messages creating a queuing of several hundred thousand messages within the system. The back log was large enough that it took 32 hours for it to clear after the original event. At approximately 2 p.m. PT on Friday 4/17, all systems were functioning normally and mail delivery was considered to be "real-time."

The statement continues:

* The vendor [EMC] determined that the service processor failure occurred due to a unique bug in the specific version of firmware on the system. This bug caused the service processor to "panic" and automatically take itself off line. As the first corrective action, on Friday 4/17 at 11 p.m. PT, our vendor performed an emergency upgrade to the version of firmware running on the SAN. This newer version of firmware has a fix for the bug that caused the failure we experienced.

* Since the outage, as the second corrective action, we have added additional processing capacity to the SMTP hub farm in this domain. We have also performed performance tuning on the SMTP hubs to guarantee that they are able to more rapidly process a larger than normal queue of messages.

* Over the next several weeks, we will be taking additional corrective actions to make certain that there is enough spare capacity on the SAN to guarantee that it performs without performance degradation in the case of a single hardware failure. An additional SAN is being installed this week and starting as early as this weekend we will begin to migrate a portion of the existing systems to the new SAN. Additionally, we have engaged our SAN vendor to review the performance tuning of our SAN and implement adjustments to increase its overall performance capabilities. These events in tandem will guarantee that the SAN will be able to perform without an impact to the service in the event we experience another individual hardware error.

Intermedia declined to comment on which of EMC's SAN products was involved, and also declined to disclose the firmware level before and after the outage, citing security concerns. An EMC spokesperson also declined to comment.

"We can confirm that the issue impacted customers on two of our 21 domains," wrote Intermedia's spokesperson in an email to SearchStorage.com "Impacted customers will be proactively credited on 4/23 under the terms of our service level agreement."

More on EMC SANs
EMC officials admit Clariion and Celerra consolidation afoot

EMC sees IT spending recovery, plans further cloud storage push in 2010

EMC upgrades Symmetrix V-Max arrays, thin provisioning
According to a blog post by Intermedia customer David Mok, who is chief technology officer at soccer social media website OleOle.com, Intermedia also suffered an outage in March which was attributed to similar causes.

Mok wrote on March 12:

Today I received their formal RFO (Reasons for Outage) letter via email which goes into great details describing why this outage occurred and what steps they are taking to try to prevent a re-occurrence for the same reasons in future. In a nutshell, there was a hardware failure in one of their EMC SAN devices, and this failure occurred in such a way that prevented the device's own in-built fault tolerance mechanisms from allowing the SAN to effectively remain "up" – that is, they are saying this is one of those failures that should not have happened. These devices are designed precisely NOT to fail under such circumstances, but nonetheless it did fail.

Intermedia's letter goes on to describe the actions they are taking along with the hardware vendor to guard against this in future. All very good and well. Now on to the little gem in the letter that I found the most surprising, and from which all technologists with "uptime" responsibility for Software as a Service (SAS) systems would do well to learn from.

Mok declined comment on the most recent outage, saying his email service had not been affected this time.

In its email to customers, Intermedia acknowledged having received "significant constructive feedback regarding our communication throughout the outage…we have developed a new client notification tool that will be used by the Technical Support organization to proactively notify and communicate with clients during a service interruption." Intermedia's spokesperson confirmed there were two outages, but did not disclose further details.