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.




Friday, January 11, 2008

cheap mac mini

Been a while since I posted - I've been snowed under with course work and then christmas so haven't been near much more than my laptops - which I try not to break to much as I need them to work.

I stumbled across an unloved 1.66 Core Duo mac mini in the bargain bin of a PCworld. It was missing a power supply and remote and was a base spec with 512mb/70gb with a cdrw/dvd rom drive, it is also a bit yellow - but was going for £200. I immediately decided against buying it as I already have to many computers. A couple of days later I was back buying the thing - my self control is useless. A PSU cost me £30 from play.com and 2gb of ram cost £32 from crucial. Someone supplied me with a 1.83 CoreDuo so that got put in at the same time.

I installed the last licence of Leopard from my families 5 pack of leopard licences. Leopard comes with front row 2.0. A much improved Front Row interface with the added bonus of being able to use the Saphire plugin to make browsing media better. I installed Perian and flip4mac QuickTime components to allow Front Row to play video encoded with pretty much any codec.

Next I need to hook it up to my nfs shares on my Solaris box and it can browse all of my media.

The really nice thing about using front row 2 is that it can connect to other machines in the house to read from itunes collections (like an AppleTV does) means that I don't have to sync my itunes library to the Mini.

I have a script that I'm working on to automatically rip DVDs on insertion using handbrake cli but its still a bit rough round the edges.


Thursday, November 29, 2007

xVM Windows XP Hosts

I'm still playing around with xVM under build 76 of solaris though as I type build 77 is out to the general public.
I bought some more memory for my system to take it to 4GB to give me some head room to play with domUs, ZFS and SunRay only to find that my BIOS doesn't properly support 4GB. Currently the OS can only talk to 2900 or so MB - the rest has been appropriated by the BIOS. Now of course this being a 64bit OS the 32bit limitations don't apply - unfortunately the BIOS has no memory remap option for 64bit aware OSs I think the chipset does support it as far as I can tell but it looks like ASUS have not implemented it in the V3-P5945G BIOS - most annoying. I've ordered a new mainboard which should do the trick(at least if the BIOS manual I read is to be believed) When that turns up I will reinstall with build 77 - I'm hoping that my problems with biosdev might go away - but I'm not convinced.

Mainly I followed this guide for setting up my HVM domU but with a couple of bits and bobs I have gleaned from the very useful xvm-discuss@sun.com mailing list and the Release Notes have helped me get my XP domU up and running.

6612343
Setting:
set softcall_delay=0x100000
in /etc/system

and

root@frank / $ svccfg -s xvm/xend setprop config/default-nic="e1000g0"
root@frank / $ svcadm refresh xvm/xend
root@frank / $ svcadm restart xvm/xend

To confirm:

root@frank / $ svccfg -s xvm/xend listprop |grep default
config/default-nic astring e1000g0


to make sure it gets the correct network card (I now have two physical cards instead of two vlans to one card after working around my SunRay latency issue)

I also put this in my .hvm file to bridge the interface.

vif = ['mac=0:1b:21:4:b9:1, bridge=e1000g0']

Running the domain
root@frank xVM $ xm create windows-xVM.hmv

Then just vnc to the console, annoyingly Apples screen sharing vnc application doesn't work for connecting to the console session of a dom. Though this is almost definitely a limitation of the client not the server, as most other clients seem to work fine. On the Mac JollyFast VNC seems to be the best free client, vineViewer was a bit nicer but isn't free. vncviewer on Solaris works well as does xtightvncviewer on Ubuntu.

The install was not without some hitches - seemed to hang up and if I didn't have the vnc session open when it prompted for input the domain would get blocked, and I couldn't get back onto the vnc session. Installaition did take a while longer than expected as well.

I'm going to try and dig out some windows server disks at some point as well and give them a go to so I will try and monitor the performance more closely issues then.

Monday, November 19, 2007

Using Live Upgrade to move disks on x86 with a difficult bios

I'm attempting to move my disks around in my OpenSolaris Box - I have a pair of IDE 120Gb which at one point where mirrored using SVM - but I want to use them in another side project so I need to migrate my install from one IDE disk to the space I have left on the pair of SATA drives where my ZFS pool is (there is space left as I did at one point boot from the SATAs before I reinstalled to the IDEs)

