OpenBSD/SPARC64 in a T1000 Logical Domain
Last updated: Fri, 24 Apr 2009 19:55:00 GMT
The intarnets held that the latest snapshot of OpenBSD was equipped to deal with LDom virtualisation. The intarnets were right.
I almost feel guilty writing this, it was such a walk in the park. No problems, no tricks, nothing to report except that It Just Works.
So, starting from the point where I left off with the Debian SPARC install, I had a second 8 vCPU guest domain with almost identical configuration. The only difference was that the zvol backing the domain's virtual disc was not fully-reserved.
Unsuprisingly, the OpenBSD documentation is good. The installation documentation is pretty thorough, too, but doesn't seem to cover my case -- my netboot infrastructure is DHCP-based, so I don't want to be messing around with RARP and bootparams just to get this out of bed. I played for a little while, realised I was going to have to unpack a filesystem somewhere and decided that I'd try a different tack.
The OpenBSD 4.5 snapshot I've got comes with a number of likely-looking candidate filesystem images. The miniroot45.fs image is the one I need. Can I present this as a working virtual disc to my domain?
trevor:~# ldm add-vdsdev options=ro,excl /trevor_concat_p0/openbsd/miniroot45.fs mrfs45@primary-vds0 trevor:~# ldm add-vdisk mrfs45 mrfs45@primary-vds0 ldg1
Yes, sir, I can.
So here's what my LDom configuration looks like now:
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv- SP 16 4G 0.5% 2d 13h 17m
SOFTSTATE
Solaris running
MAC
00:14:4f:be:ef:ba
HOSTID
0x4fbeefba
VCPU
VID PID UTIL STRAND
0 0 1.4% 100%
1 1 0.1% 100%
2 2 0.1% 100%
3 3 0.0% 100%
4 4 0.9% 100%
5 5 0.2% 100%
6 6 0.0% 100%
7 7 0.0% 100%
8 8 1.2% 100%
9 9 0.0% 100%
10 10 0.1% 100%
11 11 0.0% 100%
12 12 1.4% 100%
13 13 0.5% 100%
14 14 0.0% 100%
15 15 0.1% 100%
MAU
ID CPUSET
0 (0, 1, 2, 3)
1 (4, 5, 6, 7)
2 (8, 9, 10, 11)
3 (12, 13, 14, 15)
MEMORY
RA PA SIZE
0x8000000 0x8000000 4G
VARIABLES
keyboard-layout=US-English
nvramrc=." ChassisSerialNumber 4FBEEFBA " cr
security-#badlogins=4294967295
IO
DEVICE PSEUDONYM OPTIONS
pci@780 bus_a
pci@7c0 bus_b
VCC
NAME PORT-RANGE
primary-vcc0 6969-6996
VSW
NAME MAC NET-DEV DEVICE DEFAULT-VLAN-ID PVID VID MODE
primary-vsw0 00:14:4f:be:ef:de aggr1 switch@0 1 1
VDS
NAME VOLUME OPTIONS MPGROUP DEVICE
primary-vds0 zdisk0 excl /dev/zvol/dsk/trevor_concat_p0/vols/ldg0_root
zdisk1 excl /dev/zvol/dsk/trevor_concat_p0/vols/ldg1_root
mrfs45 ro,excl /trevor_concat_p0/openbsd/miniroot45.fs
VLDC
NAME
primary-vldc0
primary-vldc3
VLDCC
NAME SERVICE DESC
ds primary-vldc0@primary domain-services
vldcc1 primary-vldc0@primary ldmfma
vldcc2 SP spfma
VCONS
NAME SERVICE PORT
SP
------------------------------------------------------------------------------
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
ldg0 active -n---- 6969 8 1536M 0.0% 1d 18h 41m
SOFTSTATE
Linux running
MAC
00:14:4f:be:ef:d7
HOSTID
0x4fbeefd7
VCPU
VID PID UTIL STRAND
0 16 0.0% 100%
1 17 0.0% 100%
2 18 0.0% 100%
3 19 0.0% 100%
4 20 0.0% 100%
5 21 0.0% 100%
6 22 0.0% 100%
7 23 0.0% 100%
MAU
ID CPUSET
4 (16, 17, 18, 19)
5 (20, 21, 22, 23)
MEMORY
RA PA SIZE
0x8000000 0x108000000 1536M
VARIABLES
auto-boot?=true
boot-device=disk
NETWORK
NAME SERVICE DEVICE MAC MODE PVID VID
vnet0 primary-vsw0@primary network@0 00:14:4f:be:ef:62 1
DISK
NAME VOLUME TOUT DEVICE SERVER MPGROUP
vdisk0 zdisk0@primary-vds0 disk@0 primary
VLDCC
NAME SERVICE DESC
ds primary-vldc0@primary domain-services
VCONS
NAME SERVICE PORT
ldg0 primary-vcc0@primary 6969
------------------------------------------------------------------------------
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
ldg1 active -n---- 6996 8 1536M 18% 12h 29m
SOFTSTATE
OpenBSD running
MAC
00:14:4f:be:ef:a1
HOSTID
0x4fbeefa1
VCPU
VID PID UTIL STRAND
0 24 16% 100%
1 25 26% 100%
2 26 6.7% 100%
3 27 9.5% 100%
4 28 26% 100%
5 29 5.1% 100%
6 30 5.0% 100%
7 31 60% 100%
MAU
ID CPUSET
6 (24, 25, 26, 27)
7 (28, 29, 30, 31)
MEMORY
RA PA SIZE
0x8000000 0x168000000 1536M
VARIABLES
auto-boot?=true
boot-device=disk
NETWORK
NAME SERVICE DEVICE MAC MODE PVID VID
vnet1 primary-vsw0@primary network@0 00:14:4f:be:ef:c2 1
DISK
NAME VOLUME TOUT DEVICE SERVER MPGROUP
vdisk1 zdisk1@primary-vds0 disk@0 primary
mrfs45 mrfs45@primary-vds0 disk@1 primary
VLDCC
NAME SERVICE DESC
ds primary-vldc0@primary domain-services
VCONS
NAME SERVICE PORT
ldg1 primary-vcc0@primary 6996
With the logical domain configured this way, I have two virtual discs available to me at the fake PROM. It's just a case of booting off the installation miniroot, like so:
{0} ok boot mrfs45
Boot device: /virtual-devices@100/channel-devices@200/disk@1 File and args:
OpenBSD IEEE 1275 Bootblock 1.1
..>> OpenBSD BOOT 1.3
Trying bsd...
Booting /virtual-devices@100/channel-devices@200/disk@1:a/bsd
3396312@0x1000000+3368@0x133d2d8+3255064@0x1800000+939240@0x1b1ab18
symbols @ 0xfedee240 65 start=0x1000000
console is /virtual-devices@100/console@1
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2009 OpenBSD. All rights reserved. http://www.OpenBSD.org
OpenBSD 4.5-current (RAMDISK) #30: Sat Apr 18 03:11:44 MDT 2009
deraadt@sparc64.openbsd.org:/usr/src/sys/arch/sparc64/compile/RAMDISK
real mem = 1610612736 (1536MB)
avail mem = 1543274496 (1471MB)
mainbus0 at root: Sun Fire(TM) T1000
cpu0 at mainbus0: SUNW,UltraSPARC-T1 (rev 0.0) @ 1000 MHz
"SUNW,UltraSPARC-T1" at mainbus0 not configured
"SUNW,UltraSPARC-T1" at mainbus0 not configured
"SUNW,UltraSPARC-T1" at mainbus0 not configured
"SUNW,UltraSPARC-T1" at mainbus0 not configured
"SUNW,UltraSPARC-T1" at mainbus0 not configured
"SUNW,UltraSPARC-T1" at mainbus0 not configured
"SUNW,UltraSPARC-T1" at mainbus0 not configured
vbus0 at mainbus0
"flashprom" at vbus0 not configured
"ncp" at vbus0 not configured
vcons0 at vbus0: ivec 0x111
cbus0 at vbus0
vnet0 at cbus0 chan 0x0: ivec 0x200, 0x201, address 00:14:4f:be:ef:c2
vdsk0 at cbus0 chan 0x2: ivec 0x204, 0x205
scsibus0 at vdsk0: 2 targets
sd0 at scsibus0 targ 0 lun 0: <SUN, Virtual Disk, 1.0> SCSI3 0/direct fixed
sd0: 12288MB, 512 bytes/sec, 25165824 sec total
vdsk1 at cbus0 chan 0x3: ivec 0x206, 0x207
scsibus1 at vdsk1: 2 targets
sd1 at scsibus1 targ 0 lun 0: <SUN, Virtual Disk, 1.0> SCSI3 0/direct fixed
sd1: 2MB, 512 bytes/sec, 5120 sec total
vrtc0 at vbus0
rd0: fixed, 6144 blocks
bootpath: /virtual-devices@100,0/channel-devices@200,0/disk@1,0
root on rd0a swap on rd0b dump on rd0b
erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell? I
Welcome to the OpenBSD/sparc64 4.5 install program.
This program will help you install OpenBSD. At any prompt except password
prompts you can escape to a shell by typing '!'. Default answers are shown
in []'s and are selected by pressing RETURN. At any time you can exit this
program by pressing Control-C, but exiting during an install can leave your
system in an inconsistent state.
As Elzar would say, "BAM!"
Don't get excited kids, this thing's got heart-shaped nostrils. Want to see it make a star?
It's plain sailing from here on in. Make sure you pick the right disc to partition. In this configuration, it's sd0, because the miniroot is sd1. But, that said, it'd be safe to make a mistake, because the miniroot device is read-only.
OpenBSD asks you if you want to start sshd after reboot. Sensible! You don't need it, though, because the serial console works anyway, just as it should.
I love it when a plan comes together.