Skip to content

Instantly share code, notes, and snippets.

@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 / 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:
# 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 / 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
@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 / badidea.patch
Created May 29, 2017 07:38
Workaround for bad defaults in Horizon Newton
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
index 391b8e7..42a8f50 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
@@ -419,7 +419,7 @@
ctrl.currentBootSource = selectedSource;
if ((selectedSource === bootSourceTypes.IMAGE ||
selectedSource === bootSourceTypes.INSTANCE_SNAPSHOT) && $scope.model.volumeBootable) {
- $scope.model.newInstanceSpec.vol_create = true;
+ $scope.model.newInstanceSpec.vol_create = false;
@zioproto
zioproto / lp1671693.patch
Created May 29, 2017 07:39
lp1671693.patch
commit 99f7c8c9ad26539473f65f30547ba548c02ab4fe
Author: Mark Mielke <[email protected]>
Date: Thu Mar 9 23:16:51 2017 -0500
Image list function should normalize owner filter
The api.glance.image_list_detailed() function accepts a list of
filters which it then translates into a form that is acceptable for
Glance v1 or Glance v2. These translations included support for
mapping 'is_public' to 'visibility', but did not include support for
@zioproto
zioproto / server.py
Last active November 15, 2017 13:52
Check instances are really up with Cloud-Init
#!/usr/bin/env python
"""
Boot the VMs with the following cloud-init, and then start this code:
#cloud-config
phone_home:
url: http://x.x.x.x:8000/$INSTANCE_ID/
post: [ hostname, fqdn ]
"""
@zioproto
zioproto / k8s-mysql-cinder.yaml
Last active September 25, 2019 20:57
Kubernetes on Openstack Mysql service with Cinder persistent volume claim
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: default
annotations:
storageclass.beta.kubernetes.io/is-default-class: "true"
provisioner: kubernetes.io/cinder
---
kind: PersistentVolumeClaim
#
# Example of a user's .screenrc file
#
# This is how one can set a reattach password:
# password ODSJQf.4IJN7E # "1234"
# no annoying audible bell, please
vbell off