Skip to content

Instantly share code, notes, and snippets.

View zhanghui9700's full-sized avatar
🎯
Focusing

pysharp zhanghui9700

🎯
Focusing
  • beijing
View GitHub Profile

1. ubuntu 1404

2. centos 71

cat ./install.sh

#!/bin/sh
set -eu

cat >> /tmp/apache.conf << EOF
@zhanghui9700
zhanghui9700 / neutron-entry-points.md
Created August 3, 2016 10:28
neutron-8.1.1-entry-points.txt

neutron entry points

[console_scripts]
neutron-bgp-dragent = neutron.cmd.eventlet.agents.bgp_dragent:main
neutron-db-manage = neutron.db.migration.cli:main
neutron-debug = neutron.debug.shell:main
neutron-dhcp-agent = neutron.cmd.eventlet.agents.dhcp:main
neutron-ipset-cleanup = neutron.cmd.ipset_cleanup:main
neutron-keepalived-state-change = neutron.cmd.keepalived_state_change:main

neutron-l3-agent = neutron.cmd.eventlet.agents.l3:main

@zhanghui9700
zhanghui9700 / ceilometer-entry-points.md
Created August 3, 2016 09:43
ceilometer-6.0.0.egg-info

ceilometer-6.0.0 entry points

[ceilometer.builder.poll.central]
hardware.snmp = ceilometer.hardware.pollsters.generic:GenericHardwareDeclarativePollster

[ceilometer.compute.virt]
hyperv = ceilometer.compute.virt.hyperv.inspector:HyperVInspector
libvirt = ceilometer.compute.virt.libvirt.inspector:LibvirtInspector
vsphere = ceilometer.compute.virt.vmware.inspector:VsphereInspector

xenapi = ceilometer.compute.virt.xenapi.inspector:XenapiInspector

@zhanghui9700
zhanghui9700 / ceilometer-cli-helper.md
Last active September 26, 2016 16:40
ceilometer cli helper

openstack ceilometer cli helper

通常云,特别是公有云在计费方面有三个层次:
计量 (Metering): 收集资源的使用数据,其数据信息主要包括:使用对象(what), 使用者(who), 使用时间(when)和 用量(how much)。
计费 (Rating):将资源使用数据按照商务规则转化为可计费项目并计算费用
结算 (Billing):收钱开票
Ceilometer 的目标是 计量 Metering 方面,为上层的计费、结算或者监控应用提供统一的资源使用数据收集功能。
"To provide an infrastructure to collect any information needed within all OpenStack projects so that rating engines could use this single point to transform events into bill items, which we tagged “metering“."

Meter(计量项)

servers

{
  "servers": [
    {
      "status": "ACTIVE",
      "OS-EXT-SRV-ATTR:ramdisk_id": "",
      "updated": "2016-06-30T06:47:06Z",

"hostId": "3239ae9bf2efa4792633c8c2b9db92feac00868cd4055b5b5e924719",

@zhanghui9700
zhanghui9700 / openstack-neutron-api-response.md
Last active June 1, 2016 02:42
openstack neutron api response

neutron

neutronclient(request).list_networks(**params).get('networks')

{                                                                           
  "networks": [                                                             
    {                                                                       
      "status": "ACTIVE",                                                   
      "subnets": [                                                          

"a9c9fdd5-6491-4611-9ad2-97ac01622a52"

@zhanghui9700
zhanghui9700 / devstack-mitaka-local.conf
Created May 25, 2016 01:55
devstack+trystack+mitaka
[[local|localrc]]
MYSQL_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_TOKEN=password
ADMIN_PASSWORD=password
SERVICE_PASSWORD=password
SWIFT_HASH=password
LOGFILE=/opt/stack/logs/stack.sh.log
@zhanghui9700
zhanghui9700 / nova-passwordless-ssh-login.sh
Created June 11, 2014 08:58
passwordless ssh host by nova
; allow nova login
usermod -s /bin/bash nova
su - nova
; ssh key
ssh-keygen
; scp key to compute host
scp /var/lib/nova/.ssh/id_rsa.pub root@ComputeHost:/var/lib/nova/.ssh/authorized_keys
@zhanghui9700
zhanghui9700 / curl-openstack-api.sh
Created June 10, 2014 02:30
use curl to test openstack api
curl test for openstack api
; change token when you run the command.
; glance
; glance image-list
curl -i -X GET -H 'X-Auth-Token: XXXXXXXXXXXXX-TODO' -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient' http://192.168.14.80:9292/v1/images/detail?sort_key=nam e&sort_dir=asc&limit=20
@zhanghui9700
zhanghui9700 / resize-cinder-volumes.txt
Created May 30, 2014 03:07
resize cinder volume pv
关于lvremove删除openstack cinder volume所对应的逻辑卷的方法
按照我的理解,openstack里的cinder volume创建、管理磁盘实际是用tgtadm管理的来自网络中的lvm磁盘。
有时cinder volume一直处于creating状态或者deleting状态,下层磁盘用不了也删不掉,占了很大的磁盘空间。既然它是用lvm管理的所以可以用lvm相关的工具来删除它。
先找到要删除的volume的lvm路径lvdisplay,我的是:/dev/cinder-vol/volume-725230c0-558a-422a-b9aa-5f309ed42798
直接lvremove /dev/cinder-vol/volume-725230c0-558a-422a-b9aa-5f309ed42798