1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
======
Basics
======
Configuration file
------------------
The cloud deployment configuration schema has simple YAML/JSON format:
.. code-block:: yaml
cloud_management:
driver: devstack
args:
address: 192.168.1.240
auth:
username: stack
private_key_file: cloud_key
iface: enp0s8
power_managements:
- driver: libvirt
args:
connection_uri: qemu+ssh://ubuntu@10.0.1.50/system
By default, the library reads configuration from a file with one of
the following names: ``os-faults.{json,yaml,yml}``. The configuration
file is searched in one of default locations:
* current directory
* ~/.config/os-faults
* /etc/openstack
Also, the name of the configuration file can be specified in the
``OS_FAULTS_CONFIG`` environment variable::
$ export OS_FAULTS_CONFIG=/home/alex/my-os-faults-config.yaml
Execution
---------
Establish a connection to the cloud and verify it:
.. code-block:: python
import os_faults
cloud_management = os_faults.connect(config_filename='os-faults.yaml')
cloud_management.verify()
or via CLI::
$ os-faults verify -c os-faults.yaml
Make some destructive action:
.. code-block:: python
cloud_management.get_service(name='keystone').restart()
or via CLI::
$ os-inject-fault -c os-faults.yaml restart keystone service
|