Skip to content

Instantly share code, notes, and snippets.

View mgerdts's full-sized avatar

Mike Gerdts mgerdts

View GitHub Profile
@mgerdts
mgerdts / no-666.patch
Last active December 31, 2017 05:10
OS-XXX sdev plugin should not force number of the beast
commit efd2c605947a09c8c641ec66ec327082fa62f239
Author: Mike Gerdts <mike.gerdts@joyent.com>
Date: Sat Dec 30 05:18:57 2017 +0000
OS-XXX sdev plugin should not force number of the beast
diff --git a/usr/src/uts/common/fs/dev/sdev_plugin.c b/usr/src/uts/common/fs/dev/sdev_plugin.c
index dd81a52..58f7256 100644
--- a/usr/src/uts/common/fs/dev/sdev_plugin.c
+++ b/usr/src/uts/common/fs/dev/sdev_plugin.c
@mgerdts
mgerdts / b2.md
Created January 6, 2018 18:22
bhyve tantalizer
[root@emy-17 ~]# zoneadm -z b2 halt
[root@emy-17 ~]# zonecfg -z b2 info brand
brand: bhyve
[root@emy-17 ~]# uname -a
SunOS emy-17 5.11 joyent_20171230T062027Z i86pc i386 i86pc
[root@emy-17 ~]# zoneadm -z b2 boot; zlogin -C b2

Then grub appears

@mgerdts
mgerdts / README.md
Created January 25, 2018 19:35
nvlist from xml
@mgerdts
mgerdts / README.md
Last active February 2, 2018 17:53
cloud-init 1746605 DataSourceSmartOS needs locking and retries

Pass

A successful run generates a bit of noise due to killing the child process. I'm not sure, what, if anything to do about that.

test_all_keys (tests.unittests.test_datasource.test_smartos.TestSerialConcurrency) ... Cloud-init 17.2 received SIGTERM, exiting...
  Filename: /usr/lib64/python2.7/subprocess.py
  Function: _eintr_retry_call
  Line number: 478
    Filename: /usr/lib64/python2.7/subprocess.py
@mgerdts
mgerdts / reopen.patch
Created February 7, 2018 12:33
cloud-init retry serial open
diff --git a/cloudinit/sources/DataSourceSmartOS.py b/cloudinit/sources/DataSourceSmartOS.py
index 32655131..b1676f92 100644
--- a/cloudinit/sources/DataSourceSmartOS.py
+++ b/cloudinit/sources/DataSourceSmartOS.py
@@ -28,6 +29,7 @@ import os
import random
import re
import socket
+import time
@mgerdts
mgerdts / README.md
Last active February 22, 2018 05:18
false sharing

Baseline

  • Non-debug
  • dev-bhyve branch with this as last commit:
    commit dc994c4720f1b6cbd88011c5de076e580a8deeab
    Author: Mike Gerdts <mike.gerdts@joyent.com>
    Date:   Thu Feb 15 21:40:29 2018 +0000
    
        OS-6558 cleanup to match master push
    

Snapshot Space Requirements

Snapshot space accounting is tricky. This document demonstrates that.

Space required to take a snapshot

If there is not enough available space to meet the snapshot's space requirements, zfs snapshot [-r] <dataset>@<snapname> will fail with ENSOPC. Simple, right? Not so much.

@mgerdts
mgerdts / plan.md
Last active August 27, 2018 18:51
bhyve ring buffer

Current implementation

The current vmm trace ring buffer implementation is in vmm_sol_dev.c. There is one global ring buffer with a maximum size of 1 MB. Each message in the ring buffer is 280 bytes, allowing 3744 messages in the buffer.

> ::sizeof vmm_trace_dmsg_t |=D
                280
> ::print -t vmm_trace_dmsg_t
vmm_trace_dmsg_t {
 timespec_t timestamp {
@mgerdts
mgerdts / README.md
Created March 7, 2018 22:19
In process brand hooks
@mgerdts
mgerdts / README.md
Last active October 8, 2018 14:18
Fix console on ubuntu images

Redirect Ubuntu Console to First Serial Port

The cloud images that Canonical provides has the grub and linux console on the VGA port. This doesn't work so well for bhyve, where the graphical console only works with uefi. This document describes how to fix that using SmartOS.

Select a source image

The source image needs to include cloud-init 18.3 or later. Any Ubuntu 16.04 or later image produced by Canonical starting in July, 2018 should fit this criteria. The image in this example is described as Ubuntu 18.04.1 LTS (20180808 64-bit). Certified Ubuntu Server Cloud Image from Canonical..

src_uuid=96768413-88a7-43d6-867b-d74284d616d6