Custom Search

Wednesday, December 16, 2015

OpenStack Create tenant, user, and user-role

1)
$keystone tenant-create --name doc-team

2)
$keystone user-create --name docuser --tenant e232e9ee1b384873b0efeb9554997506 --pass docuser --enabled true


3)
$keystone role-list
$keystone user-role-list


4)
$keystone user-role-add --user 5902cb094e98425c8cd3c1fb877e53e1 --role 779cf32247d94bc3b3abc9adfd952b41 --tenant e232e9ee1b384873b0efeb9554997506


django How to create fixture


$python manage.py dumpdata | python -mjson.tool


$python manage.py dumpdata | python -mjson.tool > somefile.json

Tuesday, December 15, 2015

Tuesday, December 8, 2015

python ctypes example load librbd

# python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>>
>>>
>>> from ctypes.util import find_library
>>> librbd_path = find_library('rbd')
>>> librbd_path
'librbd.so.1'
>>>
>>>
>>> from ctypes import CDLL
>>>
>>> rbdd = CDLL(librbd_path)
>>>
>>>
>>> rbdd

>>>
>>>
>>> dir(rbdd)
['_FuncPtr', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattr__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_func_flags_', '_func_restype_', '_handle', '_name']
>>> 

>>>
>>> rbdd.rbd_write
<_funcptr 0x7f1475cff460="" at="" object="">
>>> 
>>>
>>> help(rbdd.rbd_write)
>>>
>>>



Friday, December 4, 2015

How to ceph create auth

1)
#ceph auth list   

2)   
#ceph auth get-or-create client.glance mon "allow r" osd "allow class-read object_prefix rbd_children, allow rwx pool=images"

[client.glance]
    key = AQD1mLtVi9eQCRAAgR6zX/XvWyiac6A/OyRg8w==

3)   
#ceph auth list