Skip to content

Instantly share code, notes, and snippets.

@zioproto
zioproto / Readme.md
Created March 30, 2017 11:16
Notes on LBaaS migration from V1 to V2

We have to implement the alembic db migration

cd /usr/lib/python2.7/dist-packages/neutron_lbaas/db/migration/alembic_migrations/$

we need a alembic.ini configuration file. What I did is to copy this file from the neutron package:

cp /usr/lib/python2.7/dist-packages/neutron/db/migration/alembic.ini .

At this point we can start a new alembic migration

@zioproto
zioproto / openstack-lbaas-database-migration-from-v1-to-v2.py
Created March 14, 2017 11:43
Openstack LBaaS Database Alembic Migration from V1 to V2
# Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# Check docs at: https://jujucharms.com/docs/stable/howto-privatecloud
# Check more docs for Openstack integration at: https://cloud.garr.it/support/kb/juju/juju/
# sudo add-apt-repository ppa:juju/devel && sudo apt-get update && sudo apt-get install juju
# juju add-cloud SWITCHengines switchengines.yaml
# juju add-credential SWITCHengines
# juju metadata generate-image -d ~/engines -i `openstack image show "Ubuntu Xenial 16.04 (SWITCHengines)" -f value -c id` -s xenial -r ZH -u https://keystone.cloud.switch.ch:5000/v3
# juju metadata generate-image -d ~/engines -i `openstack image show "Ubuntu Trusty 14.04 (SWITCHengines)" -f value -c id` -s trusty -r ZH -u https://keystone.cloud.switch.ch:5000/v3
# Make sure you have high quotas for number of VMs, and for number of Security Groups
# juju bootstrap --metadata-source /home/ubuntu/engines --config network=private --config use-floating-ip=true SWITCHengines saveriotest
# juju deploy cs:bundle/apache-hadoop-spark-zeppelin-14
@zioproto
zioproto / neutron-liberty-namespaces-check.patch
Created October 27, 2016 10:31
neutron-liberty-namespaces-check.patch
diff --git a/neutron/agent/linux/ip_lib.py b/neutron/agent/linux/ip_lib.py
index 115686f..9b26552 100644
--- a/neutron/agent/linux/ip_lib.py
+++ b/neutron/agent/linux/ip_lib.py
@@ -114,16 +114,19 @@ class IPWrapper(SubProcessBase):
def get_devices(self, exclude_loopback=False):
retval = []
+ output = []
if self.namespace:
@zioproto
zioproto / keybase.md
Created October 21, 2016 08:31
keybase.md

Keybase proof

I hereby claim:

  • I am zioproto on github.
  • I am zioproto (https://keybase.io/zioproto) on keybase.
  • I have a public key whose fingerprint is 3561 51C3 9A23 68EB B731 A165 E0B4 6E9F C833 68FB

To claim this, I am signing this object:

@zioproto
zioproto / rbd-replication.md
Created October 19, 2016 12:03 — forked from jbernard/rbd-replication.md
Cinder RBD Replication Guide

Replication Notes

Assumption: You have two clusters, access to both, and a pool that exists in both clustsers and you wish to replicate some or all images in that pool to the other cluster.

Mirroring in both directions is required for Cinder to properly implement failover and failback.

Make sure you have the rbd-mirror package installed.

@zioproto
zioproto / update_chroots
Created August 30, 2016 13:55
Keep update ubuntu chroots
#!/bin/bash
for d in `schroot -l | grep -- '^source'`
do
sbuild-update -udcar $d
done
@zioproto
zioproto / howto_deb_repackage.txt
Created May 13, 2016 13:00 — forked from shamil/howto_deb_repackage.txt
Howto repackage deb packages
Use folowing steps to repackage dep package:
1: Extract deb package
# dpkg-deb -x <package.deb> <dir>
2: Extract control-information from a package
# dpkg-deb -e <package.deb> <dir/DEBIAN>
3. After completed to make changes to the package, repack the deb
# dpkg-deb -b <dir> <new-package.deb>
commit 74252dd0915310013dbdf7b53fe813590bb4ca0a
Author: Saverio Proto <[email protected]>
Date: Thu Apr 21 16:50:07 2016 +0200
Check if namespace exists before exec commands
If a neutron router has no ports defined, its namespace is deleted.
It is required to check if the namespace exists before calling
exec commands against the namespace.
It is not enough for the string of the namespace uuid to be defined,
#!/bin/bash
case $(id -u) in
0)
echo first: running as root
echo doing the root tasks...
add-apt-repository -s ppa:ubuntu-cloud-archive/tools
add-apt-repository -s cloud-archive:mitaka
apt-get update
export DEBIAN_FRONTEND=noninteractive