First lucreate for a new BE
root@frank / $ lucreate -c b76a-ide -m /:/dev/dsk/c1d0s3:ufs -n b76a-sata

The lustatus to check whats going on:

root@frank / $ lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
b76a-ide yes yes yes Yes -
b76a-sata yes no no no -
root@frank / $

Excellent so I have a identical but relocated boot environment I can use - let luactivate it.

root@frank / $ luactivate b76a-sata



Saving latest GRUB loader.

Setting failsafe console to .

ERROR: No matching BIOS id found for:


ERROR: Cannot determine GRUB id for ABE disk

ERROR: Unable to determine the configuration of the target boot environment .

root@frank / $

Dam - I've hit this problem again. It seems to resolve around the way /sbin/biosdev reports my disks:

root@frank / $ sbin/biosdev

0x80 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0

0x81 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0

root@frank / $


These two disks are my IDEs - but I want to boot off the first SATA disk.

I'm not sure if this is a limitation of my BIOS or a problem with biosdev but what I have done is: (Ugly Hack time).
To get luactivate to work I need to cludge /sbin/biosdev to output something that will work.

I used the output of /sbin/biosdev -d to produce this

root@frank / $ cat /sbin/biosdev
#!/bin/sh
echo "0x80 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0"
echo "0x81 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0"
echo "0x82 /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0"
echo "0x83 /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0"
exit 0
root@frank / $

I installed grub on the other disk manually, specifying the slice solaris is on

root@frank / $ installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d0s3
Solaris boot partition inactive.
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 260 sectors starting at 50 (abs 16115)
root@frank / $

Then I mounted the new BE and copied menu.lst from my active boot enviorment on the IDE disk to the new SATA disk.
root@frank / $ lumount b76a-sata
/.
alt.b76a-sata
root@frank / cp /boot/grub/menu.lst /.alt.b76a-sata/boot/grub/menu.lst

Unmount the new BE and activate
root@frank / $ luumount b76a-sata
root@frank / $ luactivate b76a-sata

reboot and catch the bios and change the disk order to boot from the SATA disk.

Because the system is now hopelessly confused (a bit like me) about which disk is where so my /boot/grub/menu.lst was quite wrong it was attempting to use (hd3,0,d) as my boot slice for the sata dissk so I had to edit it manually at boot to point to (hd0,0,d) - and then once again edit the /boot/grub/menu.lst to match.

The reason for this editing is that I changed the order the disks are chosen from within the bios as otherwise it will continue to boot from the first IDE disk. Basically once the system comes up from the sata disk if I run the original biosdev i get this:

root@frank / $ /sbin/biosdev
0x82 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0
0x83 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
root@frank / $

Which are the SATA disks. lustatus shows the correct information as well now.
root@frank / $ lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
b76a-ide yes no no yes -
b76a-sata yes yes yes no -

At this point I pulled the IDE disks from the machine (ludelete is also confused because of incorrect biosdev info so wont delete them.) Though I forgot to fix my swap partition and the system failed to boot until I sorted that out. A quick vi session in /etc/vfstab to change the swap partition and the clear the error using svcadm:

root@frank / $ svcadm clear svc:/system/filesystem/local:default

There is some more fiddling to do in /boot/grub/menu.lst to fix the xVM entries and some nasty undocumented mucking around in /etc/lutab to remove the old ide entries but finally I'm back where I started but with a couple of IDE disks to play with ZFS on my mac. (now I need to find some IDE USB caddies)

As I side note I've finally found a use for the PIP (picture in picture) function on my Dell 24 Pannel - I attach a S-Video cable to the output of my graphics card so that I can fiddle with the bios on the server without swapping inputs - though serial redirection in the BIOS would be nicer.

I really miss OBP.

Friday, November 16, 2007

VLAN for the SunRay interconnect and performance issues

