1 ##############################################################################
2 # Copyright (c) 2017 ZTE Corporation and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
12 vitrage_template_file = '/etc/vitrage/templates/vitrage_host_down_scenarios.yaml'
16 name: host_down_scenarios
17 description: scenarios triggered by Doctor monitor 'compute.host.down' alarm
22 name: compute.host.down
23 template_id: host_down_alarm
28 template_id: instance_alarm
39 source: host_down_alarm
42 template_id : host_down_alarm_on_host
45 relationship_type: contains
47 template_id : host_contains_instance
49 source: instance_alarm
52 template_id : alarm_on_instance
55 condition: host_down_alarm_on_host
58 action_type: set_state
64 action_type: mark_down
68 condition: host_down_alarm_on_host and host_contains_instance
71 action_type: raise_alarm
75 alarm_name: Instance Down
78 condition: host_down_alarm_on_host and host_contains_instance and alarm_on_instance
81 action_type: add_causal_relationship
83 source: host_down_alarm
84 target: instance_alarm
86 action_type: mark_down
92 def set_vitrage_host_down_template():
93 if os.path.isfile(vitrage_template_file):
94 print('Vitrage host_down template file: %s already exists.' % vitrage_template_file)
96 print('Create Vitrage host_down template file:%s.' % vitrage_template_file)
97 with open(vitrage_template_file, 'w') as file: