Skip to content

Instantly share code, notes, and snippets.

View yosshy's full-sized avatar

Akira YOSHIYAMA yosshy

  • NEC Corporation
View GitHub Profile
@yosshy
yosshy / nova-boot.img
Last active September 30, 2015 20:25
calltraces of Nova/Neutron/Glance 2015.1.0 (stable/kilo)
nova-api-140220592794032 entering nova.api.openstack.compute.images.Controller.index
nova-api-140220592794032 |entering nova.image.api.API.get_all
nova-api-140220592794032 ||entering nova.image.glance.get_default_image_service
nova-api-140220592794032 |||entering nova.image.download.file.get_schemes
nova-api-140220592794032 |||exiting nova.image.download.file.get_schemes
nova-api-140220592794032 ||exiting nova.image.glance.get_default_image_service
nova-api-140220592794032 ||entering nova.image.glance.GlanceImageService.detail
nova-api-140220592794032 |||entering nova.image.glance._extract_query_params
nova-api-140220592794032 |||exiting nova.image.glance._extract_query_params
nova-api-140220592794032 |||entering nova.image.glance.GlanceClientWrapper.call
@yosshy
yosshy / nova.patch
Created October 4, 2015 17:12
Patch for nova-2015.1 to use vSphere with Neutron (ML2/LinuxBridge/VLAN)
diff --git a/network/neutronv2/api.py b/network/neutronv2/api.py
index 2f84715..abe9b25 100644
--- a/network/neutronv2/api.py
+++ b/network/neutronv2/api.py
@@ -791,6 +791,7 @@ class API(base_api.NetworkAPI):
networks = networks + [
{'id': iface['network']['id'],
'name': iface['network']['label'],
+ 'vlan': iface['network'].get('vlan'),
'tenant_id': iface['network']['meta']['tenant_id']}
@yosshy
yosshy / test.sh
Created December 8, 2015 13:07
functional test of oslo.policy with keystone api
#!/bin/bash
# Role: s1, s2, s3 and s4 are defined.
for s1 in add remove; do
for s2 in add remove; do
for s3 in add remove; do
for s4 in add remove; do
for s5 in add remove; do
for s6 in add remove; do
@yosshy
yosshy / case 1
Created December 8, 2015 14:14
some additional tests for oslo.policy with keystone
+----------------------------------+----------+---------+--------+
| ID | Name | Project | User |
+----------------------------------+----------+---------+--------+
| 9fe2ff9ee4384b1894a90878d3e92bab | _member_ | sample | sample |
| dbc42f57cb9645d8ba2e7cb24210a2ca | s4 | sample | sample |
| b907d1e97a544d608246e10fe1b608b0 | s3 | sample | sample |
| 932bf48856f345be81af257c3616b9e9 | s1 | sample | sample |
| bd9c438aa1fa4c398b2ae1fbe4defc78 | s2 | sample | sample |
+----------------------------------+----------+---------+--------+
( role:s1 or role:s2 or role:s3 ) or role:s4 (should be True): True
@yosshy
yosshy / command-line-example
Last active April 4, 2016 13:59
Console service daemon with logging output for ironic-conductor
# ./ironic-console-server.py -f /tmp/log -p 5555 -c "ipmitool -H 192.168.2.236 -U root -P opctest -I lanplus sol activate"
@yosshy
yosshy / ironic.patch
Last active January 4, 2017 13:49
Ironic patch to support setting/getting boot devices of VMs on VMware ESXi with pxe_ssh driver
$ diff -u /tmp/ssh.py ironic/drivers/modules/ssh.py
--- /tmp/ssh.py 2017-01-02 07:06:46.896349353 -0500
+++ ironic/drivers/modules/ssh.py 2017-01-04 03:44:48.278981212 -0500
@@ -184,6 +184,10 @@
'get_node_macs': (
"vmsvc/device.getdevices {_NodeName_} | "
"grep macAddress | awk -F '\"' '{print $2}' || true"),
+ 'set_boot_device': (
+ 'vmbootdev {_NodeName_} {_BootDevice_}'),
+ 'get_boot_device': (
@yosshy
yosshy / split_log.py
Last active April 14, 2017 04:13
Split an OpenStack logfile into ones per request
#!/usr/bin/env python
import argparse
import re
import sys
# Log format:
# 2017-01-04 12:00:04.103 25416 DEBUG oslo_service.periodic_task
# [req-c28f86bb-9a6c-4c17-bbfc-8e00824fcff9 - - - - -]
@yosshy
yosshy / boston2017.ical
Last active April 23, 2017 00:33
iCal for OpenStack Summit Boston 2017
BEGIN:VCALENDAR
DTSTART:20170507T080000
SUMMARY:OpenStack Summit Boston 2017
BEGIN:VEVENT
SUMMARY:OpenStack Upstream Institute\, Sponsored by Lenovo (Day 1)
DTSTART;VALUE=DATE-TIME:20170506T170000Z
DTEND;VALUE=DATE-TIME:20170506T220000Z
UID:18639@openstacksummitboston2017
DESCRIPTION:OpenStack Upstream Institute is an intensive program designed
to share knowledge about the different ways of contributing to OpenStack l
@yosshy
yosshy / console.log
Created May 6, 2017 05:30
State machine of a node in OpenStack Baremetal (Ironic)
[root@ocata ~]# python
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ironic.common import states
>>> states.machine
<ironic.common.fsm.FSM object at 0x2764f50>
>>> print(states.machine.pformat())
+----------------+---------+----------------+-------------------------------+------------------------------+
| Start | Event | End | On Enter | On Exit |
@yosshy
yosshy / bmc_sol.diff
Last active July 10, 2017 07:41
SOL capability for IPMI server in pyghmi
commit 529fa89de14a4e2027dbfad79d7412b57b91f88a
Author: Akira Yoshiyama <[email protected]>
Date: Sun Jul 9 01:14:20 2017 +0900
Added SOL capability to BMC
diff --git a/bin/fakebmc b/bin/fakebmc
index 318970e..2647f11 100755
--- a/bin/fakebmc
+++ b/bin/fakebmc