mirror of
https://github.com/gryf/mistral-evacuate.git
synced 2026-03-03 23:35:54 +01:00
Add new action so it can use filtered data
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>
This commit is contained in:
@@ -8,9 +8,6 @@ host-evacuate:
|
||||
input:
|
||||
- search_opts
|
||||
|
||||
output:
|
||||
vm_list: <% $.list_vms %>
|
||||
|
||||
tasks:
|
||||
list_vms:
|
||||
action: nova.servers_list search_opts=<% $.search_opts %>
|
||||
@@ -20,11 +17,11 @@ host-evacuate:
|
||||
|
||||
filter_vms:
|
||||
with-items: vm in <% $.vms %>
|
||||
action: custom.filter_vm flavor=<% $.vm.flavor.id %> metadata=<% $.vm.metadata %> uuid=<% $.vm.id %>
|
||||
action: custom.filter flavor=<% $.vm.flavor.id %> metadata=<% $.vm.metadata %> uuid=<% $.vm.id %>
|
||||
publish:
|
||||
filtered_vms: <% $.filter_vms.uuid %>
|
||||
filtered_vms: <% $.filter_vms %>
|
||||
on-success: evacuate_vms
|
||||
|
||||
evacuate_vms:
|
||||
with-items: vm_uuid in <% $.filtered_vms %>
|
||||
action: nova.servers_evacuate server=<% $.vm_uuid %> on_shared_storage=false
|
||||
with-items: vm in <% $.filtered_vms %>
|
||||
action: custom.evacuate uuid=<% $.vm.uuid %> evacuate=<% $.vm.evacuate %> on_shared_storage=false
|
||||
|
||||
Reference in New Issue
Block a user