Skip to content

Instantly share code, notes, and snippets.

View nuriel77's full-sized avatar

Nuriel Shem-Tov nuriel77

View GitHub Profile
@nuriel77
nuriel77 / with_noout_flag
Last active December 8, 2016 15:53
Turning off a node with x2 OSDs for more than 300 seconds (5 min), without and with "noout" flag set on ceph
# Shutting down a node with two OSDs
# "noout" flag is set, meaning no count down starts (default 300 sec)
# There will be no data re-placement.
########################################################################
[root@overcloud-controller-0 ~]# ceph -w
cluster ce7cc1f4-bccc-11e6-a544-525400ac16ed
health HEALTH_WARN
80 pgs stale
1 requests are blocked > 32 sec
2/6 in osds are down
heat_template_version: 2014-10-16
description: >
Wipe and convert all disks to GPT (except the disk containing the root file system)
resources:
userdata:
type: OS::Heat::MultipartMime
properties:
parts:
@nuriel77
nuriel77 / prepare_cloud.sh
Last active January 17, 2017 14:42
prepare overcloud virtual test environment
#!/bin/bash
set -x
set -e
source ~/overcloudrc
if ! test -f CentOS-7-x86_64-GenericCloud.qcow2;then
wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2.xz
unxz CentOS-7-x86_64-GenericCloud.qcow2.xz
fi
@nuriel77
nuriel77 / setHosts.py
Last active January 25, 2017 16:05
After Overcloud deployment use this to output friendly names for /etc/hosts on undercloud
#!/usr/bin/env python
from novaclient import client
from subprocess import call
from os import environ, system, getuid
import sys
import re
"""
Script to set hostnames / IP addresses mapping
in /etc/hosts
@nuriel77
nuriel77 / gist:8f51c6229b70160fcd739a1b27809790
Created February 1, 2017 14:36
fix silly overcloud bug
for i in {0..2}; do ssh heat-admin@controller${i} "sudo systemctl enable openstack-cinder-api && sudo systemctl restart openstack-cinder-api && sudo sed -i 's/^enabled_apis=metadata/enabled_apis=metadata,osapi_compute/' /etc/nova/nova.conf && sudo systemctl restart openstack-nova-api";done
@nuriel77
nuriel77 / gist:8ca2d34afdb1d3191737bbb875f666b9
Created February 7, 2017 16:52
Install iDrac ssl certificate via racadm
racadm -r 10.166.5.6 -u root -p calvin sslkeyupload -t 1 -f D:\idrac_cert\wild_cert.key
racadm -r 10.166.5.6 -u root -p calvin sslcertupload -t 1 -f D:\idrac_cert\wild_cert.cer
@nuriel77
nuriel77 / gist:dc325084472166fd05e81baa9177ecad
Last active February 13, 2017 17:11
get macs libvirt for brbm network interface
#!/usr/bin/env python
import xml.etree.ElementTree as ET
import libvirt
import sys
import re
""" Find all mac addresses from domains
to be able to generate the instackenv.json
manually """
#!/usr/bin/env python
from keystoneauth1 import identity
from keystoneauth1 import session
from neutronclient.v2_0 import client
from subprocess import call
from os import environ
import sys
""" Remove all network components """
#!/bin/bash
# This script will correct the "\n\\n" bug in hosts file
# Src: https://bugs.launchpad.net/tripleo/+bug/1655375
# It will prevent from rebuild and redeployment to
# create a /etc/hosts file with this error.
# The nodes data is saved on swift on the undercloud
# and being pulled by the os-refresh-config process.
if [ "$OS_CLOUDNAME" != "undercloud" ]
then
@nuriel77
nuriel77 / sensu-checks.json
Created March 24, 2017 12:06
Checks examples for sensu / openstack
// /etc/sensu/conf.d/sensu-checks.json
{
"checks": {
"check-aodh-evaluator": {
"command": "systemctl is-active openstack-aodh-evaluator || exit 2",
"subscribers": ["overcloud-ceilometer-aodh-evaluator"],
"interval": 60
},