Compute Engine now supports custom OSes [1], so I've been working on
getting OpenBSD working on it.  I thought I'd share a status update.

[1] 
http://googlecloudplatform.blogspot.com/2013/12/google-compute-engine-is-now-generally-available.html

** virtio-scsi

Compute Engine exposes disks as virtio-scsi devices, whereas OpenBSD
currently only supports virtio-blk disks.  I've got a mostly working
virtio-scsi driver (WIP: https://codereview.appspot.com/33540044), but
I still need to polish it a bit.

One complication is Compute Engine advertises excessively large virtio
queues: e.g., 32k CCBs for virtio-scsi and 16k deep tx and rx queues
for virtio-net.  This seems to push the limit of how many dmamaps we
can pre-allocate, so for now I'm still pre-allocating DMA memory for
all the virtio-scsi CCBs but lazily allocating dmamaps as needed.
This allows things to work, but it seems fragile.

** networking

The network environment is a bit goofy: the DHCP server will assign an
IP and netmask like 10.240.93.65/255.255.255.255, and then specify the
default gateway as 10.240.0.1.  On Linux, ISC's DHCP client special
cases the netmask==255.255.255.255 case by adding a direct route like
"route add 10.240.0.1 dev eth0" before running "route add default
10.240.0.1".

However, I can't seem to reproduce this behavior on OpenBSD.  I'd
expect something like "route add 10.240.0.1 -iface 10.240.93.65" to
work, but the network stack never ARP resolves 10.240.0.1 so packets
just drop instead.

My current workaround is to instead override the netmask as
255.255.0.0 so the network stack realizes it can directly contact
10.240.0.1, and then I add additional routes so that other 10.240/16
addresses (e.g., other VM instances) are still routed via 10.240.0.1.


So with those two hacky workarounds in place, I've successfully
started OpenBSD on Compute Engine (dmesg below) and been able to SSH
into it.


OpenBSD 5.4-current (GENERIC.MP) #43: Wed Nov 27 22:36:26 PST 2013
    matt...@bento.dempsky.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4009746432 (3823MB)
avail mem = 3894853632 (3714MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xfd990 (12 entries)
bios0: vendor Google version "Google" date 01/01/2011
bios0: Google Google
acpi0 at bios0: rev 0
acpi0: sleep states S3 S4 S5
acpi0: tables DSDT FACP SSDT APIC
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
acpiprt0 at acpi0: bus 0 (PCI0)
mpbios0 at bios0: Intel MP Specification 1.4
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Xeon(R) CPU @ 2.60GHz, 2600.35 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,x2APIC,POPCNT,AES,NXE,LONG,LAHF
cpu0: smt 0, core 0, package 0
cpu0: apic clock running at 1000MHz
mpbios0: bus 0 is type PCI
mpbios0: bus 1 is type ISA
ioapic0 at mainbus0: apid 0 pa 0xfec00000, version 11, 24 pins
pci0 at mainbus0 bus 0
pcib0 at pci0 dev 1 function 0 "Intel 82371AB PIIX4 ISA" rev 0x03
piixpm0 at pci0 dev 1 function 3 "Intel 82371AB Power" rev 0x03: SMBus disabled
virtio0 at pci0 dev 3 function 0 "Qumranet Virtio SCSI" rev 0x00:
Virtio SCSI host Device
vioscsi0 at virtio0: qsize 32768
scsibus0 at vioscsi0: 253 targets
sd0 at scsibus0 targ 1 lun 0: <Google, PersistentDisk, > SCSI4 0/direct fixed
sd0(vioscsi0:1:0): Check Condition (error 0x70) on opcode 0x1b
    SENSE KEY: No Additional Sense
sd0: 10240MB, 512 bytes/sector, 20971520 sectors
sd0(vioscsi0:1:0): Check Condition (error 0x70) on opcode 0xa0
    SENSE KEY: No Additional Sense
virtio0: apic 0 int 11
virtio1 at pci0 dev 4 function 0 "Qumranet Virtio Network" rev 0x00:
Virtio Network Device
vio0 at virtio1: address 42:01:0a:f0:5d:41
virtio1: apic 0 int 11
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: console
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
nvram: invalid checksum
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
sd0(vioscsi0:1:0): Check Condition (error 0x70) on opcode 0x1b
    SENSE KEY: No Additional Sense
root on sd0a (bd2b1320d2a54646.a) swap on sd0b dump on sd0b
sd0(vioscsi0:1:0): Check Condition (error 0x70) on opcode 0x1b
    SENSE KEY: No Additional Sense
sd0(vioscsi0:1:0): Check Condition (error 0x70) on opcode 0x1b
    SENSE KEY: No Additional Sense
sd0(vioscsi0:1:0): Check Condition (error 0x70) on opcode 0x1b
    SENSE KEY: No Additional Sense
clock: unknown CMOS layout

Reply via email to