Wednesday, February 27, 2008

CentOS 5 domU out of thin air

UPDATE: As Matt pointed out it's DomU not Dom0!

I finally got around to working out how to pull a CentOS install out of thin air without messing about with out of date images from jailtime.org and fiddling about trying to find xen aware kernels to boot (harder than it sounds when you only have one machine of each type of architecture/OS and don't want to dual boot)

root@frank xVM $ virt-install -n centy -r 512 --vcpus=1 --nographics --os-type=linux -p -f /dev/zvol/dsk/tank/xVM/centy -l http://www.mirrorservice.org/sites/mirror.centos.org/5.1/os/x86_64 -d

once its up it will drop you back to the shell prompt and tell you to reconnect for the domain console.

Just do

root@frank
xm console centy

to get a console connection and run through the normal install wizard from there.

run through install procedure as normal pulling everything down across the internet - it used to be much slower doing this when I used to install redhat across an ISDN connection - thank you broadband.

Solaris Server Setup Notes

Some notes from my solaris server setup - this has post has been sitting half drafted for a while while I tracked down an odd CIFS server and NFS speed issue on my network shares. Turned out to be due to cat5e cables getting trapped in my door and ending up at about Cat2.5 standard. (Don't run cat5 under/over three doors and expect to still be cat5 at the other end!) This weekend we might finally have to get round to running my network ports with trunking.

As I mentioned before I had hit memory remap issues with the mainboard I was using in my home server. Before Christmas I had ordered a new one (ASUS-P5B-VM) but never had the time to fit it. Yesterday I finally found the time and today I'm reinstalling the system - I've decided to just stick to the two 500GB sata drives I had in already but to loose the single 2.5 sata I was booting from.
First thing I had to do was enable the memory remap feature in the BIOS to allow the 64 bit OS to address all the memory.
I was going to use the gui to install but it didn't appear to give me enough control over reconfiguring my Solaris slices so I used a text console down the serial line.
As I mostly access the box down the serial line I also edited /boot/grub/menu.lst and uncommitted
serial --unit=0 --speed=9600
terminal serial
to allow me to select the boot options from grub on the serial line as well.

The new build detects my integrated network cards as an rge device which is nice as the old mainboard didn't. It's also a not a legacy driver so should be possible to be used with vlans or with xVM - which is nice as I now have three network cards in this machine.

bash-3.2# dladm show-link e1000g0 type: non-vlan mtu: 1500 device: e1000g0 rge0 type: non-vlan mtu: 1500 device: rge0 elxl0 type: legacy mtu: 1500 device: elxl0

All my storage was on my zfs file systems so I had to import using the -f flag like so:


bash-3.2# zpool import
pool: tank
id: 15184786189135037151
state: ONLINE
status: The pool was last accessed by another system. action:
The pool can be imported using its name or numeric identifier and
the '-f' flag. see: http://www.sun.com/msg/ZFS-8000-EY config:
tank ONLINE
mirror ONLINE c2d0s7 ONLINE c1d0s7 ONLINE

bash-3.2# zfs list
no datasets available

bash-3.2# zpool import -f 15184786189135037151


root@frank bin $ zfs list
NAME USED AVAIL REFER MOUNTPOINT
tank 264G 177G 21K /tank
tank/fs 224G 177G 22K /tank/fs
tank/fs/downloads 195G 177G 195G /tank/fs/downloads
tank/fs/home 20.4G 177G 156M /export/home
tank/fs/home/burt 20.3G 177G 11.8G /export/home/burt
tank/fs/home/burt@16-oct-2007 8.44G - 8.61G -
tank/fs/home/burt/groupWork 11.6M 177G 7.25M /export/home/burt/groupWork
tank/fs/home/burt/groupWork@17-oct-2007 4.15M - 4.15M -
tank/fs/home/burt/groupWork@28-nov-2007 160K - 4.86M -
tank/fs/pushy 1.33G 177G 1.33G /tank/fs/pushy
tank/fs/xVM 7.19G 177G 7.19G /tank/fs/xVM
tank/xVM 40.1G 177G 18K /tank/xVM
tank/xVM/bunty 20G 197G 16K -
tank/xVM/cupcake 3.24G 194G 2.70G -
tank/xVM/cupcake@installed 545M - 2.67G -
tank/xVM/fairycake 140M 177G 2.67G -
root@frank bin $


and my home dir, media, xVM machines, uni groupwork, are all back including mountpoints - all sitting happily onto of the mirror.

recreate my group and user and set the passwd:
bash-3.2# groupadd -g 501 burt
bash-3.2# useradd -u 501 -g burt -m -d /export/home/burt burt
bash-3.2# passwd burt

I figure I may as well install blastwave now as I usually end up wanting something from there at some point.

bash-3.2# pkgadd -d http://www.blastwave.org/pkg_get.pkg

edit /opt/csw/etc/pkg-get.conf to add a local mirror then get wget

bash-3.2# /opt/csw/bin/pkg-get -i wget

at that point you can install things from blastwave.org, It's not as good as apt-get but it is still dam useful if your looking for lots of utils and don't want to have to compile all from source.
Packages are installed in /opt/csw/bin so your PATH will need editing to make use of them.

after that All I needed to do was edit /boot/grub/menu.lst to select my preferred boot option of an xVM xen hypervisor so I'm in a dom0 (I have a few domU virtulised domains running as well which I use for testing)

I'ts worth noting at this point that if you use live upgrade later the /boot/grub/menu.list file only exits on your first Boot Environment (BE).

root@frank bin $ lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
build80 yes no no yes -
build81 yes yes yes no -

root@frank bin $ ls /boot/grub/menu.lst
/boot/grub/menu.lst: No such file or directory

As you can see I'm booted into build81 at the moment but menu.lst is not where you would expect.
If I mount the BE named build80 then I will find menu.lst on that partition.

root@frank bin $ lumount build80
/.alt.build80

root@frank bin $ ls /.alt.build80/boot/grub/menu.lst
/.alt.build80/boot/grub/menu.lst

So if you install a second BE later and cant find /boot/grub/menu.lst to edit, use lumount to mount it and edit.

This is why you shouldn't mess with you boot order in the BIOS when using live upgrade, even if you are using multiple disks.

Sharing is easy.

root@frank bin $ zfs set sharesmb=on tank/fs/downloads

for cifs shares

root@frank bin $ zfs set sharenfs=on tank/fs/downloads

for nfs shares.

Thats a brief overview of my server it has other stuff running on it - I'm attempting to get the mediatomb upnp server compiled but so far can only get it to compile without libmagic and it fails to correctly identify video media files when run - making it fairly useless at the moment.