the mysterious MegaCLI
Posted: October 27, 2011 | Author: Sideb0ard | Filed under: hardware, scsi | Leave a comment »I’ve inherited some Production Sun Fire X4470 boxes, which upon first look appeared to only have 2 x 140GB drives. Checking the purchase orders however, revealed that they should in fact have 4 x 140GB drives, a fact confirmed by “dmesg |grep scsi”.
These Sun Fire servers come with an internal 6Gb SAS PCIe RAID HBA which are managed via the LSI MegaRAID Management Suite. Unfortunately, the LSI website is a nightmare to navigate and has been re-arranged with no-redirects, requires a login and in general makes it very hard to find and download the MegaCLI utility.
I eventually found a working download link at http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.16_MegaCLI.zip.
The zip file contains an RPM file, so if like myself, you run Debian, you’ll need to run:
rpm2cpio MegaCli-8.02.16-1.i386.rpm | cpio -idmv
The binaries are statically compiled so actually run fine.
In this situation, it simply turned out my drives were setup as RAID 1 mirrors, which was easy to discern using:
./MegaCli64 -CfgDsply -aALL
I came across a couple of good cheat sheets for MegaCLI –
http://thatlinuxbox.com/blog/article.php/lsi-megaraid-megacli
http://www.theserve.co.uk/web-hosting-blog/megacli-commands
http://ftzdomino.blogspot.com/2009/03/some-useful-megacli-commands.html
http://tools.rapidsoft.de/perc/perc-cheat-sheet.html
http://www.5dollarwhitebox.org/drupal/node/82
For me, the most useful ones were:
#Physical Disk List
./MegaCli64 -PDList -aALL
#Physical Drive Info
./MegaCli64 -pdInfo -PhysDrv \[252:4\] -aALL |less
#Logical Disk Info
./MegaCli64 -LDInfo -LAll -aAll | less
# Config Display
./MegaCli64 -CfgDsply -aALL
# Config add Logical Drive
./MegaCli64 -CfgLdAdd -r0 \[252:4,252:5\] -a0
# Logical Drive Init
./MegaCli64 -LDInit -Start -L2 -a0
We installed another two drives in the machine, which i was able to bring online in a RAID 0 volume using:
./MegaCli64 -CfgLdAdd -r0 \[252:4,252:5\] -a0
However, even after having created this RAID 0 volume, my OS couldn’t see it when using ‘fdisk -l‘ – i had to run
echo “- – -” > /sys/class/scsi_host/host0/scan
which forces a SCSI bus rescan, and made available the new drive.
PuppetConf 2011 video/talks now online
Posted: October 16, 2011 | Author: Sideb0ard | Filed under: configuration management, puppet | Leave a comment »
The videos/talks from PuppetConf 2011 have just been posted here. So far, the two i’ve watched – “Operating At Scale” and “Operations is a Strategic Weapon” are excellent, very informative.
Gen Xen
Posted: October 10, 2011 | Author: Sideb0ard | Filed under: cloud, configuration management, perl, programming, virtualization, xen | Leave a comment »
I’ve been working pretty extensively with Xen and Puppet in my new job, really loving it! I’ve been creating a whole load of Xen hosts, most of which are cloned from an initial image I built using Xen-tools. I’ve just finished a script which is over on my github page, which basically automates what was previously a manual process.
Basically, it copies your existing disk.img and swap.img, generates a new xen.cfg file based on some interactive input (desired hostname, IP, memory and number of vCPUs) plus a random Xen mac address, then mounts the disk.img file and changes some appropriate system files – /etc/hostname, hosts, and network/interfaces.
All quite simple and straight forward, but quite nice to have automated.
Here’s the README:
GenXen #
#############################
A script for automating Xen VM deployment.
It requires that you have a base disk.img and swap.img already created.
I created mine with:
xen-create-image –pygrub –size=50Gb –swap=9Gb –vcpus=2 –memory 6Gb –dist=squeeze –dhcp –passwd –dir=/var/virt-machines –hostname=xen-squeeze-base
Fill in some of the variables at the top of GenXen.pl before running, then simply:
./GenXen.pl
The interactive part will ask for hostname, memory size, vCPUs, IP address, then generate a unique Xen mac address, and write these all to a xen config file which will be saved in /etc/xen/
It’ll copy your disk.img and swap.img to destination dir, mount the disk.img and create appropriate files for:
/etc/hostname
/etc/hosts
/etc/network/interfaces
After that you should be good to launch with:
xm create -c /etc/xen/whatever-your-hostname-is.cfg
physical internet
Posted: October 3, 2011 | Author: Sideb0ard | Filed under: infographic, internet, networking, visualization | Leave a comment »Ever since reading Neal Stephenson’s Mother Earth Mother Board article, I’ve been quite fascinated with the undersea cables which physically connect the land masses of the world. This map, linked above is an amazing view into this part of the Internet’s current infrastructure.
(via flowingdata.com)

