Wednesday, September 22, 2010

Solaris things...

I've been working with Solaris a lot, and we recently started with ZFS as well. Perhaps I'm missing something, but "top" & prstat dont report the correct amount of Memory free (RAM) on the machine when using zfs and neither does vmstat.

After some google searching, I found this helpful blog and thought I'd report. Thanks to "milek.blogspot.com" for this:



#!/bin/bash
#########
# Copied from http://milek.blogspot.com/2006/09/how-much-memory-does-zfs-consume.html
# to get correct reading of Free Memory
#

FREE=$(($(pagesize)*$(kstat -p unix:0:system_pages:freemem|awk '{print $NF}')))
ZIO_BUF=$(kstat -p zfs:0:arcstats:size|awk '{print $NF}')
FREE_MEM=$(((FREE+ZIO_BUF)/1024))
echo "Free Memory: $FREE_MEM MB"
FREE_MEM=$(((FREE+ZIO_BUF)/1024/1024))
echo "Free Memory: $FREE_MEM GB"



Next one was backups. We use Solaris 8 Branded Zones heavily to migrate off from our old Solaris environment. I started using ufsdump for backups, since this was not ZFS.

Well, trying to restore using ufsrestore, caused a ton of problems.

The simple
zoneadm -z s8zone install -a dumpfile

would give me weird errors such as " Sanity Check: Missing etc at /mnt"


Decided to use a ufsrestore, and that didnt help since zoneadm didn't know how to get it up.

Long story short, I did the following

1. Do a ufsrestore on to the disk
2. Used Zonecfg to create the configuration
3. Manually edited the /etc/zones/index file to modify the entry to match the backup version (with new name).

The index file would look like this:

global:installed:/
hostname:installed:/export/zones/app30qa:some id
hostname:installed:/export/zones/s8qa2flar:some id


This made zoneadm think that it was "installed" and I was finally able to boot up.

Thursday, September 09, 2010

11 years....

Whoa! I just realized, that this past August, it's been a full 11 years since I landed in the good ol' US of A in 1999. The twists and turns life has taken is interesting to say nonetheless. However, there is a small part of me that has regrets....

I didn't go back to India as I once thought I would by this time, but more than that, the fact that I'vent been able to be an entrepreneur in this country is hitting me the hardest. I keep thinking of going back, but life keeps taking turns. The worst part however, is the American immigration system that allows illegals to do what they please, but the ones like me who are following the law, be at the end of the line to get a Green Card. Bah!

The positives are definitely there too....better quality of life. A nice townhome, a lovely wife, two wonderful sons now (the second one just born) are all positives....

Now, if I can just get through the sleepless nights and refocus on being back on the entrepreneur path, it would just be so awesome.