Skip to content

Instantly share code, notes, and snippets.

Brian Bennett bahamat

Block or report user

Report or block bahamat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bahamat /
Last active Nov 1, 2019
Diagnosing "No Compute Resources Available" messages in Triton.

No Compute Resources Available

This error is somewhat ambiguious because there is seemingly no indication which resource is exhausted.

Triton chooses compute nodes with a subcomponent called sdc-designation (also refered to as , DAPI). The full DAPI log for a provision job is embedded in the CNAPI log file and can be extracted with the workflow job uuid and the following script.


if [[ -n "$TRACE" ]]; then                                                      
View 0001-illumos-11894-zonecfg-export-should-quote-strings.patch
From 3cf036c03c6a9885353ad0d35edd5b6be7f6dcd2 Mon Sep 17 00:00:00 2001
From: Brian Bennett <>
Date: Tue, 29 Oct 2019 17:16:05 -0700
Subject: [PATCH] illumos#11894 zonecfg export should quote strings
usr/src/cmd/zonecfg/zonecfg.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/usr/src/cmd/zonecfg/zonecfg.c b/usr/src/cmd/zonecfg/zonecfg.c
bahamat /
Last active Oct 23, 2019
How are various shells configured, and in which order?


login interactive files
N Y ~/.bashrc
Y N /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile
Y Y /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile
bahamat /
Last active Oct 11, 2019
Shell script to pull CMON metrics from Joyent Triton (
if [[ -n "$TRACE" ]]; then
export PS4='[\D{%FT%TZ}] ${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
set -o xtrace
call() {
curl "$insecure" "${header:--i}" -s --cert "$cert" --key "$key" "https://${1}/${2}"
exit $?
bahamat /
Created Oct 11, 2019
Example for setting up CLOUDAPI_SERVICES sapi metadata
> triton -p west1 services
docker  tcp://
> triton -p west1 services -j
> triton -p west1 services -j | json
  "docker": "tcp://",
bahamat /
Created Jul 27, 2019 — forked from pklaus/
dnsupdate is meant to replace nsupdate, the standard DDNS update tool created by BIND authors ISC. While nsupdate does the job it is awkward to wrap in scripts and its usage in general is just not very intuitive. dnsupdate is meant to work well from the command line or from scripts and easy to use. It also does some nice things like automaticall…
#!/usr/bin/env python2.7
# Matt's DNS management tool
# Manage DNS using DDNS features
# See
# Usage: dnsupdate -s server -k key -t ttl add SRV 0 0 25566
# -h HELP!
# -s the server
# -k the key
bahamat / triton-grafana.json
Created Jul 16, 2019
Grafana dashboard template for Triton
View triton-grafana.json
"annotations": {
"list": [
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
View triton-update-all
set -o errexit
set -o xtrace
imgadm vacuum -f
sdcadm update --all --just-images -y
sdcadm self-update --allow-major-update --latest
sdcadm dc-maint start && printf "DC maintenance has started at %s\n" "$(date)"
bahamat / gist:c89147d594ad7382fbdeef7c85cb5a7d
Last active Mar 17, 2019
zfs compressed data counts less against the quota.
View gist:c89147d594ad7382fbdeef7c85cb5a7d
[root@smartos-iso /zones/compquota]# zfs get compression,used,quota,avail zones/compquota
zones/compquota compression on inherited from zones
zones/compquota used 23K -
zones/compquota quota 10M local
zones/compquota available 9.98M -
[root@smartos-iso /zones/compquota]# ls -lh
total 1
-rw-r--r-- 1 root root 500M Mar 17 21:33 zero
View gist:a8b5aac79ba707c8a4f53b08f52d236f
zones ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c10t01d0 ONLINE 0 0 0
c11t01d0 ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
c1t05d0 ONLINE 0 0 0
c2t0Dd0 ONLINE 0 0 0
mirror-2 ONLINE 0 0 0
c3t09d0 ONLINE 0 0 0
You can’t perform that action at this time.