
This patch adds threads to poweroff/poweron/reset methods to increase the velocity of IPMI nodes management. The common code with the libvirt driver was moved to a separate module utils.py. Change-Id: Ic6e65079636cef6f32b13876fe3fb56ee302c6e9
os-failures
An OpenStack failures library
The library does destructive actions against OpenStack cloud. It provides an abstraction layer over different type of cloud deployment. The actions are implemented as drivers (e.g. DevStack driver, Fuel driver, KVM driver etc.).
- Free software: Apache license
- Documentation: http://os_failures.readthedocs.io
- Source: https://github.com/shakhat/os-failures
- Bugs: http://bugs.launchpad.net/os_failures
Usage
Cloud deployment configuration schema is an extension to cloud config used by os-client-config library:
cloud_config = {
'auth': {
'username': 'admin',
'password': 'admin',
'project_name': 'admin',
},
'region_name': 'RegionOne',
'cloud_management': {
'driver': 'devstack',
'address': 'devstack.local',
'username': 'root',
},
'power_management': {
'driver': 'kvm',
'address': 'kvm.local',
'username': 'root',
}
}
Build the connection to the cloud deployment and verify it:
Make some distraction:
- The library operates with 2 types of objects:
-
- service - is software that runs in the cloud, e.g. keystone-api
- nodes - nodes that host the cloud, e.g. hardware server with hostname
Use cases
1. Service actions
Get a service and restart it:
distractor = os_failures.connect(cloud_config)
service = distractor.get_service(name='keystone-api')
service.restart()
- Available actions:
-
- start - start Service
- terminate - terminate Service gracefully
- restart - restart Service
- kill - terminate Service abruptly
- unplug - unplug Service out of network
- plug - plug Service into network
2. Nodes operations
Get all nodes in the cloud and reboot them:
- Available actions:
-
- reboot - reboot all nodes gracefully
- poweroff - power off all nodes abruptly
- reset - reset (cold restart) all nodes
- oom - fill all node's RAM
- disable_network - disable network with specified name on each of the nodes
- enable_network - enable network with specified name on each of the nodes
3. Operate with service's nodes
Get all nodes where the service runs, pick one of them and reset:
4. Operate with nodes by their FQDNs
Get nodes where l3-agent runs and disable management network on that nodes:
fqdns = neutron.l3_agent_list_hosting_router(router_id)
nodes = distractor.get_nodes(fqdns=fqdns)
nodes.disable_network(network_name='management')
5. Operate with service on particular node
Restart service on a single node:
Description
Languages
Python
99.5%
Shell
0.5%