This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from unittest import mock | |
class System: | |
def __init__(self): | |
self.counter1 = 0 | |
self.counter2 = 0 | |
def foo(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name opendev gerrit CI table | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description | |
// @author gibi | |
// @match https://review.opendev.org/c/* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openstack | |
def main(): | |
cloud = openstack.connect() | |
projects = cloud.list_projects() | |
for project in projects: | |
print('project_id:', project['id']) | |
floating_ips = cloud.list_floating_ips( | |
filters={"project_id": project["id"]}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heat_template_version: wallaby | |
resources: | |
net0: | |
type: OS::Neutron::ProviderNet | |
properties: | |
name: net0 | |
network_type: vlan | |
physical_network: physnet0 | |
segmentation_id: 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will fail is used as an update over https://gist.github.com/gibizer/a0c4e5dc4a59ed3217f64c04a8f207a4 as | |
# neutron does not support changing a qos rule if that is used by a bound port | |
heat_template_version: wallaby | |
resources: | |
net0: | |
type: OS::Neutron::ProviderNet | |
properties: | |
name: net0 | |
network_type: vlan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will succeed if applied as an update over https://gist.github.com/gibizer/a0c4e5dc4a59ed3217f64c04a8f207a4 | |
# if there are still free resource on the compute as neutron allows replacing a qos policy on a bound port and does | |
# the necessary allocation update in placement. | |
heat_template_version: wallaby | |
resources: | |
net0: | |
type: OS::Neutron::ProviderNet | |
properties: | |
name: net0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INST=f996ef6b-4417-4eb3-aeb7-9f66d8c4d2c5 | |
PORT=46ceed9e-1262-47c2-b7dc-335a31f78b71 | |
rg \ | |
"\ | |
instance: $INST\] Unshelving|\ | |
instance: $INST\] Swapping old allocation on .* held by migration .* for instance|\ | |
instance: $INST\] Starting finish_revert_migration|\ | |
Updating port $PORT with attributes|\ | |
instance: $INST\] Preparing to wait for external event network-vif-plugged|\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change placement conf | |
# [api] | |
# auh_strategy = noauth2 | |
sudo apt install jq parallel --yes | |
sudo mysql -uroot -padmin -e "DROP DATABASE IF EXISTS placement;" | |
sudo mysql -uroot -padmin -e "CREATE DATABASE placement CHARACTER SET utf8;" | |
placement-manage db sync | |
sudo systemctl restart devstack@placement-* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## host(with a real PCI dev) ---libvirt/qemu---> L1 VM (running devstack) ---nova/libvirt/qemu---> L2 VM | |
## host | |
# Enable iommu in the kernel | |
$ grep iommu /etc/default/grub | |
GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on" | |
# the PCI device needs to be in a separate IOMMU group |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import time | |
import eventlet | |
from oslo_concurrency import lockutils | |
eventlet.monkey_patch() | |
LOCK = "my-lock" |