Skip to content

Instantly share code, notes, and snippets.

View mgerdts's full-sized avatar

Mike Gerdts mgerdts

View GitHub Profile

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 / 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 / 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 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
@mgerdts
mgerdts / 0-coal-setup.md
Last active November 1, 2018 21:07
coal and docker and a particular version
@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

{
@mgerdts
mgerdts / 1-guest-images.md
Last active January 7, 2019 18:22
bhyve docs

Bhyve Machine Images

Each bhyve virtual machine (guest) uses a machine image. A machine image is sometimes called a guest image. Bhyve machine images are quite similar to KVM machine images. In fact, it is sometimes possible to create hybrid images that work with bhyve or KVM.

Bhyve is different from KVM in a few ways that are quite relevant to machine images. In particular:

  • Bhyve supports UEFI and emulates legacy BIOS via a Compatibility Support Module (CSM). The CSM is not as full-featured as SeaBIOS used with KVM.
  • Network configuration via a per-instance DHCP server is not supported.

The following sections describe the relevance of these differences and how to overcome them in many cases.

@mgerdts
mgerdts / README.md
Last active January 3, 2019 17:27
zfs-raw-recv-panic

The panic is seen on Linux. Screenshots of the panic: 1 2 3

I built ZoL on xubuntu 18.04 with this commit at the tip.

I suspect the clones difference between @7 and @8 is due to the interrupted receive.

root@xubuntu:~# zfs get -o property,value all rpool/crypto/vol0@7  > /tmp/7
root@xubuntu:~# zfs get -o property,value all rpool/crypto/vol0@8  > /tmp/8
root@xubuntu:~# sdiff  /tmp/7 /tmp/8
@mgerdts
mgerdts / changes.txt
Created May 14, 2019 14:34
debugging bhyve with mdb from host
commit 2d1a8a4a97fe44c06e3fedddbb32f89fc2755a3e
Author: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Date: Tue Jan 15 16:29:40 2019 +0100
OS-7508 mdb: assertion tripped in libvmm when bhyve VM halts while mdb is attached
OS-7519 mdb: bhyve target can attach before the first vCPU is configured
commit 2a78db82bec123064d30d051995cb4d577ca04ba
Author: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Date: Wed Feb 13 16:08:32 2019 +0000
@mgerdts
mgerdts / README.md
Created June 12, 2019 14:36
building illumos on omnios