parent
92640b67f4
commit
7538cd7ac8
|
@ -0,0 +1,6 @@
|
|||
Jonas Pfannschmidt <jonas.pfannschmidt@hp.com>
|
||||
Pierre-Arthur MATHIEU <pierre-arthur.mathieu@hp.com>
|
||||
Project Creator <gozer@hp.com>
|
||||
Saad Zaher <saad.zaher@hp.com>
|
||||
Stefano Canepa <stefano.canepa@hp.com>
|
||||
Zuul <zuul@hpcloud.net>
|
|
@ -0,0 +1,22 @@
|
|||
CHANGES
|
||||
=======
|
||||
|
||||
* Dummy evacuator and monitor driver for testing
|
||||
* Adding CREDITS.rst
|
||||
* Adding Osha description and enhancing templates Fixing some template issues and adding osha description and how it works
|
||||
* Some small improvements to pass pep8 and pep257
|
||||
* Add oslo.log dependency in requirements.txt
|
||||
* Adding HACKING.rst to follow Openstack Guidelines
|
||||
* Adding Notification System and Notification Drivers Support sending notification emails in case of any problem happened
|
||||
* Evacuation is working now and node will be evacuated but ? We need to contact nova guys to ask why when we disable or enable a node the node state is always going up even if the node is powereded off. We had to wait and retry many times for 1 minute at least to give nova compute sometime to update nova api with it's state
|
||||
* Buidling a plugable evacuators - still need some work !
|
||||
* Fixing keystone Configuration adding keystone_authtoken to config file and remove keystone old section
|
||||
* Add disable node to osclient
|
||||
* Adding libvirt Fencer driver
|
||||
* Fixing typo fencor > fencer
|
||||
* Modified diagrams
|
||||
* Adding Fencing plugable system
|
||||
* Adding support for plugable monitoring systems adding support for pbr restructuring osha
|
||||
* Big Bang
|
||||
* Add diagram
|
||||
* Added .gitreview
|
|
@ -1,11 +1,11 @@
|
|||
Osha Style Commandments
|
||||
Freezer DR Style Commandments
|
||||
===========================
|
||||
|
||||
- Step 1: Read the OpenStack Style Commandments
|
||||
http://docs.openstack.org/developer/hacking/
|
||||
- Step 2: Read on
|
||||
|
||||
Osha Specific Commandments
|
||||
Freezer DR Specific Commandments
|
||||
------------------------------
|
||||
|
||||
Logging
|
||||
|
|
34
README.rst
34
README.rst
|
@ -1,14 +1,14 @@
|
|||
==================
|
||||
OSHA
|
||||
Freezer Disaster Recovery
|
||||
==================
|
||||
|
||||
Osha, Openstack Compute node High Available provides compute node high availability for OpenStack.
|
||||
Simply Osha monitors all compute nodes running in a cloud deployment and if there is any failure
|
||||
in one of the compute nodes osha will fence this compute node then osha will try to evacuate all
|
||||
running instances on this compute node, finally Osha will notify all users who have workload/instances
|
||||
freezer-dr, Openstack Compute node High Available provides compute node high availability for OpenStack.
|
||||
Simply freezer-dr monitors all compute nodes running in a cloud deployment and if there is any failure
|
||||
in one of the compute nodes freezer-dr will fence this compute node then freezer-dr will try to evacuate all
|
||||
running instances on this compute node, finally freezer-dr will notify all users who have workload/instances
|
||||
running on this compute node as well as will notify the cloud administrators.
|
||||
|
||||
Osha has a pluggable architecture so it can be used with:
|
||||
freezer-dr has a pluggable architecture so it can be used with:
|
||||
|
||||
1. Any monitoring system to monitor the compute nodes (currently we support only native openstack services status)
|
||||
2. Any fencing driver (currently supports IPMI, libvirt, ...)
|
||||
|
@ -18,23 +18,23 @@ Osha has a pluggable architecture so it can be used with:
|
|||
just by adding a simple plugin and adjust the configuration file to use this
|
||||
plugin or in future a combination of plugins if required
|
||||
|
||||
Osha should run in the control plane, however the architecture supports different scenarios.
|
||||
For running osha under high availability mode, it should run with active passive mode.
|
||||
freezer-dr should run in the control plane, however the architecture supports different scenarios.
|
||||
For running freezer-dr under high availability mode, it should run with active passive mode.
|
||||
|
||||
|
||||
-----------------
|
||||
How it works
|
||||
-----------------
|
||||
|
||||
Starting Osha
|
||||
1. Osha Monitoring manager is going to load the required monitoring driver according to the configuration
|
||||
2. Osha will query the monitoring system to check if it considers any compute nodes to be down ?
|
||||
3.1. if no, Osha will exit displaying No failed nodes
|
||||
3.2. if yes, Osha will call the fencing manager to fence the failed compute node
|
||||
Starting freezer-dr
|
||||
1. freezer-dr Monitoring manager is going to load the required monitoring driver according to the configuration
|
||||
2. freezer-dr will query the monitoring system to check if it considers any compute nodes to be down ?
|
||||
3.1. if no, freezer-dr will exit displaying No failed nodes
|
||||
3.2. if yes, freezer-dr will call the fencing manager to fence the failed compute node
|
||||
4. Fencing manager will load the correct fencer according to the configuration
|
||||
5. once the compute node is fenced and is powered off now we will start the evacuation process
|
||||
6. Osha will load the correct evacuation driver
|
||||
7. Osha will evacuate all instances to another computes
|
||||
8. Once the evacuation process completed, Osha will call the notification manager
|
||||
6. freezer-dr will load the correct evacuation driver
|
||||
7. freezer-dr will evacuate all instances to another computes
|
||||
8. Once the evacuation process completed, freezer-dr will call the notification manager
|
||||
9. The notification manager will load the correct driver based on the configurations
|
||||
10. Osha will start the notification process ...
|
||||
10. freezer-dr will start the notification process ...
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
[DEFAULT]
|
||||
output_file = etc/freezer-dr.conf.sample
|
||||
wrap_width = 79
|
||||
namespace = freezer-dr
|
||||
namespace = oslo.log
|
|
@ -1,5 +0,0 @@
|
|||
[DEFAULT]
|
||||
output_file = etc/osha.conf.sample
|
||||
wrap_width = 79
|
||||
namespace = osha
|
||||
namespace = oslo.log
|
|
@ -1,7 +1,7 @@
|
|||
[DEFAULT]
|
||||
|
||||
#
|
||||
# From osha
|
||||
# From freezer-dr
|
||||
#
|
||||
|
||||
# Time to wait between different operations (integer value)
|
||||
|
@ -94,12 +94,12 @@
|
|||
[evacuation]
|
||||
|
||||
#
|
||||
# From osha
|
||||
# From freezer-dr
|
||||
#
|
||||
|
||||
# Time in seconds to wait between retries to disable compute node or put it in
|
||||
# maintenance mode. Default 10 seconds (string value)
|
||||
#driver = osha.evacuators.drivers.osha.standard.OshaStandardEvacuator
|
||||
#driver = freezer_dr.evacuators.drivers.default.standard.StandardEvacuator
|
||||
|
||||
# Time in seconds to wait between retries to disable compute node or put it in
|
||||
# maintenance mode. Default 10 seconds (integer value)
|
||||
|
@ -118,7 +118,7 @@
|
|||
[fencer]
|
||||
|
||||
#
|
||||
# From osha
|
||||
# From freezer-dr
|
||||
#
|
||||
|
||||
# YAML File contains the required credentials for compute nodes (string value)
|
||||
|
@ -133,7 +133,7 @@
|
|||
#hold_period = 10
|
||||
|
||||
# Choose the best fencer driver i.e.(ipmi, libvirt, .. (string value)
|
||||
#driver = osha.fencers.drivers.ipmi.driver.IpmiDriver
|
||||
#driver = freezer_dr.fencers.drivers.ipmi.driver.IpmiDriver
|
||||
|
||||
# List of kwargs to customize the fencer operation. You fencer driver should
|
||||
# support these options. Options should be in key:value format (dict value)
|
||||
|
@ -143,7 +143,7 @@
|
|||
[keystone_authtoken]
|
||||
|
||||
#
|
||||
# From osha
|
||||
# From freezer-dr
|
||||
#
|
||||
|
||||
# Openstack auth URI i.e. http://controller:5000 (string value)
|
||||
|
@ -188,11 +188,11 @@
|
|||
[monitoring]
|
||||
|
||||
#
|
||||
# From osha
|
||||
# From freezer-dr
|
||||
#
|
||||
|
||||
# Driver used to get a status updates of compute nodes (string value)
|
||||
#driver = osha.monitors.drivers.osha.driver.OshaDriver
|
||||
#driver = freezer_dr.monitors.drivers.default.driver.StandardDriver
|
||||
|
||||
# username to be used to initialize the monitoring driver (string value)
|
||||
#username = <None>
|
||||
|
@ -211,12 +211,12 @@
|
|||
[notifiers]
|
||||
|
||||
#
|
||||
# From osha
|
||||
# From freezer-dr
|
||||
#
|
||||
|
||||
# Notification driver to load it to notify users if something went wrong
|
||||
# (string value)
|
||||
#driver = osha.notifiers.drivers.osha.default_email.OshaEmail
|
||||
#driver = freezer_dr.notifiers.drivers.default.default_email.StandardEmail
|
||||
|
||||
# Endpoint URL for the notification system. If you the driver you are using
|
||||
# doesnot require any URL just comment it or use none (string value)
|
||||
|
@ -234,14 +234,14 @@
|
|||
|
||||
# Path to Jinja2 templates directory that contains message templates (string
|
||||
# value)
|
||||
#templates-dir = /etc/osha/templates
|
||||
#templates-dir = /etc/freezer/templates
|
||||
|
||||
# Key:Value Kwargs to pass it to the notification driver, if you want to pass
|
||||
# any special arguments for your driver. (dict value)
|
||||
#options =
|
||||
|
||||
# List of emails to sent them notification if something went wrong and Osha
|
||||
# wasnot able to send an email to the tenant admin (list value)
|
||||
# List of emails to sent them notification if something went wrong and Freezer
|
||||
# DR wasnot able to send an email to the tenant admin (list value)
|
||||
#notify-list =
|
||||
|
||||
# The sender address, it can be email address if we used default email driver,
|
|
@ -12,9 +12,9 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Osha Versions
|
||||
# Freezer-DR Versions
|
||||
|
||||
import pbr.version
|
||||
|
||||
|
||||
__version__ = pbr.version.VersionInfo('osha').version_string()
|
||||
__version__ = pbr.version.VersionInfo('freezer-dr').version_string()
|
|
@ -18,15 +18,17 @@ import sys
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from osha import __version__ as OSHA_VERSION
|
||||
from osha.common.utils import env
|
||||
from freezer_dr import __version__ as FREEZER_DR_VERSION
|
||||
from freezer_dr.common.utils import env
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
_MONITORS = [
|
||||
cfg.StrOpt('driver',
|
||||
default='osha.monitors.drivers.osha.driver.OshaDriver',
|
||||
default='freezer_dr.monitors.drivers.default.driver.'
|
||||
'StandardDriver',
|
||||
help='Driver used to get a status updates of compute nodes'),
|
||||
cfg.StrOpt('username',
|
||||
help='username to be used to initialize the monitoring driver'),
|
||||
|
@ -61,7 +63,7 @@ _FENCER = [
|
|||
'reasonable amount of time as different servers take '
|
||||
'different times to shut off'),
|
||||
cfg.StrOpt('driver',
|
||||
default='osha.fencers.drivers.ipmi.driver.IpmiDriver',
|
||||
default='freezer_dr.fencers.drivers.ipmi.driver.IpmiDriver',
|
||||
help='Choose the best fencer driver i.e.(ipmi, libvirt, ..'),
|
||||
cfg.DictOpt('options',
|
||||
default={},
|
||||
|
@ -113,8 +115,8 @@ _KEYSTONE_AUTH_TOKEN = [
|
|||
_EVACUATION = [
|
||||
cfg.StrOpt(
|
||||
'driver',
|
||||
default='osha.evacuators.drivers.osha.standard.'
|
||||
'OshaStandardEvacuator',
|
||||
default='freezer_dr.evacuators.drivers.default.standard.'
|
||||
'StandardEvacuator',
|
||||
help='Time in seconds to wait between retries to disable compute'
|
||||
' node or put it in maintenance mode. Default 10 seconds',
|
||||
dest='driver'), cfg.IntOpt(
|
||||
|
@ -140,7 +142,8 @@ _EVACUATION = [
|
|||
|
||||
_NOTIFIERS = [
|
||||
cfg.StrOpt('driver',
|
||||
default='osha.notifiers.drivers.osha.default_email.OshaEmail',
|
||||
default='freezer_dr.notifiers.drivers.default.default_email.'
|
||||
'StandardEmail',
|
||||
dest='driver',
|
||||
help='Notification driver to load it to notify users '
|
||||
'if something went wrong'),
|
||||
|
@ -165,7 +168,7 @@ _NOTIFIERS = [
|
|||
'authentications comment or use None'),
|
||||
cfg.StrOpt('templates-dir',
|
||||
dest='templates-dir',
|
||||
default='/etc/osha/templates',
|
||||
default='/etc/freezer/templates',
|
||||
help='Path to Jinja2 templates directory that contains '
|
||||
'message templates'),
|
||||
cfg.DictOpt('options',
|
||||
|
@ -178,7 +181,7 @@ _NOTIFIERS = [
|
|||
default=[],
|
||||
dest='notify-list',
|
||||
help='List of emails to sent them notification if something '
|
||||
'went wrong and Osha wasnot able to send an email to the '
|
||||
'went wrong and Freezer DR wasnot able to send an email to the '
|
||||
'tenant admin'),
|
||||
cfg.StrOpt('notify-from',
|
||||
dest='notify-from',
|
||||
|
@ -302,7 +305,7 @@ def configure():
|
|||
CONF.register_group(notifiers_grp)
|
||||
CONF.register_opts(_NOTIFIERS, group='notifiers')
|
||||
|
||||
# Osha Auth
|
||||
# Keystone Auth
|
||||
keystone_grp = cfg.OptGroup('keystone_authtoken',
|
||||
title='Keystone Auth Options',
|
||||
help='Openstack Credentials to call the nova '
|
||||
|
@ -310,13 +313,13 @@ def configure():
|
|||
CONF.register_group(keystone_grp)
|
||||
CONF.register_opts(_KEYSTONE_AUTH_TOKEN, group='keystone_authtoken')
|
||||
|
||||
default_conf = cfg.find_config_files('osha', 'osha', '.conf')
|
||||
default_conf = cfg.find_config_files('freezer', 'freezer-dr', '.conf')
|
||||
log.register_options(CONF)
|
||||
|
||||
CONF(args=sys.argv[1:],
|
||||
project='osha',
|
||||
project='freezer',
|
||||
default_config_files=default_conf,
|
||||
version=OSHA_VERSION)
|
||||
version=FREEZER_DR_VERSION)
|
||||
|
||||
|
||||
def setup_logging():
|
||||
|
@ -326,7 +329,7 @@ def setup_logging():
|
|||
'iso8601=WARN',
|
||||
'requests.packages.urllib3.connectionpool=WARN',
|
||||
'urllib3.connectionpool=WARN', 'websocket=WARN',
|
||||
'keystonemiddleware=WARN', 'osha=INFO']
|
||||
'keystonemiddleware=WARN', 'freezer-dr=INFO']
|
||||
|
||||
_DEFAULT_LOGGING_CONTEXT_FORMAT = (
|
||||
'%(asctime)s.%(msecs)03d %(process)d '
|
||||
|
@ -334,7 +337,7 @@ def setup_logging():
|
|||
'%(user_identity)s] %(instance)s'
|
||||
'%(message)s')
|
||||
log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS)
|
||||
log.setup(CONF, 'osha', version=OSHA_VERSION)
|
||||
log.setup(CONF, 'freezer-dr', version=FREEZER_DR_VERSION)
|
||||
|
||||
|
||||
def list_opts():
|
|
@ -19,7 +19,7 @@ import jinja2
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from osha.common.osclient import OSClient
|
||||
from freezer_dr.common.osclient import OSClient
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
|
@ -14,9 +14,9 @@
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from oslo_utils import importutils
|
||||
from osha.fencers.common.manager import FencerManager
|
||||
from freezer_dr.fencers.common.manager import FencerManager
|
||||
from time import sleep
|
||||
from osha.evacuators.common.utils import get_nodes_details
|
||||
from freezer_dr.evacuators.common.utils import get_nodes_details
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = log.getLogger(__name__)
|
|
@ -11,7 +11,7 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from osha.common.utils import get_os_client, get_admin_os_client
|
||||
from freezer_dr.common.utils import get_os_client, get_admin_os_client
|
||||
|
||||
|
||||
def get_nodes_details(nodes):
|
|
@ -13,16 +13,16 @@
|
|||
# limitations under the License.
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from osha.evacuators.common.driver import EvacuatorBaseDriver
|
||||
from osha.common.utils import get_os_client
|
||||
from freezer_dr.evacuators.common.driver import EvacuatorBaseDriver
|
||||
from freezer_dr.common.utils import get_os_client
|
||||
CONF = cfg.CONF
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class OshaStandardEvacuator(EvacuatorBaseDriver):
|
||||
class StandardEvacuator(EvacuatorBaseDriver):
|
||||
|
||||
def __init__(self, wait, retires, **kwargs):
|
||||
super(OshaStandardEvacuator, self).__init__(wait, retires, **kwargs)
|
||||
super(StandardEvacuator, self).__init__(wait, retires, **kwargs)
|
||||
self.client = get_os_client()
|
||||
|
||||
def get_node_instances(self, node):
|
|
@ -11,7 +11,7 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from osha.evacuators.common.driver import EvacuatorBaseDriver
|
||||
from freezer_dr.evacuators.common.driver import EvacuatorBaseDriver
|
||||
|
||||
|
||||
class DummyEvacuator(EvacuatorBaseDriver):
|
|
@ -33,9 +33,9 @@ class FencerBaseDriver(object):
|
|||
|
||||
Any fencer driver requires the following parameters to do the api
|
||||
calls. All these parameters can be passed from the configuration
|
||||
file in /etc/osha/osha.conf (default).
|
||||
file in /etc/freezer/dr.conf (default).
|
||||
|
||||
:param node: dict with all node details. (/etc/osha/servers.yml) ?
|
||||
:param node: dict with all node details. (/etc/freezer/servers.yml) ?
|
||||
:param kwargs: any additional parameters can be passed using this
|
||||
config option.
|
||||
"""
|
|
@ -14,7 +14,7 @@
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from oslo_utils import importutils
|
||||
from osha.common.yaml_parser import YamlParser
|
||||
from freezer_dr.common.yaml_parser import YamlParser
|
||||
from time import sleep
|
||||
|
||||
CONF = cfg.CONF
|
|
@ -11,8 +11,8 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from osha.fencers.common.driver import FencerBaseDriver
|
||||
from osha.fencers.drivers.ipmi.ipmitool import IpmiInterface
|
||||
from freezer_dr.fencers.common.driver import FencerBaseDriver
|
||||
from freezer_dr.fencers.drivers.ipmi.ipmitool import IpmiInterface
|
||||
from oslo_log import log
|
||||
from oslo_config import cfg
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from osha.fencers.common.driver import FencerBaseDriver
|
||||
from freezer_dr.fencers.common.driver import FencerBaseDriver
|
||||
from oslo_log import log
|
||||
from oslo_config import cfg
|
||||
import libvirt
|
|
@ -11,12 +11,12 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from osha.common import config
|
||||
from freezer_dr.common import config
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from osha.monitors.common.manager import MonitorManager
|
||||
from osha.evacuators.common.manager import EvacuationManager
|
||||
from osha.notifiers.common.manager import NotificationManager
|
||||
from freezer_dr.monitors.common.manager import MonitorManager
|
||||
from freezer_dr.evacuators.common.manager import EvacuationManager
|
||||
from freezer_dr.notifiers.common.manager import NotificationManager
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = log.getLogger(__name__)
|
||||
|
@ -25,7 +25,7 @@ LOG = log.getLogger(__name__)
|
|||
def main():
|
||||
config.configure()
|
||||
config.setup_logging()
|
||||
LOG.info('Starting osha ... ')
|
||||
LOG.info('Starting Freezer DR ... ')
|
||||
# load and initialize the monitoring driver
|
||||
monitor = MonitorManager()
|
||||
# Do the monitoring procedure
|
|
@ -27,7 +27,7 @@ class MonitorBaseDriver(object):
|
|||
"""
|
||||
Initializing the driver. Any monitoring system requires the following
|
||||
parameters to call it's api. All these parameters can be passed from the
|
||||
configuration file in /etc/osha/osha.conf
|
||||
configuration file in /etc/freezer/dr.conf
|
||||
:param username: Username
|
||||
:param password: Password
|
||||
:param endpoint: API URL
|
|
@ -11,8 +11,8 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from osha.common.osclient import OSClient
|
||||
from osha.monitors.common.driver import MonitorBaseDriver
|
||||
from freezer_dr.common.osclient import OSClient
|
||||
from freezer_dr.monitors.common.driver import MonitorBaseDriver
|
||||
from time import sleep
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
@ -23,10 +23,10 @@ CONF = cfg.CONF
|
|||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class OshaDriver(MonitorBaseDriver):
|
||||
class StandardDriver(MonitorBaseDriver):
|
||||
|
||||
def __init__(self, username, password, endpoint, **kwargs):
|
||||
super(OshaDriver, self).__init__(username, password, endpoint, **kwargs)
|
||||
super(StandardDriver, self).__init__(username, password, endpoint, **kwargs)
|
||||
client = OSClient(
|
||||
authurl=endpoint,
|
||||
username=username,
|
||||
|
@ -97,12 +97,11 @@ class OshaDriver(MonitorBaseDriver):
|
|||
|
||||
def get_info(self):
|
||||
return {
|
||||
'name': 'Osha Native Driver',
|
||||
'name': 'Freezer DR Native Driver',
|
||||
'version': 1.0,
|
||||
'author': 'Hewlett-Packard Development Company, L.P'
|
||||
}
|
||||
|
||||
|
||||
def is_hpyervisor_down(self, hypervisors):
|
||||
down_hosts = []
|
||||
for hypervisor in hypervisors:
|
|
@ -11,7 +11,7 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from osha.monitors.common.driver import MonitorBaseDriver
|
||||
from freezer_dr.monitors.common.driver import MonitorBaseDriver
|
||||
|
||||
|
||||
class DummyDriver(MonitorBaseDriver):
|
||||
|
@ -19,7 +19,7 @@ class DummyDriver(MonitorBaseDriver):
|
|||
|
||||
This can be useful for testing without actually shutting down the nodes.
|
||||
The nodes that should be reported as failing, can be configured in the
|
||||
monitoring section of the osha configuration file as follows:
|
||||
monitoring section of the freezer_dr configuration file as follows:
|
||||
kwargs = nodes_down:hostname1;hostname2
|
||||
"""
|
||||
|
||||
|
@ -46,9 +46,7 @@ class DummyDriver(MonitorBaseDriver):
|
|||
|
||||
def get_info(self):
|
||||
return {
|
||||
'name': 'Osha Dummy Driver',
|
||||
'name': 'Freezer DR Dummy Driver',
|
||||
'version': 1.0,
|
||||
'author': 'Hewlett-Packard Development Company, L.P'
|
||||
}
|
||||
|
||||
|
|
@ -13,8 +13,8 @@
|
|||
# limitations under the License.
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from osha.notifiers.common.driver import NotifierBaseDriver
|
||||
from osha.common.utils import load_jinja_templates
|
||||
from freezer_dr.notifiers.common.driver import NotifierBaseDriver
|
||||
from freezer_dr.common.utils import load_jinja_templates
|
||||
from datetime import date
|
||||
import time
|
||||
import smtplib
|
||||
|
@ -26,13 +26,14 @@ CONF = cfg.CONF
|
|||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class OshaEmail(NotifierBaseDriver):
|
||||
class StandardEmail(NotifierBaseDriver):
|
||||
|
||||
def __init__(self, url, username, password, templates_dir, notify_from,
|
||||
admin_list=None, **kwargs):
|
||||
super(OshaEmail, self).__init__(url, username, password, templates_dir,
|
||||
notify_from, admin_list, **kwargs)
|
||||
LOG.info('Initializing OshaEmail driver @ {0}'.format(url))
|
||||
super(StandardEmail, self).__init__(url, username, password,
|
||||
templates_dir, notify_from,
|
||||
admin_list, **kwargs)
|
||||
LOG.info('Initializing StandardEmail driver @ {0}'.format(url))
|
||||
server = smtplib.SMTP(url, kwargs.get('port'))
|
||||
server.ehlo()
|
||||
if kwargs.get('tls'):
|
|
@ -1,15 +0,0 @@
|
|||
"""Common module for osha."""
|
||||
|
||||
# (c) Copyright 2016 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
|
@ -1,13 +0,0 @@
|
|||
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
|
@ -1,13 +0,0 @@
|
|||
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1,13 +0,0 @@
|
|||
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'saad'
|
|
@ -1,13 +0,0 @@
|
|||
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
|
@ -1,13 +0,0 @@
|
|||
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
|
@ -1,13 +0,0 @@
|
|||
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
|
@ -1,13 +0,0 @@
|
|||
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
10
setup.cfg
10
setup.cfg
|
@ -1,7 +1,7 @@
|
|||
[metadata]
|
||||
name = Osha
|
||||
name = Freezer DR
|
||||
version = 0.1
|
||||
summary = OpenStack Compute High Availability
|
||||
summary = OpenStack Disaster Recovery
|
||||
description-file =
|
||||
README.rst
|
||||
author = OpenStack
|
||||
|
@ -19,7 +19,7 @@ classifier =
|
|||
|
||||
[files]
|
||||
packages =
|
||||
osha
|
||||
freezer_dr
|
||||
|
||||
[global]
|
||||
setup-hooks =
|
||||
|
@ -32,6 +32,6 @@ warnerrors = True
|
|||
|
||||
[entry_points]
|
||||
oslo.config.opts =
|
||||
osha = osha.common.config:list_opts
|
||||
freezer-dr = freezer_dr.common.config:list_opts
|
||||
console_scripts =
|
||||
osha = osha.main:main
|
||||
freezer-dr = freezer_dr.main:main
|
Loading…
Reference in New Issue