Skip to content

Instantly share code, notes, and snippets.

@blackwood821
blackwood821 / zfs_vol_usage.md
Last active September 8, 2022 21:47
ZFS volume usage

I have two Debian 10 bhyve VMs on the same Triton CN both with the same package.

Here is the package which shows a disk quota of 50 GB:

[root@headnode (us-west-agc) ~]# sdc-papi /packages?name=bhyve-flexible-2G-50G-2CPU | json -Ha
{
  "brand": "bhyve",
  "name": "bhyve-flexible-2G-50G-2CPU",
  "version": "1.0.0",
  "active": true,
[ Jun 10 16:14:59 Method "start" exited with status 0. ]
[ Jun 30 05:48:54 Stopping because service disabled. ]
[ Jun 30 05:48:54 Executing stop method ("/lib/svc/method/svc-forwarding stop ipv4"). ]
[ Jun 30 05:48:54 Method "stop" exited with status 0. ]
[ Jun 30 06:02:48 Disabled. ]
[ Jun 30 06:03:02 Rereading configuration. ]
[ Jun 30 06:03:14 Rereading configuration. ]
[ Jul  5 13:34:53 Enabled. ]
[ Jul 5 13:34:53 Executing start method ("/lib/svc/method/svc-forwarding start ipv4"). ]
@blackwood821
blackwood821 / file.md
Created April 27, 2022 20:19
NUC 10 Triton CN Error
Subject: Fault Management Event: cn01:PCIEX-8000-1P
Content-Length: 806

SUNW-MSG-ID: PCIEX-8000-1P, TYPE: Fault, VER: 1, SEVERITY: Major
EVENT-TIME: Wed Apr 27 20:16:44 UTC 2022
PLATFORM: NUC10i7FNH, CSN: G6FN13500H2K, HOSTNAME: cn01
SOURCE: eft, REV: 1.16
EVENT-ID: faa6bdd1-82ae-eb4a-dd7c-d1eb797968b7
DESC: Either the transmitting device sent an invalid request or the receiving device is reporting an internal fault.

Here is the fabric NIC on a Debian 10 bhyve VM on cn01:

root@k8s-worker-2:~# netstat -nr | head -2; netstat -nr | grep 192.168.1
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.128.0   0.0.0.0         255.255.252.0   U         0 0          0 net1

Here's the full routing table:

[root@headnode (neptune) ~]# mail
From noaccess@headnode.chadschmelter.com Fri Apr  8 15:09:29 2022
Date: Fri, 8 Apr 2022 15:09:29 GMT
From: No Access User <noaccess@headnode.chadschmelter.com>
Message-Id: <202204081509.238F9TGT091582@headnode.chadschmelter.com>
Subject: Fault Management Event: headnode:SUNOS-8000-J0
Content-Length: 776

SUNW-MSG-ID: SUNOS-8000-J0, TYPE: Fault, VER: 1, SEVERITY: Major
@blackwood821
blackwood821 / var_log_joysetup.md
Created March 23, 2022 13:48
Triton CN Encryption Setup Log
[2021-05-03T15:28:32Z] ./joysetup.sh:374: create_zpool(): /usr/bin/mkzpool -B -e zones /tmp/pool.json
fatal error: pool creation failed: create-zpool: illegal option -- B
Unknown option -B
Usage: kbmadm create-zpool [-g guid] [-t template] -- <zpool create args>...
       kbmadm recover [-c cfgnum] dataset
       kbmadm unlock [-r] dataset...
       kbmadm recovery add [-a] [-t template] [-r recovery_token] dataset
       kbmadm recovery list [-p] dataset
 kbmadm recovery activate dataset
@blackwood821
blackwood821 / go_build.md
Created March 21, 2022 20:55
docker-machine-driver-triton
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go build
driver.go:12:2: cannot find package "github.com/docker/machine/libmachine/drivers" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/docker/machine/libmachine/drivers (from $GOROOT)
        /Users/chad/go/src/github.com/docker/machine/libmachine/drivers (from $GOPATH)
main.go:4:2: cannot find package "github.com/docker/machine/libmachine/drivers/plugin" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/docker/machine/libmachine/drivers/plugin (from $GOROOT)
        /Users/chad/go/src/github.com/docker/machine/libmachine/drivers/plugin (from $GOPATH)
driver.go:13:2: cannot find package "github.com/docker/machine/libmachine/engine" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/docker/machine/libmachine/engine (from $GOROOT)
@blackwood821
blackwood821 / triton_docker_copy.md
Last active December 29, 2021 15:23
Triton Docker Copy Issues
Chads-MacBook-Pro:certs chad$ triton-docker --tls cp cert.crt fw:/etc/nginx/

It hangs for a long time and I see this in the docker service log:

[2021-12-20T15:45:21.837Z]  INFO: docker/55916 on 63174fb7-7a4f-4bb3-8db2-f0909a50c5df:  (req_id=3f9e19fb-e7d3-41cd-ba13-b08eb94b3e01)
    evt: {
      "ph": "b",
@blackwood821
blackwood821 / bhyve_vm_disk.md
Created December 3, 2021 14:00
Bhyve VM Disk
[root@buildcorp (us-west-agc) ~]# zfs list -r -t all -o type,volsize,quota,refquota,reservation,refreservation,used,logicalused,logicalreferenced,usedbydataset,usedbychildren,usedbyrefreservation,avail,name,referenced zones/b7c7907e-bc62-403c-bbf0-5b22f628180d
TYPE        VOLSIZE  QUOTA  REFQUOTA  RESERV  REFRESERV   USED  LUSED  LREFER  USEDDS  USEDCHILD  USEDREFRESERV  AVAIL  NAME                                              REFER
filesystem        -   346G        1G    346G         1G   346G   301G    397M    396M       345G           628M   628M  zones/b7c7907e-bc62-403c-bbf0-5b22f628180d         396M
volume         300G      -         -    none       345G   345G   301G    301G    337G          0          7.57G  7.57G  zones/b7c7907e-bc62-403c-bbf0-5b22f628180d/disk0   338G
@blackwood821
blackwood821 / zfs_disk_usage.md
Last active December 1, 2021 13:40
Bhyve ZFS Disk Usage
[root@buildcorp (us-west-agc) /zones/d7d31787-d143-4bd1-bb9c-b988e9e0d7ca/root]# zfs list -r -t all -o type,volsize,quota,refquota,reservation,used,logicalused,avail,name zones/d7d31787-d143-4bd1-bb9c-b988e9e0d7ca
TYPE        VOLSIZE  QUOTA  REFQUOTA  RESERV   USED  LUSED  AVAIL  NAME
filesystem        -   116G        1G    116G   116G  43.0G  1021M  zones/d7d31787-d143-4bd1-bb9c-b988e9e0d7ca
volume          80G      -         -    none  92.0G  43.0G  43.8G  zones/d7d31787-d143-4bd1-bb9c-b988e9e0d7ca/disk0
volume          20G      -         -    none  23.0G    14K  23.0G  zones/d7d31787-d143-4bd1-bb9c-b988e9e0d7ca/disk1
[root@buildcorp (us-west-agc) /zones/d7d31787-d143-4bd1-bb9c-b988e9e0d7ca/root]# vmadm get d7d31787-d143-4bd1-bb9c-b988e9e0d7ca | json disks