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
bahamat / no_compute_resources_available.md
Last active Nov 1, 2019
Diagnosing "No Compute Resources Available" messages in Triton.
View no_compute_resources_available.md

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.

#!/bin/bash

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 <brian.bennett@joyent.com>
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
bahamat / shell_config.md
Last active Oct 23, 2019
How are various shells configured, and in which order?
View shell_config.md

bash

login interactive files
N N $BASH_ENV
N Y ~/.bashrc
Y N /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile
Y Y /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile
@bahamat
bahamat / cmon.sh
Last active Oct 11, 2019
Shell script to pull CMON metrics from Joyent Triton (https://www.joyent.com/triton)
View cmon.sh
#!/bin/bash
if [[ -n "$TRACE" ]]; then
export PS4='[\D{%FT%TZ}] ${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
set -o xtrace
fi
call() {
curl "$insecure" "${header:--i}" -s --cert "$cert" --key "$key" "https://${1}/${2}"
exit $?
@bahamat
bahamat / from_node-triton_cli.md
Created Oct 11, 2019
Example for setting up CLOUDAPI_SERVICES sapi metadata
View from_node-triton_cli.md
> triton -p west1 services
NAME    ENDPOINT
cmon    https://cmon.us-west-1.triton.zone:9163
docker  tcp://us-west-1.docker.joyent.com:2376
> triton -p west1 services -j
{"docker":"tcp://us-west-1.docker.joyent.com:2376","cmon":"https://cmon.us-west-1.triton.zone:9163"}
> triton -p west1 services -j | json
{
  "docker": "tcp://us-west-1.docker.joyent.com:2376",
@bahamat
bahamat / dnsupdate.py
Created Jul 27, 2019 — forked from pklaus/dnsupdate.py
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…
View dnsupdate.py
#!/usr/bin/env python2.7
# Matt's DNS management tool
# Manage DNS using DDNS features
#
# See http://planetfoo.org/blog/archive/2012/01/24/a-better-nsupdate/
#
# Usage: dnsupdate -s server -k key -t ttl add _minecraft._tcp.mc.example.com SRV 0 0 25566 mc.example.com.
# -h HELP!
# -s the server
# -k the key
@bahamat
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
#!/bin/bash
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
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
NAME PROPERTY VALUE SOURCE
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
NAME STATE READ WRITE CKSUM
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.