Skip to content

Instantly share code, notes, and snippets.

View mgerdts's full-sized avatar

Mike Gerdts mgerdts

View GitHub Profile
@mgerdts
mgerdts / smartos.md
Last active October 8, 2018 16:20
Hints

What source code went into this OS build?

> gitstatus_start/s
gitstatus_start:
gitstatus_start:[
    {
        "repo": "smartos-live",
        "branch": "hacks",
        "commit_date": "1538755931",
@mgerdts
mgerdts / README.md
Last active July 26, 2024 17:12
Install windows with bhyve

These are bare-bones instructions for creating a Windows image for bhyve on SmartOS. You will need a platform image that has the fix for OS-7117. Platform images that I've used in testing are here: iso tgz usb

Create a volume that will be the disk.

zfs create -o volblocksize=4k -V 16g -s zones/hdd-windows

This script will be used for booting from the CD.

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 February 22, 2018 05:18
false sharing

Baseline

  • Non-debug
  • dev-bhyve branch with this as last commit:
    commit dc994c4720f1b6cbd88011c5de076e580a8deeab
    Author: Mike Gerdts <[email protected]>
    Date:   Thu Feb 15 21:40:29 2018 +0000
    
        OS-6558 cleanup to match master push
    
@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 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 / README.md
Created January 25, 2018 19:35
nvlist from xml
@mgerdts
mgerdts / README.md
Last active September 17, 2024 13:05
bhyve on SmartOS

Introduction

The following options that aren't in the kvm brand should work:

  • com1, com2
    • Can be set to tty-like devices or socket,/some/path.
    • If both are unset, com1 defaults to /dev/zconsole and com2 defaults to /tmp/vm.ttyb.
  • bootrom
    • Should be set to /usr/share/bhyve/BHYVE_UEFI.fd or /usr/share/bhyve/BHYVE_UEFI_CSM.fd
  • Defaults to /usr/share/bhyve/BHYVE_UEFI_CSM.fd