
Couple of things: * ssh-copy-id refuses to copy keys over the hop when the destination is already reachable via its own (different) key * accept Fuel host and user as parameters Change-Id: I9557021c20dbfeeb97059179ccd1bd1879663076
os-faults
OpenStack faults injection library
The library does destructive actions inside 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-faults.readthedocs.io
- Source: https://github.com/openstack/os-faults
- Bugs: http://bugs.launchpad.net/os_faults
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:
The library can also read configuration from the file specified in OS_FAULTS_CONFIG environment variable or read it from one of default locations: * current directory * ~/.config/os-faults * /etc/openstack
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_faults.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: