metadata:
 name: host_public_nic_failure_scenarios vm 0
 description: scenarios triggered by host nic fail on physical vm 0
definitions:
 entities:
  - entity:
     category: ALARM
     type: zabbix
     rawtext: Public interface down on {HOST.NAME}
     template_id: zabbix_alarm
  - entity:
     category: ALARM
     type: vitrage
     name: VM network problem 0
     template_id: instance_alarm
  - entity:
     category: RESOURCE
     type: nova.instance
     template_id: instance
  - entity:
     category: RESOURCE
     type: neutron.port
     template_id: port
  - entity:
     category: ALARM
     type: vitrage
     name: PORT network problem
     template_id: port_alarm
  - entity:
     category: RESOURCE
     type: nova.host
     template_id: host
 relationships:
  - relationship:
     source: zabbix_alarm
     relationship_type: on
     target: host
     template_id : public_nic_fail_on_host
  - relationship:
     source: host
     relationship_type: contains
     target: instance
     template_id : host_contains_instance
  - relationship:
     source: instance_alarm
     relationship_type: on
     target: instance
     template_id : alarm_on_instance
  - relationship:
     source: port_alarm
     relationship_type: on
     target: port
     template_id : alarm_on_port
  - relationship:
     source: port
     relationship_type: attached
     target: instance
     template_id : port_attached_to_instance
scenarios:
 - scenario:
    condition: public_nic_fail_on_host and host_contains_instance
    actions:
     - action:
        action_type: raise_alarm
        action_target:
         target: instance
        properties:
         alarm_name: VM network problem 0
         severity: critical
     - action:
        action_type: set_state
        action_target:
         target: instance
        properties:
         state: SUBOPTIMAL
 - scenario:
    condition: public_nic_fail_on_host and host_contains_instance and alarm_on_instance
    actions:
     - action:
        action_type: add_causal_relationship
        action_target:
         source: zabbix_alarm
         target: instance_alarm

