forked from gryf/mistral-evacuate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhost-evacuate.yaml
34 lines (29 loc) · 978 Bytes
/
host-evacuate.yaml
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
---
version: '2.0'
host-evacuate:
description: Evacuate VMs from given host
type: direct
input:
- search_opts
- on_shared_storage
tasks:
list_vms:
action: nova.servers_list search_opts=<% $.search_opts %>
publish:
vms: <% $.list_vms %>
on-success: filter_vms
filter_vms:
with-items: vm in <% $.vms %>
action: custom.filter flavor=<% $.vm.flavor.id %> metadata=<% $.vm.metadata %> uuid=<% $.vm.id %>
publish:
filtered_vms: <% $.filter_vms %>
on-success: evacuate_vms
retry:
delay: 5
count: 10
evacuate_vms:
with-items: vm in <% $.filtered_vms %>
action: custom.evacuate uuid=<% $.vm.uuid %> evacuate=<% $.vm.evacuate %> on_shared_storage=<% $.on_shared_storage %>
retry:
delay: 5
count: 10