Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mgerdts's full-sized avatar

Mike Gerdts mgerdts

View GitHub Profile
@mgerdts
mgerdts / README.md
Last active September 12, 2023 16:08
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.

@mgerdts
mgerdts / design.md
Last active April 4, 2023 11:35
Degraded Lvols

Logical Volumes with Missing External Snapshots

The original design of external snapshots allows esnap clone lvols to successfully open before the external snapshot is present. A logical volume with a missing external snapshot is referred to as degraded. It was done this way because:

  1. It is hard for the SPDK administrator to control the order that examine_config callbacks will be called.
  2. The consumer of an esnap clone may not actually need to perform reads from the external snapshot because the clusters containing the requested blocks may have already been allocated in the esnap clone's blob.
  3. Esnap clones may be at the root of a deep tree of snapshots and clones. It would be complex to delay the online of all of these until the external snapshot is available.
  4. Immediate registration of bdevs simplifies management of degraded lvols.
    1. bdev_get_bdevs allows degraded lvols to be seen. The module-specific section indicates when it is degraded.
  5. bdev_lvol_delete allows degraded esnap c
@mgerdts
mgerdts / gerrit-margin-fix.js
Created February 13, 2023 05:05
Workaround for Gerrit bug 16113
// ==UserScript==
// @name Gerrit margin fix
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Workaround https://bugs.chromium.org/p/gerrit/issues/detail?id=16113
// @author Mike Gerdts <mgerdts@nvidia.com>
// @match https://*/gerrit/q/*
// @match https://*/gerrit/dashboard/self
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant none
@mgerdts
mgerdts / README.md
Last active January 24, 2023 17:15
SPDK check_so_ver tests

Configure abi test builds

In a checked out spdk repo:

. test/common/config/pkgdep/git
INSTALL_REFSPDK=true install_sources

After this, two new directories should exist:

@mgerdts
mgerdts / README.md
Created January 23, 2023 18:29
Prevent accidental squash during merge fixup

I've found that git rebase -i $some_commit and adding break lines is very handy for fixing up things in an earlier commits. I then sometimes use x ./check after each subsequent commit to quickly identify any breakage in the commit where it happens.

After each fixup due to break or x, I need to run:

git commit --amend -a
git rebase --continue

If the rebase stops because there is a merge conflict that I need to fix, the proper thing to do is:

@mgerdts
mgerdts / pathodon.md
Created November 25, 2022 05:32
Pathodon idea

Pathodon

This is a proposal for a social network optimized for hiking, walking, trekking and other forms of ambling through nature. It is intended to be a participant in ActivityPub Fediverse. In particular, things shared on Pathodon should look great on Mastodon and Mastodon users should be able to interact with Pathodon users as naturally as they the interact with other Mastodon users.

The key things that set Pathodon apart from Mastodon are:

  • Support GPS traces (e.g. GPX) to let others know about trails and to be able to follow others in a very literal sense.
  • Encourage the use of consistent, geographically significant hashtags for meaningful follows.
  • Geographic search to find recent activity in a region of interest
  • Use of OpenStreetMap (OSM) and curation of trails and related OSM data.

This originally appeared in this slack message.

I've implemented your latest suggestions, which I think will work out ok. I'll push to gerrit shortly. I also hacked up a version to compare mutex and spinlock performance. With each thread taking the lock 50,000 times, the mutex takes 4% longer (non-debug, no asan, no ubsan) when the threads get fair access to the lock.

Starting test contend_spin
  Worker    Delay  Wait us  Hold us Total us
       0        3   251971   153829   405801
       1        5   151200   253713   404914
PASS test contend_spin

Blobstore External Snapshots Design {#blob_esnap_design}

Terminology

External snapshots provide a way for a blob to be a clone of storage that exists outside of the blobstore. This document describes the design of this feature.

@mgerdts
mgerdts / README.md
Last active January 13, 2022 16:14
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
@mgerdts
mgerdts / chainload.md
Created February 12, 2020 21:19
ipxe chainload from qemu built-in to Joyent

I have a box running Fedora, which runs a bunch of VMs. I want to iPXE boot using a larger ipxe script than is allowed by the ipxe that is embedded in qemu's virtual nic. That is, a VM is booting with iPXE but not the right ipxe.

Let's consider two VMs, debian10 and debian-live-ipxe. The DHCP server is running debian10, the other is pxe booting.

The procedure followed is roughly:

Grab the .tar.gz from the manta directory mentioned by /Joyent_Dev/public/builds/ipxe/master-latest.

Copy boot/undionly.kpxe from that archive to /tftpboot/.