The Sun Ray in the living room has been getting terrible performance - its connected via a NetgearGSM7224 gigabit switch to my OpenSolaris box running build 76 which I recenlty upgraded with a new e1000g intel Gigabit NIC. utcapture was reporting 30% packet loss in some cases - which equates to bad performance.

So I've done a bit of tweaking and the SunRay and the Server now have a dedicated VLAN to themselves.

Its worth nothing that I did this via a serail console - network reconfiguration is hard to do over ssh unless your careful about the order you do things in!

Firstly I configured the switch - it has a gui or a cli but I was feeling lazy and used the gui.

Port24 (my servers port) is now tagged with vlan IDs of 999 and 1 (the default vlan)
Port7 (the sunray) is marked untagged as vlan ID 999

On the solaris box you can bring up vlan aware interfaces using
ifconfig e1000g1000 plumb 192.168.2.252 up
gives a vlan ID of 1
ifconfig e1000g999000 plumb
gives a vlan of 999

though if you want it permanently (like I do) you need to put the ip address in
/etc/hostname.e1000g1000
Though as I'm always going to need interfaces with tagged vlans to use the switch port from now on I will just move the files:
mv /etc/hostname.e100g /etc/hostname.e1000g1000

Next step is to setup the Sun Ray interconnect.

As my dns setup is somewhat lacking (its on the list) I had to set my /etc/hosts file to point my machine at my IP adress not the loopback 127.0.0.1
utadm seems to do a getent hosts and refuses to work untill this is configured correctly.
root@frank sbin $cat /etc/hosts
192.168.2.252 loghost frank

Using the manual I configured the SunRay interconnect for the pre-plumbed e1000g999000 VLAN aware interface.
root@frank sbin $ /opt/SUNWut/sbin/utadm -a e1000g999000

The defaults where fine for me in this case so I just hit Y to confirm and let it do its stuff.
and the system should configure a DHCP server running on your new vlan interface.

After that - the Sun Ray was up and running correctly - though not quite as quick as I feel it should have been. utcapture was still listing 30% packet loss on a regular basis

A bit of further investigation (google) found this forum posting. It seems to suggest that UDP traffic might be getting dropped by the switch because it can't send it to the SunRay fast enough. After playing around with the settings on the switch I discovered that setting the server switch port to 100 Full Duplex massively reduces the packet loss observed using utcapture.
The next stage will be to try a different network card and maybe a different switch for the SunRay interconnect to see if I can get better performance for the SunRay and still keep the Gigabit speed connection for my main connection to the server. I'll keep reading up on the switch to see if their is a way to adjust the way it handles UDP packets - but its only a Level 2 Netgear so I'm not convinced.

Thursday, November 8, 2007

Leopard 10.5 Notes

Adding OPML feeds to mail is not possible (at least not though an import opml import option) it can be done, but to put them all into a nice ordered way just seems like so much hassle compared to leaving them in Vienna!

It looks clean and crisper somehow - I guess thats the unified thing for you.

The Dock is annoying - the icons on the right are broken, they default to the first icon in the containing folder not the folder itself - just moronic. The active application white dot is hard to see on the reflective dock - and I'm not keen on the background reflection thing, I'd prefer the dock on the side in look if not function. I'm also used to long right clicking the icons to bring up a menu - with stacks its now a left click...

CoverFlow in the finder might actually be useful for the hundreds of .doc file my university bombards me with for every single communication.

Tabs in the terminal are ok, I prefer the shortcut for moving between them (Command + }/{) over gnome-terminals ctrl+PgUp/PgDwn. Still no middle click paste like X11 (hey I can dream)

NFS Network drives no longer seem to mount on the desktop - so not sure how I make alias for playing network content through front row just yet... alias or ln -s isn't working. But making an alias of a folder within the mount and moving t
hat to your movie folder seems to work. Front row is much better more responsive, and movie preview icons seem nice though they are no longer moving, which may be why its more responsive. Whenever you enter Front Row iTunes stops whatever its playing - random and annoying.

Finder overall seems snappier to me. (about time!)
ZFS read is here (not tested) - allegedly the beta
 ktexts where available from Apple Dev Connection
 at one point even apples command line prompt says so! - my brief search couldn't find them.