HyperVM Manual Alternative for creating Xen Domu using LVM

Posted on June 26th, 2009 in Linux | 2 Comments »

After the sad death of K T Ligesh I decided, like many people, to move away from HyperVM.

I searched and tried many control panels.

Openqrm – I found this over kill
karesansui – This is very nice looking and polished but seemed quite slow.
VDS Manager – Still in beta for Xen

I’ve now decided to create the VM’s by hand. I then hope to make a PHP control panel of my own. Here are my steps for creating Xen VPS’s using the command line and Centos 5.

I’m going to create a vm called testvm

First I needed to find out what Volume groups exist on my system and what the VG Name was

lvdisplay

VG Name                VolGroup00

Create the disks for the VM and format

lvcreate -L8.5G -n testvm_rootimg VolGroup00
lvcreate -L 384M -n testvm_vmswap VolGroup00
mke2fs /dev/VolGroup00/testvm_rootimg
tune2fs -j /dev/VolGroup00/testvm_rootimg
mkswap /dev/VolGroup00/testvm_vmswap

mkdir /mnt/img
mkdir /mnt/vm

Now mount your disk image. I’ve created a custom hardened Centos distro, but you could use Jailtime Images

mount -o loop centos.5-3.64-smudge.img  /mnt/img
mount /dev/VolGroup00/looop_rootimg /mnt/vm

Copy the image onto your new partition

cp -a /mnt/img/* /mnt/vm/

Now all you need to do is configure the hostname, ip etc on the VM.

vi /mnt/vm/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
IPADDR=87.xxx.xxx.xxx
NETMASK=255.255.255.xxx
ONBOOT=yes

Change the hostname

vi /mnt/vm/etc/sysconfig/network

If your using Jailtime images people have advised to change this line to the following:

vi /mnt/vm/etc/inittab
1:2345:respawn:/sbin/mingetty console

vi /mnt/vm/etc/ssh/sshd_config
PermitRootLogin yes

vi /mnt/vm/etc/fstab

Add the line:

/dev/sda2     swap   swap     defaults     0     0

umount /mnt/img /mnt/vm

You will need a ram disk to boot from. This can be created by running:

mkinitrd /boot/xen-guest-initrd `uname -r` –with xenblk –with xennet –preload xenblk –preload xennet.

Now all you need to do is create the config file and give it an IP/ Mac address.Please check which kernel you are using first and change – kernel = “/boot/vmlinuz-2.6.18-128.1.14.el5xen”…

kernel = “/boot/vmlinuz-2.6.18-128.1.14.el5xen”
ramdisk    = ‘/boot/xen-guest-initrd’
maxmem = 192
memory = 192
vcpus = 1
name = “testvm”
vif = [ 'ip=87.xxx.xxx.xxx,bridge=xenbr0, rate = 1000KB/s, mac=aa:00:23:b0:de:34' ]
serial     = ‘pty’
disk       = ['phy:/dev/VolGroup00/testvm_rootimg,sda1,w', 'phy:/dev/VolGroup00/testvm_vmswap,sda2,w']
root = ‘/dev/sda1 ro’
on_poweroff = ‘destroy’
on_reboot   = ‘restart’
on_crash    = ‘restart’

All is ready to go.

Just run:

xm create testvm

And you VPS should be now running:

check with
xm console testvm

Hope this helps.

Smudge IT will be lauching  a new site and Xen Vps systems soon. Watch this space..

Share/Save/Bookmark

Email alerts from Dell Poweredge using omreport

Posted on November 14th, 2007 in Dell Poweredge, Linux | No Comments »

Dell Poweredge Servers come with tools to monitor the hardware and driver updates. They have called it, OpenManage Server Administrator and this is how you can get it running. (if using yum and Centos)

wget -q -O – http://linux.dell.com/repo/hardware/bootstrap.cgi | bash

yum install srvadmin-all

srvadmin-services.sh start.

If all goes fine, you should be able to view a web interface via port 1311.

https://localhost:1311

I then had to log in with my root user name and password. I was pleased with the amount of features incorporated in Open Manage.

To setup the alerts you can click on Alerts Management > Then on the individual sensor. I chose to select, Execute application, so that I can have the software email me a complete list of errors detected.

Here is the script I use to email me:

#!/bin/bash

ps -ef >/tmp/psout.txt 2>&1

omreport system alertlog > /tmp/alertmsg.txt 2>&1

mail -s “Server Alert” root </tmp/alertmsg.txt> /tmp/mailout.txt 2>&1

Obviously substitute root with your email. Now when the server detects, will receive a printout of processes running at the time of the incident and a copy of the log file.

Share/Save/Bookmark

Minimal services on Redhat / Centos

Posted on November 14th, 2007 in Linux | 2 Comments »

On completing a minimal install of Centos, you often find that there are quite a few unwanted services started by default.

I like to disable the folowing with the commands:

/sbin/chkconfig xfs off
/sbin/chkconfig isdn off
/sbin/chkconfig gpm off
/sbin/chkconfig pcmcia off
/sbin/chkconfig sendmail off
/sbin/chkconfig cups off
/sbin/chkconfig portmap off
/sbin/chkconfig nfslock off
/sbin/chkconfig netfs off
/sbin/chkconfig rpcgssd off
/sbin/chkconfig rpcidmapd off
/sbin/chkconfig autofs off
/sbin/chkconfig lm_sensors off

Share/Save/Bookmark