mirror of
https://github.com/gryf/mistral-evacuate.git
synced 2026-02-07 16:55:52 +01:00
This commit adds evacuate_vm_action which is a wrapper for nova.evacuate API call, but it checks the result of filtering from previous step, before executing evacuation. Also change a little bit workflow and filter action, so they suit new approach Signed-off-by: Dawid Deja <dawid.deja@intel.com>
28 lines
790 B
YAML
28 lines
790 B
YAML
---
|
|
version: '2.0'
|
|
|
|
host-evacuate:
|
|
description: Evacuate VMs from given host
|
|
type: direct
|
|
|
|
input:
|
|
- search_opts
|
|
|
|
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
|
|
|
|
evacuate_vms:
|
|
with-items: vm in <% $.filtered_vms %>
|
|
action: custom.evacuate uuid=<% $.vm.uuid %> evacuate=<% $.vm.evacuate %> on_shared_storage=false
|