Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/build: run DragonflyBSD VMs on GCE? #23060

Open
bradfitz opened this Issue Dec 8, 2017 · 12 comments

Comments

Projects
None yet
4 participants
@bradfitz
Copy link
Member

bradfitz commented Dec 8, 2017

Looks like Dragonfly now supports virtio:

https://leaf.dragonflybsd.org/cgi/web-man?command=virtio&section=4

So it should run on GCE?

If somebody could prepare make.bash scripts to script the install to prepare bootable images, we could run it on GCE.

See the netbsd, openbsd, and freebsd directories as examples: https://github.com/golang/build/tree/master/env

(The script must run on Linux and use qemu to do the image creation.)

/cc @tdfbsd

@gopherbot gopherbot added this to the Unreleased milestone Dec 8, 2017

@gopherbot gopherbot added the Builders label Dec 8, 2017

@bradfitz

This comment has been minimized.

Copy link
Member Author

bradfitz commented Dec 9, 2017

@bradfitz

This comment has been minimized.

Copy link
Member Author

bradfitz commented Dec 9, 2017

In that thread, @rickard-von-essen says:

I have a working packer build of DragonFly BSD https://github.com/boxcutter/bsd.

The most interesting parts are the boot_command
https://github.com/boxcutter/bsd/blob/master/dragonflybsd.json#L5
and actual installer script https://github.com/boxcutter/bsd/blob/master/http/install.sh.dfly

@bradfitz

This comment has been minimized.

Copy link
Member Author

bradfitz commented Aug 7, 2018

/cc @dmitshur

@bradfitz

This comment has been minimized.

Copy link
Member Author

bradfitz commented Nov 2, 2018

Update: I just ran Dragonfly (5.2.2) at home on QEMU/KVM with virtio-scsi and virtio net and it works fine.

So it should work fine on GCE, of course (which we already heard).

At this point I'm thinking we should just do this builder "by hand" for now, with a readme file with notes. I'll prepare the image by hand, then shut it down and copy its disk to a GCE image. (uploading it as a sparse tarball)

We can automate it with expect or whatnot later. Perfect is the enemy of good, etc.

@bradfitz

This comment has been minimized.

Copy link
Member Author

bradfitz commented Nov 2, 2018

I shut down my KVM/QEMU instance, copied its disk to a new GCE image, and created a GCE VM. It kernel panics on boot (over serial) with:

panic() at panic+0x236 0xffffffff805f8666 
panic() at panic+0x236 0xffffffff805f8666 
vfs_mountroot() at vfs_mountroot+0xfe 0xffffffff80672c7e 
mi_startup() at mi_startup+0x84 0xffffffff805c2a64 
Debugger("panic")
CPU0 stopping CPUs: 0x0000000e
 stopped
Stopped at      Debugger+0x7c:  movb    $0,0xe67a49(%rip)
db> 

So, uh, not as easy as I'd hoped.

@bradfitz

This comment has been minimized.

Copy link
Member Author

bradfitz commented Nov 2, 2018

