Skip to content

Instantly share code, notes, and snippets.

View jschmid1's full-sized avatar

Joshua Schmid jschmid1

View GitHub Profile
inventory:
version: 1
# the version of the inventory store structure
unique_hostname:
# hostnames need to be unique in a cluster, we can use it as the key with values
# being the attributes
attributes:
# here we store arbitrary information about the host like
# fqdn, kernel version, os-name etc
# this opens up the possibility for node inspection (cpu/ram consumption etc)
@jschmid1
jschmid1 / dg_to_osdspec.py
Last active August 3, 2020 13:35
migrate old dg to cephadm osdspecs
deepsea_drive_group = """
drive_group_default:
target: 'dc-north'
data_devices:
model: SSD-123-foo
db_devices:
model: MC-55-44-XZ
format: bluestore
encryption: True
---
Workflow examples:
Note: The depicted workflow starts after the initial deployment with bin/cephadm.
Task 0:
Add available hosts to cephadm:
ceph orch host add host{1..20}
@jschmid1
jschmid1 / buffer1.txt
Last active May 29, 2020 13:40
ceph orchestrator spec CLI proposal
Proposal:
Make the CLI more `spec` centric.
`ceph orch spec <operation> <--service-type>|<--service-name>`
Examples:
`ceph orch spec ls`
@jschmid1
jschmid1 / gist:4bf2970e8748bcf02bd7120b3c550f46
Last active January 28, 2020 11:45
c-v --format json vs plain
admin:~ # ceph-volume inventory
stderr: unable to read label for /dev/vda2: (2) No such file or directory
stderr: unable to read label for /dev/vda3: (2) No such file or directory
stderr: unable to read label for /dev/vda1: (2) No such file or directory
stderr: unable to read label for /dev/vda: (2) No such file or directory
stderr: unable to read label for /dev/vdb: (2) No such file or directory
stderr: unable to read label for /dev/vdc: (2) No such file or directory
stderr: unable to read label for /dev/vdd: (2) No such file or directory
stderr: unable to read label for /dev/vde: (2) No such file or directory
stderr: unable to read label for /dev/vdf: (2) No such file or directory
import logging
import yaml
from salt.client import LocalClient
from salt.exceptions import SaltClientError
log = logging.getLogger(__name__)
def ext_pillar(minion_id, pillar, *args, **kwargs):
my_pillar = {'drive_group': {}}
import urwid
import logging
logging.basicConfig(filename='example.log',level=logging.DEBUG)
class ClusterLayout(object):
def __init__(self):
pass
@jschmid1
jschmid1 / gist:88db7657836c84d481d0
Created July 26, 2015 10:55
tw stream selector
#!/usr/bin/ruby
require 'kappa'
games = []
Twitch.games.top(:limit => 10) {|game| games.push(game.name)}
games_hash = Hash[(1...games.size).zip games]
games_hash.each do |k,v|
puts "#{k}: #{v}"
end
@jschmid1
jschmid1 / hib_sus_testing
Created February 17, 2015 11:45
s3 / s4 testing
#!/bin/sh
dir=/var/tmp
log=$dir/test_hib.log
if [ x`id -u` != x0 ] ; then
echo "call as root!"
exit 1
fi
require 'fileutils'
dir = '/mnt'
def write_file(size_in_mb, dir)
File.open("#{dir}/file-#{rand(100000)}.txt", 'w') do |f|
contents = "x" * (1024*1024)
size_in_mb.times { f.write(contents) }
end
end