Skip to content

Instantly share code, notes, and snippets.

View leseb's full-sized avatar
👺

Sébastien Han leseb

👺
View GitHub Profile
@leseb
leseb / geo-rep-recovery.md
Created June 14, 2012 20:16 — forked from vshankar/geo-rep-recovery.md
Geo-rep failover-failback plan

Geo-rep Recovery plan

Use Case

In the event of geo-rep master suffering a partial failure (one of the GlusterFS brick process not functioning) or a full failure (master node shuts down), the steps involved in recovering the master from the slave is what is covered here.

Notion used in this document

@@ -469,7 +469,8 @@ delete_route () {
case "$SYSTYPE" in
SunOS) return 0;;
*BSD) CMD="$ROUTE -n delete -host $ipaddr";;
- *) CMD="$ROUTE -n del -host $ipaddr";;
+ *) MYROUTE=$(ip r s | grep "src $ipaddr")
+ CMD="ip r d $MYROUTE" ;;
esac
$CMD
@leseb
leseb / RAKeystone.diff
Created June 21, 2012 22:21
Ra Keystone
@@ -239,8 +239,9 @@ keystone_monitor() {
if [ -n "$OCF_RESKEY_client_binary" ] && [ -n "$OCF_RESKEY_os_username" ] \
&& [ -n "$OCF_RESKEY_os_password" ] && [ -n "$OCF_RESKEY_os_tenant_name" ] \
&& [ -n "$OCF_RESKEY_os_auth_url" ]; then
- if ! check_binary $OCF_RESKEY_client_binary; then ocf_log warn "$OCF_RESKEY_client_binary \
- missing, can not monitor!" else
+ if ! check_binary $OCF_RESKEY_client_binary; then
+ ocf_log warn "$OCF_RESKEY_client_binary missing, can not monitor!"
+ else
ocf_run -q $OCF_RESKEY_client_binary \
--- a/tools/ocf/keystone
+++ b/tools/ocf/keystone
@@ -277,6 +277,7 @@
# Spin waiting for the server to come up.
# Let the CRM/LRM time us out if required
while true; do
+ sleep 1
keystone_monitor
... ...
rc=$?
@@ -144,7 +144,7 @@ find_rbd_dev() {
rbd_validate_all() {
# Test for configuration errors first
if [ -z "$OCF_RESKEY_name" ]; then
- ocf_log err 'Required parameter "name" is unset!'
+ ocf_log err "Required parameter "name" is unset!"
exit $OCF_ERR_CONFIGURED
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
#
# http://www.devthought.com/2009/09/19/get-ssh-copy-id-in-mac-os-x/
#
@leseb
leseb / gist:3273241
Created August 6, 2012 10:21
ext3 to ext4
@@ -66 +66 @@ cfg.MultiStrOpt() {
cfg.MultiStrOpt('virt_mkfs',
default=[
- 'default=mkfs.ext3 -L %(fs_label)s -F %(target)s',
+ 'default=mkfs.ext4 -L %(fs_label)s -F %(target)s',
'linux=mkfs.ext3 -L %(fs_label)s -F %(target)s',
'windows=mkfs.ntfs'
' --force --fast --label %(fs_label)s %(target)s',
# NOTE(yamahata): vfat case
#'windows=mkfs.vfat -n %(fs_label)s %(target)s',
diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py
index c9016bf..9365b86 100644
--- a/cinder/volume/drivers/rbd.py
+++ b/cinder/volume/drivers/rbd.py
@@ -54,8 +54,9 @@ class RBDDriver(driver.VolumeDriver):
def __init__(self, *args, **kwargs):
super(RBDDriver, self).__init__(*args, **kwargs)
self.configuration.append_config_values(rbd_opts)
+ volume_backend_name = self.configuration.safe_get('volume_backend_name') or 'RBD'
self._stats = dict(
#!/bin/bash
echo "toto"
#!/bin/bash
echo "lol"