Perhaps if we already have to do the whole double virtualization thing for Solaris (#15581 (comment)) anyway, we could just reuse that mechanism to run Dragonfly in qemu/kvm under GCE.

@cnst

This comment has been minimized.

Copy link

cnst commented Dec 16, 2018

I've tried working on this earlier this year (back in 2018-02), and had it scripted to make the image automatically, but I had the same issue that it'd work on my machines with vanilla QEMU just fine, including with the disk being accessible on DFly through DragonFly's vtscsi(4) with a local QEMU as per the QEMU configuration magic described over at http://wiki.netbsd.org/tutorials/how_to_setup_virtio_scsi_with_qemu/, but it still wouldn't work on GCE with GCE's virtio_scsi. Is there any info on how GCE's virtio_scsi different from QEMU's virtio_scsi?

I've also tried running DragonFly BSD side by side with FreeBSD with CAMDEBUG, but it didn't seem to reveal anything obvious, although the underlying CAM logic does seem to be quite different, so, it's probably the one to blame. I didn't run out of ideas, but did ran out of time back in February, and recently my GCE credits ran out as well.

Nested virtualisation sounds interesting. Does it require Linux on GCE, or would FreeBSD also work?

@tuxillo

This comment has been minimized.

Copy link

tuxillo commented Feb 14, 2019

@cnst do you have instructions on how you tried DragonFly on GCE?

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Feb 15, 2019

Change https://golang.org/cl/162959 mentions this issue: dashboard, buildlet: add a disabled builder with nested virt, for testing

gopherbot pushed a commit to golang/build that referenced this issue Feb 15, 2019

dashboard, buildlet: add a disabled builder with nested virt, for tes…
…ting

This adds a linux-amd64 COS builder that should be just like our
existing linux-amd64 COS builder except that it's using a forked image
that has the VMX license bit enabled for nested virtualization. (GCE
appears to be using the license mechanism as some sort of opt-in
mechanism for features that aren't yet GA; might go away?)

Once this is in, it won't do any new builds as regular+trybot builders
are disabled. But it means I can then use gomote + debugnewvm to work
on preparing the other four image types.

Updates golang/go#15581 (solaris)
Updates golang/go#23060 (dragonfly)
Updates golang/go#30262 (riscv)
Updates golang/go#30267 (fuchsia)
Updates golang/go#23824 (android)

Change-Id: Ic55f17eea17908dba7f58618d8cd162a2ed9b015
Reviewed-on: https://go-review.googlesource.com/c/162959
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@tuxillo

This comment has been minimized.

Copy link

tuxillo commented Feb 17, 2019

I've tried myself and it seems DragonFly is unable to find the disk.
We're working on it already: https://bugs.dragonflybsd.org/issues/3175

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Feb 19, 2019

Change https://golang.org/cl/163057 mentions this issue: buildlet: change image name for COS-with-vmx buildlet

gopherbot pushed a commit to golang/build that referenced this issue Feb 19, 2019

buildlet: change image name for COS-with-vmx buildlet
The COS image I'd forked from earlier didn't have CONFIG_KVM or
CONFIG_KVM_INTEL enabled in its kernel, so even though I'd enabled the
VMX license bit for the VM, the kernel was unable to use it.

Now I've instead rebuilt the ChromiumOS "lakitu" board with a modified
kernel config:

   https://cloud.google.com/container-optimized-os/docs/how-to/building-from-open-source

More docs later. Still tinkering. Nothing uses this yet.

Updates golang/go#15581 (solaris)
Updates golang/go#23060 (dragonfly)
Updates golang/go#30262 (riscv)
Updates golang/go#30267 (fuchsia)
Updates golang/go#23824 (android)

Change-Id: Id2839066e67d9ddda939d96c5f4287af3267a769
Reviewed-on: https://go-review.googlesource.com/c/163057
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Feb 21, 2019

Change https://golang.org/cl/163301 mentions this issue: env/linux-x86-vmx: add new Debian host that's like Container-Optimized OS + vmx

gopherbot pushed a commit to golang/build that referenced this issue Feb 21, 2019

env/linux-x86-vmx: add new Debian host that's like Container-Optimize…
…d OS + vmx

This adds scripts to create a new builder host image that acts like
Container-Optimized OS (has docker, runs konlet on startup) but with a
Debian 9 kernel + userspace that permits KVM for nested
virtualization.

Updates golang/go#15581 (solaris)
Updates golang/go#23060 (dragonfly)
Updates golang/go#30262 (riscv)
Updates golang/go#30267 (fuchsia)
Updates golang/go#23824 (android)

Change-Id: Ib1d3a250556703856083c222be2a70c4e8d91884
Reviewed-on: https://go-review.googlesource.com/c/163301
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.