I needed a few iSCSI LUNs to practice some of the features of using VMware infrastructure in an SAN kind of environment. I decided to build my own iSCSI appliance based on IET target, using IET as its available part of the standard Ubuntu distribution and works well for test environments, I don’t run this in Production as yet.
Update: Now that the LIO is part of the Linux kernel that would be a good option to use if its available as part of your distribution. AFAIK, it currently not available under Ubuntu 10.04.
We will first build an appliance base and then proceed to install & configure the iSCSI target. Here are the exact steps you would need to follow to build one:
- Installing the base OS for the virtual storage appliance: Install a Ubuntu 1o.04 based VM with 4GB (LSI Parallel) of the OS/system disk, 512MB of RAM, one e1000 NIC. Do a bare minimal text install without any GUI or X server or any additional packages.
- Dist-Upgrade: After installation is finished. Install the latest OS updates.
After the OS upgrade has finished. Reboot the VM. Clean up / remove any old upgraded packages.
apt-get autoremove apt-get autoclean apt-get purge
- Preparing the Appliance Base: Now lets install some additional packages that we would need for building the appliance.
apt-get install build-essential linux-headers-$(uname -r)
In addition to the above, I generally also install the OpenSSH server, VIM and few other tools such as less, wget etc. This is a good time if you need to install any additional tools.
apt-get install openssh-server wget less vim
- Finalizing the appliance base: Since we are running this VM in a vSphere environment, we will install and configure VMware tools. If you are running a different virtualization solution use the appropriate tools.
Typically I extract the VMware tarball to a persistent location, so that in future if I upgrade the kernel I always have the tools available to reconfigure tools for the said kernel.
cd /usr/local/src mount /media/cdrom0 tar zxvf /media/cdrom0/VMwareTools-X.X.X-nnnnnn.tar.gz cd vmware-tools-distrib
After the tools have been extracted, build and install the same. Again I follow VMware defaults rather than using any custom config. The best way to do an unattended default install of VMware tools is:
After the tools are installed, halt the VM. This is also a good time to change the network adapters associated with your VM. Change it from ‘e1000’ to ‘vmxnet3’, also change the disk controller from ‘LSI Parallel’ to ‘VMware Para-virtual’. This will give you better IO performance for your virtual storage appliance.
- This finishes us with our base appliance preparation tasks. You may follow these tasks in case you want to build other appliances as well.
We will continue configuration and setup of the storage appliance in the next post.
– i.e. Part 2.