mirror of
https://github.com/gryf/mistral-evacuate.git
synced 2026-02-17 06:35:55 +01:00
Inital import
This commit is contained in:
30
host-evacuate.yaml
Normal file
30
host-evacuate.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
version: '2.0'
|
||||
|
||||
host-evacuate:
|
||||
description: Evacuate VMs from given host
|
||||
type: direct
|
||||
|
||||
input:
|
||||
- search_opts
|
||||
|
||||
output:
|
||||
vm_list: <% $.list_vms %>
|
||||
|
||||
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_vms flavor=<% $.vm.flavor.id %> metadata=<% $.vm.metadata %> uuid=<% $.vm.id %>
|
||||
publish:
|
||||
filtered_vms: <% $.filter_vms.uuid %>
|
||||
on-success: evacuate_vms
|
||||
|
||||
evacuate_vms:
|
||||
with-items: vm_uuid in <% $.filtered_vms %>
|
||||
action: nova.servers_evacuate server=<% $.vm_uuid %> on_shared_storage=false
|
||||
Reference in New Issue
Block a user