mirror of
https://github.com/gryf/mistral-evacuate.git
synced 2026-03-16 15:03:32 +01:00
Separate geting flavors and filtering into separe tasks
Also minimalize numbers of calls to nova API Signed-off-by: Dawid Deja <dawid.deja@intel.com>
This commit is contained in:
@@ -2,27 +2,33 @@
|
||||
version: '2.0'
|
||||
|
||||
host-evacuate:
|
||||
description: Evacuate VMs from given host
|
||||
type: direct
|
||||
description: Evacuate VMs from given host
|
||||
type: direct
|
||||
input:
|
||||
- search_opts
|
||||
- on_shared_storage
|
||||
- flavor_extra_specs
|
||||
|
||||
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
|
||||
|
||||
tasks:
|
||||
list_vms:
|
||||
action: nova.servers_list search_opts=<% $.search_opts %>
|
||||
publish:
|
||||
vms: <% $.list_vms %>
|
||||
on-success: filter_vms
|
||||
list_flavors:
|
||||
action: custom.find_flavors extra_specs=<% $.flavor_extra_specs %>
|
||||
publish:
|
||||
flavors: <% $.list_flavors %>
|
||||
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
|
||||
filter_vms:
|
||||
join: all
|
||||
action: custom.filter flavors=<% $.flavors %> vms=<% $.vms %>
|
||||
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=<% $.on_shared_storage %>
|
||||
evacuate_vms:
|
||||
with-items: vm in <% $.filtered_vms %>
|
||||
action: nova.servers_evacuate server=<% $.vm %> on_shared_storage=<% $.on_shared_storage %>
|
||||
|
||||
Reference in New Issue
Block a user