Document how to use libvirt driver
Change-Id: I5cba6ee970b64f4a63317169c3ab90613fbe0bb6 Closes-Bug: #1836736
This commit is contained in:
parent
2df8d325f8
commit
cbab3865e8
@ -29,10 +29,10 @@ Regular installation::
|
||||
|
||||
pip install os-faults
|
||||
|
||||
The library contains optional libvirt driver, if you plan to use it,
|
||||
The library contains optional libvirt driver [https://pypi.org/project/libvirt-python/], if you plan to use it,
|
||||
please use the following command to install os-faults with extra dependencies::
|
||||
|
||||
pip install os-faults[libvirt]
|
||||
pip install os-faults libvirt-python
|
||||
|
||||
|
||||
Configuration
|
||||
|
@ -24,7 +24,7 @@ from os_faults import utils
|
||||
class PowerDriver(base_driver.BaseDriver):
|
||||
|
||||
@abc.abstractmethod
|
||||
def supports(host):
|
||||
def supports(self, host):
|
||||
"""Returns True if host is supported by the power driver"""
|
||||
|
||||
@abc.abstractmethod
|
||||
|
@ -77,6 +77,7 @@ class NodeListDiscover(node_discover.NodeDiscover):
|
||||
MAC address is used for libvirt driver.
|
||||
- **fqdn** - FQDN of the node (optional).
|
||||
FQDN is used for filtering only.
|
||||
- **libvirt_name** - Libvirt domain name (optional).
|
||||
- **auth** - SSH related parameters (optional):
|
||||
- **username** - SSH username (optional)
|
||||
- **password** - SSH password (optional)
|
||||
|
@ -37,6 +37,9 @@ class LibvirtDriver(power_management.PowerDriver):
|
||||
|
||||
- **connection_uri** - libvirt uri
|
||||
|
||||
Note that Libvirt domain name should be specified as node attribute.
|
||||
Refer to node discover (node_list driver) for details.
|
||||
|
||||
"""
|
||||
|
||||
NAME = 'libvirt'
|
||||
@ -88,9 +91,9 @@ class LibvirtDriver(power_management.PowerDriver):
|
||||
|
||||
def poweroff(self, host):
|
||||
domain = self._find_domain_by_host(host)
|
||||
LOG.debug('Power off domain with name: %s', host.mac)
|
||||
LOG.debug('Power off domain with name: %s', domain.name())
|
||||
domain.destroy()
|
||||
LOG.info('Domain powered off: %s', host.mac)
|
||||
LOG.info('Domain powered off: %s', domain.name())
|
||||
|
||||
def poweron(self, host):
|
||||
domain = self._find_domain_by_host(host)
|
||||
|
Loading…
x
Reference in New Issue
Block a user