I have a new server, a DL120 G7.
I originally installed a standard NetBSD/amd64 6.1 on it; it's main purpose is to have lots of disk.
It currently has two physical disks which are mirrored using raidframe, since the built-in "simple" SATA raid controller won't serve disks larger than 2TB. For that reason, also, its bootblock is on a USB memory stick - boot.cfg and kernel etc are already read from RAID.
Lately, an extra use for it offered itself, so I:
- grabbed the NetBSD Xen Howto
- installed 6.1.2 (just out, get it while it's fresh)
- installed a XEN3_DOM0 kernel
- installed xenkernel42 and xentools42 (with its stately procession of dependencies. perl, python AND ocaml ..)
- added a Xen line to its boot.cfg (the man page has an example)
- rebooted to Xen. Lo and behold, a Xen dom0 (that was easy)
Since there's little point in a dom0 all by itself, on to preparing a guest:
Since it's a xen*42, /usr/pkg/share/examples/rc.d/ had xencommons, xend, xendomains and xen-watchdog; I copied these to /etc/rc.d and put xencommons=YES, xend=YES and xendomains="$guestname" into rc.conf.
I had partitioned the disk to reserve some space for potential package bulk building, and made these partitions into their extra raidframe instances. I now used one of these to turn raid3e into raid3a and a bit of swap.
newfs raid3a, mount it to /mnt, unpack sets and the XEN3_DOMU kernel to it, MAKEDEV in /mnt/dev and give /mnt/etc a few licks (normally one'd use sysinst for all of that), umount /mnt.
On to creating the Xen guest description file: I copied /usr/pkg/share/examples/xen/xmexample1 to /usr/pkg/etc/xen/$guestname, and ended up kicking out most of the entries. I retained kernel, memory, name, cpus, vcpus, vif and disk.
For vif, some more work on the dom0 was necessary: I created bridge0 and "brconfig bridge0 add"'ed the physical ethernet interface, set the bridge "up" and made it all reboot-safe.
xm create -c $guestname, some head-scratching, a correction of the disk line syntax (/var/log/xen/* had hints what it didn't like; it wanted: "disk = [ 'phy:/dev/raid3a,0x1,w' ]") and I had a running guest.
Some more administrative niceties like installing a few packages on it, making sure it knows where to send root mail, etc pp, and it's ready for business.
Things to find out some other time, for another guest: mount a partition of the dom0 readonly?
And todo (there is always at least one todo left): update the NetBSD Xen Howto to reflect the availability of xenkernel42 and xentools42.