How to Build Chelsio Drivers

Tags

, , ,

PreSteps: have a centos 6 scrap machine with virt-manager installed and functional, and a centos 6 VM.
Note: for the purposes of this document all instructions will be carried out on the VM not the host
Step 1: run yum update
Step 2: reboot
Step 3: run yum update again
Step 4: open a browser and go to the service.chelsio.com website
Step 5: FIND don’t download the tar/source you need. Not the rpm
Step 6: bookmark the page
Step 7: shutdown
Step 8: clone the VM
From this point onward we will be working with the clone
Step 9: Type the following
yum -y install librdmacm librdmacm-devl gcc open-ssl openssl-devel aclocal libtool sysfsutils subversion kernel-devel libibverbs libibverbs-devel librdmacm librdmacm-devel gcc open-ssl openssl-devel aclocal libtool sysfsutils subversion kernel-devel rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed xmlto binutils-devel elfutils-libelf-devel newt-devel python-devel zlib-devel glibc-static gcc-c++ isns-utils doxygen glibc-static gcc-c++ isns-utils
rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed xmlto binutils-devel elfutils-libelf-devel newt-devel python-devel zlib-devel openslp-devel
yum -y rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed xmlto binutils-devel elfutils-libelf-devel newt-devel python-devel zlib-devel
yum update
Step 10:
yum install kernel- 2.6.32-358.el6 kernel-devel- 2.6.32-358.el6 kernel-headers- 2.6.32-358.el6
Step 11 : comment out the exclude line (may not be present) in /etc/yum.conf it should be something like exclude kernel
Step 12: type the following
rpm -i http://vault.centos.org/5.9/updates/SRPMS/kernel-2.6.32-358.el6.src.rpm 2>&1 | grep -v mock
Step 13: do one last yum update and reboot
Step 14: after reboot you should verify you are on the old kernel by typing uname –r and see 2.6.32-358.el6
Step 15: open your browser and use bookmarks to go to the chelsio website and download the tar file
Step 16: I recommend creating a directory to work with such as usr/share/ but it will work anywhere
Step 17: open the tarball with tar –zxvf
Step 18: cd into the new directory
Step 19: type
make cxgb4 chelsio-utils chelsio-series4-firmware cxgb4toe cxgb4i
Step 20: after it is done you will see that some failed so type:
yum remove openslp
Step 21: make clean
step 22: make [the ones that failed]
step 23: if you are still seeing failed messages do these steps:
step 23.1 : script foo
step 23.2: make [the ones that failed]
step 23.3: exit
step 23.4: open foo in a text editor and try to find out what part failed and fix it. Sorry I can’t offer more help that. When you meanage to get it to work continue
step 24: check the rpmbuild/RPMS/x86_64 directory to verify that all the rpms were built
step 25: assuming they were use rsync –a on that directory and save it elsewhere on your system, at least off the VM clone you made
Step 26: use rsync –a on the tarball and move it off the VM clone you made
Step 27: halt the vm clone
Step 28: delete the VM clone
Step 29: off the first VM make another clone
Step 30: now get into a loop, starting from step 10 go to the next updated release, continue until you can not get any releases further. I wasn’t able to get the RPMS past 2.1 so godspeed on this one
Step 31: if you are at this step you have gotten the rpms to the highest version you are going to get them to. Take the rpms and move them to the system you wish to update
Step 32: backup your copy of iscsid.conf
Step 33: go to the system you wish to update and update the kernel to the version you were last able to build the RPMs to
Step 34: verify that dbus, network, and netfs are running
Step 35: delete the old cxgb4i driver
Step 36: use yum update on all the RPMs
Step 37: restore your copy of iscsid.conf (the yum update on the RPMs will have overwritten it)

how to document virtual machines

Tags

,

So, I have finally decided to document all of my virtual machines on my cluster. For now I just want to get the metrics down and after that I will automate the process. Here are the metrics I have chosen. Fell free to suggest additional ones:

  • OS
  • version (for windows 7, Xp etc for linux kernel)
  • automatic updates enabled
  • failover
  • RAM size
  • back up frequency
  • number of human users
  • # of CPUS
  • CPU feature lists
  • number of NICs,
  • host’s name
  • ip address in /etc/hosts?

 

one method of cloning using KVM

Tags

, ,

PreStep 1: Have a functional VM you wish to close

I have a functional VM and want to clone it.

Step 1: turn off or at least pause the virtual machine

Step 2: go to the location its disc is stored in memory. For me it was /var/lib/libvirt/images/

Step 3: copy that image to make a new one, the clone.

cp cluster-1.img cluster-2.img

if you want you can background this by typing control+d, then “bg” and enter. Or you can just wait a minute

Step 4: dump the xml configruation

virsh dumpxml cluster-1.img > foo

Step 5: now edit the file

nedit foo

Step 6: in the file remove the line containing the uuid, dont worry virsh will give it a new one, change all machine names to cluster-2.img from cluster-1.img, and change the MAC address.

step 7: save and exit nedit

step 8: define the new virtual machine

virsh define foo

using xdelta3

Tags

, , , ,

first make a garbage file
cd /tmp
dd if=/dev/urandom of=foo count=90000
make a copy
cp foo foo2
now, make a change
echo “added change to foo” >> foo2
do a ls -l and notice the slient differences between the two files sizes
do the xdelta
xdelta3 -e -s foo foo2 foo3.delta
do another ls -l and look at the sizes, for me foo3.delta was 203
now, apply the patch to foo to get the new one
xdelta3 -d s foo foo3.delta new_foo
do a ls -l and you will see that new_foo is equal in size to foo2
if you do a cmp you will see that they are the same
cmp new_foo, foo2

why is this useful? Because everyday I can do a xdelta compared to a monthly backup and save the deltas. This allows me to recovery my data to any day of the month by successfully applying patches

A note on installing: I am in-general against installing any utility that I have to make install configure etc. It can lead to system instabilities that can be very hard to track down. It is almost always better to get a precomplied binary from a repo. However, in this case I wasn’t able too. So, what I did was use a VM I keep around from this kind of thing. There I complied it from its tarball and used rsync to move the binary to /bin/ it may not be the best way to go about it but I dont live in fear that by compiling it it broke some header file or dependency that something else on my production system needs. Yet another reason why Gentoo isnt my first choice in distros.

Installing KVM

Tags

, , , , ,

KVM is a wonderful suite for constructing and playing with VMs. It has enough power for actual production environments and is easy enough to use that a regular user can use it to learn more about visualization. It is FOSS and I use it a great deal.

Get into root

su

Type in root password, then type

yum install kvm

Confirm the installation by typing “y” when asked. Then install libvirt

yum install libvirt

You are really going to want a gui so install virtual machine manager

yum install virt-manager

Under applications, system tools (top icons) select virtual machine manager

I received an error about libvirt not running so I closed it and went back to my root terminal and typed

/sbin/service libvirtd start

Then I reopened virtual machine manager and it works fine. Make sure to exit out of root by typing

exit