Kessel Run

Unix, Star Wars, and Gadgets

Monday, February 25, 2008

Cool screen trick and comments disabled

I found this trick from a buddy the other day. Check out his blog here

Everyone who uses Unix/Linux uses screen, if not see the MAN page here. I never knew it could open up a screen on a serial device! Turns out it can.

Here is an example for Apple OSX from my friend’s blog .

screen /dev/tty.usbserial 9600

The only thing that would change for Linux/Unix is the device name so just change the device to /dev/ttyUSB0 or /dev/ttyS0.

Just as an FYI comments are disabled, but please feel free to send me an email at any time and I will post an update to the entry itself answering your question. Contact me at {paul{{atxz}kesselrun{{[dot}}{{com]}}

posted by Paul at 12:06 am  

Friday, February 22, 2008

Easy Solaris 10 zones with memory and cpu limits!

For most of Solaris 10’s short life it has been extremely complex to limit cpu and memory for a zone. Lucky for us the 8/07 update makes things a whole lot easier. I will touch on an easy way to limit disk usage as well.

I am assuming you have a Solaris 10 machine spun up…and have a generic understanding of it’s inner workings.

The below describes a whole-root zone i.e. everything is copied over to the zone. (the create -b is very important)

First off we want to create the config for our zone :

[root@server /]# zonecfg -z testzone
testzone: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:testzone> create -b
zonecfg:testzone>

Your config file has been created, it is now time to configure your zone.

zonecfg:testzone> set zonepath=/zones/testzone
zonecfg:testzone> set autoboot=true
zonecfg:testzone> add net
zonecfg:testzone:net> set address=10.10.1.5
zonecfg:testzone:net> set physical=hme0
zonecfg:testzone:net> end
zonecfg:testzone:net> info

That sets up the bare basics of a zone now. The “info” command will list your current setup.

Now things get messy.

CPU limiting (8/07 only!). The process below sets the zone to use only 1 CPU.

zonecfg:testzone> add dedicated-cpu
zonecfg:testzone:dedicated-cpu> set ncpus=1
zonecfg:testzone:dedicated-cpu> end

RAM limiting (8/07 only!). This will cap ram and swap for the zone.

zonecfg:testzone> add capped-memory
zonecfg:testzone:capped-memory> set physical=1g
zonecfg:testzone:capped-memory> set swap=1g
zonecfg:testzone:capped-memory> end

Ok, your ready to go time to commit and exit

zonecfg:testzone> verify
zonecfg:testzone> commit
zonecfg:testzone> exit

You now have a config file in /etc/zones/testzone.xml

Check your running zones.

[root@server /]# zoneadm list -vc
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- testzone installed /zones/testzone native shared

Install your zone…this takes some time.

[root@server /]# zoneadm -z testzone install

Boot up your new zone!

[root@server /]# zoneadm -z testzone boot

Log into your zone’s “console”

[root@server /]# zlogin -C -e [ testzone

Now I glossed over the disk limitations, there are a couple of techniques but I settled on using a separate disk for zones and using slicing (partition) the disk into pieces. You can also do this via filesystem quotas and just letting it fill it’s current mount point.

If I run into any tricks or tips I will post a follow up to this guide. I might try and get running Linux in a zone, however since I use all Sparc64 hardware this seems rather pointless due to the fact branded zones are said to only work in Solaris 10 x86 (I could be wrong…something to test at least.)

Here are a couple of the links I used, this process is not well documented especially with the 8/07 release.

Sun’s Official zone/virtulization guide.
Blastwave’s guide to zones.

posted by Paul at 12:06 pm  

Friday, January 11, 2008

New CKlabs!

I finally got around to setting everything up in my new lab.

Here is a bit of the gear.

Network Gear:

    Cisco 2924 24port switch w/ Fiber
    Linksys WRT54G w/ dd-wrt
    HP 12port Hub (for sniffing and WAN)
    Netgear 5port Gigabit switch
    Sonicwall Tele3 sp Firewall

Server/Computer Gear:

    Parsec : AMD64×2 2gb RAM 2×500gb SATA Linux
    Falcon : AMD64 1gb RAM 1×400gb SATA Linux/Windows
    Osiris : Toshiba Sat. P4M 512mb RAM 1×40gb IDE Linux/Windows
    Ra : Sun Netra X1 1gb RAM 2×40gb IDE Solaris 10
    Chewie : IBM T30 P4M 512MB RAM 1×60gb IDE Linux
    Carbonite : IBM X60 Core2duo 1gb RAM 1×80gb SATA Linux
    Maw : Sun Netra X1 256mb RAM 2×40gb IDE Openbsd
    Dreadnaught : P4 XEON x2 6gb RAM 3×73gb SCSI Linux
    unnamed : P4 XEON 2gb RAM 2×36gb SCSI Linux

New CKlabs

posted by Paul at 12:24 pm  

Thursday, December 6, 2007

Happy End of Prohibition day! Dec. 5th 1933!

Cheers!

In case anyone has ever wanted to try Absinthe, it is now legally in the states under the names Lucid (France) and Kubler (Switzerland).

For only “legally” drinking for about 1 year, I think I am not doing so bad….

My Bar

posted by Paul at 12:12 am  

Sunday, December 2, 2007

Ck3k.org back up!

It took me some time to get things back up and running (pull backups, move servers, etc.) But ck3k.org is backup! I doubt anyone noticed or cared, but this makes it look like I keep this blog up to date ;)

-Paul

posted by Paul at 3:13 pm  

Wednesday, November 14, 2007

It’s Trek time!

“On Tuesday, November 13, and Thursday, November 15, the two-part Star Trek Remastered version of “The Menagerieā€ will beam onto the big screen in a special engagement with selected theatres.” - startrek.com

I am going, that is all there is to it. I am also going with a fellow trekkie WildBill , so should be fun. I am having trouble deciding….what shirt should I wear? See below for options….troubletrek.JPG

posted by Paul at 12:18 am  

Friday, September 14, 2007

Ck3k.org down

I am de-racking my server for ck3k.org (friend is moving), so it will redirect here for the moment. I should have it back up by the end of the day. If anyone cares or needs something from it, let me know.

-Paul

posted by Paul at 9:41 am  

Thursday, August 30, 2007

…so I went with the GTI

In reply to my last post, I went ahead and got the VW GTI, the thing drives like a dream. I will have to upload pics soon! I am also waiting for the DMV to deny my custom plate request of “J3D1.”….This is not the GTI you are looking for….

posted by Paul at 5:28 pm  

Tuesday, August 21, 2007

Z00m z00m

I have been driving around my 03 Eclipse GS for about a year now, and it is starting to show the abuse that I put it though during my commute. I am looking to upgrade. Here is the list of the cars I think rock, keeping in mind I am lame and can’t drive manual…yet

My budget is from 18,000 to about 26,000 dollars.

    2005-2006 Subaru WRX
    2006-2007 VW GTI
    2001-2002 BMW Z3
    2007 Mini Cooper S
    2004-200* BMW 325ci
    2004-200* Infinti G35
    2004-200* Nissan 350z

I like German cars, but I am worried about the costs of keeping them maintained. If they where cheap I would have alread gotten a 3-series BMW. If anyone has any ideas, let me know!

posted by Paul at 10:31 am  

Monday, August 20, 2007

Netra X1/Solaris 10 NIC failover

This is a technique for failing over a pair of nics on a Solaris 10 machine. I am told this will only work with Sun nics that come with Sun hardware, but I haven’t tested it.

You need to be root for all of the following, I am also assuming your going to be able to reboot the machine once this setup is in place.

First make sure you have your hostname in your /etc/hosts file


[ck3k@ra ~]$ cat /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
10.10.1.112 ra loghost

Ok, so in your /etc/hosts ra is your hostname. Now we need to edit/create two files. NOTE the .dmfe* will be the interface name, for example on a SunFire T2000 it is hostname.ipge*.

First setup your main nic’s hostname file (This should already exist in your install)


[ck3k@ra ~]$ cat /etc/hostname.dmfe0
ra netmask + broadcast + group failover up

So you see your hostname and it’s ip info, but now it has a group called “failover.” This creates a group of nics that will failover for one another.

Now create the hostname file for your second nic.


[ck3k@ra ~]$ cat /etc/hostname.dmfe1
group failover up

This just adds the nic to the group for failover. Now, reboot your system and the settings will take affect on boot. Keep in mind this will work for virtual interfaces as well, so all of your Zones will also failover.

Once your system reboots, the best way to test is to be on the LOM via serial and to pull one of your two nics out of your switch.

Here some of the output of the nic going down :


Aug 16 17:54:28 ra dmfe: [ID 801593 kern.notice] NOTICE: dmfe0: PHY 1 link down
Aug 16 17:54:28 ra in.mpathd[135]: [ID 215189 daemon.error] The link has gone down on dmfe0
Aug 16 17:54:28 ra in.mpathd[135]: [ID 594170 daemon.error] NIC failure detected on dmfe0 of group failover
Aug 16 17:54:28 ra in.mpathd[135]: [ID 832587 daemon.error] Successfully failed over from NIC dmfe0 to NIC dmfe1
Aug 16 17:55:05 ra dmfe: [ID 801593 kern.notice] NOTICE: dmfe0: PHY 1 link up 100 Mbps Full-Duplex

Here it is coming back up :


Aug 16 17:55:05 ra dmfe: [ID 801593 kern.notice] NOTICE: dmfe0: PHY 1 link up 100 Mbps Full-Duplex
Aug 16 17:55:05 ra in.mpathd[135]: [ID 820239 daemon.error] The link has come up on dmfe0
Aug 16 17:55:05 ra in.mpathd[135]: [ID 299542 daemon.error] NIC repair detected on dmfe0 of group failover
Aug 16 17:55:05 ra in.mpathd[135]: [ID 620804 daemon.error] Successfully failed back to NIC dmfe0

You now have a redundant Solaris machine that can resist some layer one failures.

posted by Paul at 3:50 pm  
Next Page »

Powered by WordPress