Archive for the 'Virtualization' Category

veritas test setup via vmware on centos

I wanted to keep my veritas skills up to par, but I do not have an NetApp server or even a test box with multiple disk, Vmware to the rescue.

My setup is this


2.5Gb CentOS Host
2.5Gb Virtual Disk 1
2.5Gb Virtual Disk 2
2.5Gb Virtual Disk 3
2.5Gb Virtual Disk 4

I am using Veritas Storage Foundation Basic.

If you are setting up either a RedHat or CentOS server remember that the drivers for RedHat are now LSI compilable. When creating a Vmware server under Virtual Machine Configuration check Custom.

The only other change beyond this point that you have to be aware of is when you get to I/O Adapter Types be sure to select LSI Logic SCSI adapter instead of the BusLogic adapter.

That is it.

Once you discover the disks you should be able to list them via

ls -la /dev/sd?
brw-rw----  1 root disk 8,  0 Oct 21 09:46 /dev/sda
brw-rw----  1 root disk 8, 16 Oct 21 09:46 /dev/sdb
brw-rw----  1 root disk 8, 32 Oct 21 09:46 /dev/sdc
brw-rw----  1 root disk 8, 48 Oct 21 09:46 /dev/sdd
brw-rw----  1 root disk 8, 64 Oct 21 09:46 /dev/sde

Now simply create an empty table on the disks. I simply access the disks via fdisk. Once there simply type in ‘w’ once you see

Command (m for help): w

That should be it.

Now install the Veritas Storage Foundation rpm (sfbasic.4.1.02.0.rhel4_i686.tar.gz)

Quick one liner

tar -zxvf sfbasic.4.1.02.0.rhel4_i686.tar.gz ; cd rhel4_i686/storage_foundation_basic ; ./installsf

Once you have installed SF find vxdisksetup.

find / -name vxdisksetup -type f

After that it is a matter of running the command on your disks.

for scsidisk in b c d e ; do /usr/lib/vxvm/bin/vxdisksetup -i "/dev/sd${scsidisk}" ; done

I ignored the errors that were outputted as a result seeing that vxdisk list listed the new disks as online invalid and not just as .

After that I initiated the classic vxdiskadd and added the disks to a disk group (dg) named storagedg.

That was it.

Comments Off

joel on October 21st 2007 in CentOS/RedHat, Operating Systems, Other Tech, Virtualization

checking vmware virtual server state

If you want to check all of the virtual servers states simply run this command.

vmware-cmd -l | while read vmpath ; do echo -n "${vmpath}: " ; vmware-cmd "${vmpath}" getstate ; done

Comments Off

joel on October 15th 2007 in Virtualization

startup virtual servers in vmware

vmware-cmd is one of the weays to start up virtual servers in vmware. Below is the script I created for starting up the virtual servers on boot.

In order to add it as a startup script simply do

chkconfig --add vmwarestartup

/etc/init.d/vmwarestartup


#!/bin/sh

# Virtual Machine Declaration

# This will add startup links in /etc/rc[3 and 5].d/
# As S20vmwarestartup
# and K07vmwarestartup
# chkconfig: 35 20 07
# Description: Virtual Machine Startup script

centos='/vms/cent.os.4/CentOS 4.vmx'
freebsd='/vms/freebsd/FreeBSD 6.2.vmx'
windows2003='/vms/windows.2003/Windows Server 2003.vmx'
windowsXP='/vms/windows.xp.professional/Windows XP Professional.vmx'

machinestostart='windowss,freebsd'

lookuptable()
{
case $1 in
windowss)
echo ${windows2003}
;;
windowsd)
echo ${windowsXP}
;;
cent)
echo ${centos}
;;
freebsd)
echo ${freebsd}
;;
*)
echo ""
;;
esac
}

case $1 in
start)
for machine in $(echo ${machinestostart} | sed 's!,! !g' )
do
if [ ! "$( vmware-cmd "$( lookuptable ${machine} )" getstate | awk '{ print $3 }')" = "on" ] ; then
echo "Starting the machine $( lookuptable ${machine} )"
vmware-cmd "$( lookuptable ${machine} )" start
fi
done
;;
stop)
for machine in $(echo ${machinestostart} | sed 's!,! !g' )
do
if [ ! "$( vmware-cmd "$( lookuptable ${machine} )" getstate | awk '{ print $3 }')" = "off" ] ; then
echo "Stopping the machine $( lookuptable ${machine} )"
vmware-cmd "$( lookuptable ${machine} )" stop
fi
done
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0
;;
esac

Comments Off

joel on October 14th 2007 in Virtualization

vmware on centos and vmware-server-console on ubuntu

I wanted to have a place for multiple virtual servers and I knew that VMware had VMware Server rpm files so I thought I would test out CentOS. I did not want any gui frontend for the Server so I installed CentOS off of CD1 checking the minimal install button on the bottom.

After this it was a simple matter of downloading the VMware server


wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.4-56528.i386.rpm ; rpm -ivh VMware-server-1.0.4-56528.i386.rpm ; /usr/sbin/vmware-config.pl

I used the defaults on most of the questions and I did not configure gcc support. If I do need that I can simply configure the CC environment variable. Quick hint. You can install gcc relatively easily by simply doing yum install gcc.

CC=/usr/bin/gcc ; export CC

That should be it.

Now you need a way to control the virtual machines (vm). I suggest downloading the “VMware Server Linux client package” found on the same page as the VMware server. My desktop OS is ubuntu and the Linux client package worked right out of the box.


wget http://download3.vmware.com/software/vmserver/VMware-server-linux-client-1.0.4-56528.zip \
; unzip VMware-server-linux-client-1.0.4-56528.zip \
; cd vmware-server-console-distrib/ \
; ./vmware-install.pl

Note: If you are changing the specified port remember when you instantiate the VMware Server Console on your remote box with the hostname of hostname: .

Comments Off

joel on October 12th 2007 in Operating Systems, Ubuntu, Virtualization

virtual box and qemu

I have tried qemu for virutalization of a windows xp box but it always seemed too slow. I imagine because qemu was taking up most of the processing power, and my workstation is not all that powerful, which makes a difference. I still like it because of its simplicity. Simply create a sparse image and boot off of the cdrom.


dd if=/dev/null of=windowsXP.img bs=1M seek=5000 count=1 ; qemu -net nic -net tap -boot d -cdrom /dev/cdrom windowsXP.img

If you are going to do this on Ubuntu I would suggest first getting a bridge going. The simplest way to do this is to install the bridge-utils

sudo aptitude install bridge-utils

Then simply edit the /etc/network/interfaces file to read. The tap0 interface will be created once you run qemu.

auto br0
iface br0 inet static
bridge_ports eth0
address 10.0.0.226
netmask 255.255.255.0
gateway 10.0.0.1

To add an interface to a bridge once tap0 is has been set up by qemu.

sudo brctl addif tap0 br0

/etc/qemu-if

/sbin/ifconfig $1 0.0.0.0 up

Virtual Box is a lot like setting up VMWare images on the VMWare server. I love one-liners like the one below.


wget http://www.virtualbox.org/debian/innotek.asc; sudo apt-key add innotek.asc; sudo bash -c '( echo "#non-free fiesty packages" ; echo "deb http://www.virtualbox.org/debian feisty non-free" ) >> /etc/apt/sources.list' ; sudo aptitude update ; sudo aptitude install virtualbox

Comments Off

joel on September 21st 2007 in Virtualization