Skip to content

Instantly share code, notes, and snippets.

View mgerdts's full-sized avatar

Mike Gerdts mgerdts

View GitHub Profile
@mgerdts
mgerdts / zonecfg.md
Created January 23, 2018 23:50
bhyve zone config
create -b
set zonepath=/zones/b2
set brand=bhyve
set autoboot=false
set limitpriv=default
set ip-type=exclusive
set uuid=fc0fbfdb-dbf6-c26d-9a5e-b20099b5ecf7
add net
set allowed-address=172.26.17.202
X-Gmail-Received: cd1f5334be7e07c5ae660415a92dd8d7db52e9a8
Delivered-To: mgerdts@gmail.com
Received: by 10.90.82.20 with SMTP id f20cs699047agb;
Mon, 11 Sep 2006 16:46:36 -0700 (PDT)
Received: by 10.70.46.1 with SMTP id t1mr7121092wxt;
Mon, 11 Sep 2006 16:46:15 -0700 (PDT)
Return-Path: <zfs-discuss-bounces@opensolaris.org>
Received: from mail.opensolaris.org (oss-mail1.opensolaris.org [72.5.123.71])
by mx.gmail.com with ESMTP id h18si9496273wxd.2006.09.11.16.46.08;
Mon, 11 Sep 2006 16:46:15 -0700 (PDT)
@mgerdts
mgerdts / README.md
Created October 18, 2019 11:56
Triton on Linux KVM

Triton on Linux KVM

I have a beefy Linux box that I use for development. One of the things this box does is run KVM instances that run a Triton headnode and several compute nodes.

Configuration

Networking

I have a single gigabit link to the outside world. All networks are able to reach the outside world via NAT.

@mgerdts
mgerdts / illumos-to-linux.md
Last active September 18, 2020 10:38
illumos to Linux observations

These are initially notes to myself about the things I had to look up while taking on a Linux project after a taking a decade or two hiatus from Linux to focus on Solaris, SmartOS, and illumos. Following my footsteps may find this useful.

systemd

This is the init system replacement, like SMF was for Solaris.

Equivalent of svcs

# systemctl list-unit-files
@mgerdts
mgerdts / README.md
Last active June 16, 2020 20:55
Upgrade cloud-init on CentOS 6

This shows how to upgrade cloud-init from the one found in the early CentOS 6 bhyve images and create a new image from that.

Create a source instance

First, we will install an instance using image 11891f44-a374-11e8-9c35-c7bfcc724881.

The vmadm payload

{

This describes Mike Gerdts' suggestion for how to complete the work on OS-6632. It is an expansion of this comment.

Overview

The OS-6632 branch has a prototype fix that demonstrates that it is possible for the guest to recognize disk size changes when a zvol changes size. To detect the size change, the bhyve process has an mevent that fstat()s each virtio-blk device

@mgerdts
mgerdts / README.md
Last active February 19, 2020 15:56

This records my configuration of a host used for Linux CN development. The host is a relatively current Intel box with 64 GiB of RAM. It is running Fedora 30.

Virtualization on the host

QEMU/KVM

I had initially gone down the route of using QEMU/KVM and this worked pretty well except:

  • SmartOS CNs were unable to run bhyve instances. This is problematic for testing unrelated to the Linux CN project.
  • debian-live CNs were unable to use MACVLAN in their nspawn configuration to bridge to my office network. Watching traffic generated by the container using MACVLAN, I could see that DHCP requests would make it to the DHCP server. The responses were seen on the Fedora 30 host but not in the debian-live guest. No amount of mucking about or googling lead to a solution.
@mgerdts
mgerdts / README.md
Last active January 29, 2020 20:13
Colapse Confirmed

Collapse Confirmed

This user script may be used with Tamper Monkey or similar to add a "Collapsed Confirmed" button to github pull requests.

Why is this needed?

I have observed:

  • Large PRs can generate hundreds of comment threads.
  • There is no good for the submitter to mark "ok, I've done the work" and for the commenter to say "yep, looks good now".
@mgerdts
mgerdts / lvn.md
Created December 9, 2019 20:42 — forked from mtds/lvn.md
Linux Virtual Networking

Virtual Networking on Linux

In the Linux Kernel, support for networking hardware and the methods to interact with these devices is standardized by the socket API:

                +----------------+
                |   Socket API   |
                +-------+--------+
                        |
User space              |
@mgerdts
mgerdts / README.md
Last active December 6, 2019 14:54
ipxe silently truncates boot module arguments

When SmartOS is pxe booted in a Triton cloud, the kernel args are on the order of 200 bytes, there is a kernel, a ramdisk, and at least one other boot module. This does not fit in 512 bytes and multiboot.c silently truncates the url to the boot module and does not have any space for the name of the boot module. If a system is booted with a non-Joyent ipxe, this means that the SmartOS instance cannot find the boot module.

This probblem was recognized and fixed many years ago and Joyent fixed it in our fork of ipxe. Can this be included upstream so that boot modules are more useful?

Related tickets I've filed at Joyent are:

  • OS-3770 ipxe silently truncates boot module arguments
  • OS-8062 boot modules appear at wrong path (I think I got the buffer details wrong in that ticket,