Commit 2e47d0c9 authored by Jose Castro Leon's avatar Jose Castro Leon

Fix workflows for restoration

parent bc98ba3b
Pipeline #1048076 failed with stages
in 2 minutes and 21 seconds
......@@ -22,7 +22,9 @@ restore_clone_snapshot:
tasks:
check_flavor:
description: 'Checks if there is a flavor with the name specified as parameter'
action: nova.flavors_find name=<% $.flavor %>
action: nova.flavors_find
input:
name: <% $.flavor %>
publish:
flavor: <% task(check_flavor).result.id %>
publish-on-error:
......@@ -34,7 +36,9 @@ restore_clone_snapshot:
check_availability_zone:
description: 'Checks if there is an availability zone with the name specified as parameter'
action: nova.availability_zones_list detailed=false
action: nova.availability_zones_list
input:
detailed: false
publish:
avz_name: <% switch($.avz_name = null => null, $.avz_name != null => $.result.where($.zoneName = execution().input.avz_name).first().zoneName) %>
publish-on-error:
......@@ -46,7 +50,9 @@ restore_clone_snapshot:
check_server_by_name:
description: 'Checks if there is an instance with the name specified as parameter'
action: nova.servers_find name=<% $.instance %>
action: nova.servers_find
input:
name: <% $.instance %>
publish:
instance: <% task(check_server_by_name).result.id %>
on-success:
......@@ -57,7 +63,9 @@ restore_clone_snapshot:
check_server:
description: 'Retrieves information about the server and identifies if is a boot from image or boot from volume instance'
join: all
action: nova.servers_find id=<% $.instance %>
action: nova.servers_find
input:
id: <% $.instance %>
publish:
server: <% task(check_server).result %>
snapshot_name: <% $.pattern.format(task(check_server).result.name, datetime($.date).format("%Y%m%d")) %>
......@@ -106,7 +114,9 @@ restore_clone_snapshot:
get_volume:
description: 'Gets the volume to retrieve some properties'
action: cinder.volumes_get volume_id=<% task(get_volume_snapshot).published.snapshot.get('volume_id') %>
action: cinder.volumes_get
input:
volume_id: <% task(get_volume_snapshot).published.snapshot.get('volume_id') %>
publish:
volume_type: <% task(get_volume).result.volume_type %>
on-success:
......@@ -131,7 +141,10 @@ restore_clone_snapshot:
wait_for_volume_creation:
description: 'Waits until the snapshot has been marked as available'
action: cinder.volumes_find id=<% task(create_clone_volume).published.volume_id %> status='available'
action: cinder.volumes_find
input:
id: <% task(create_clone_volume).published.volume_id %>
status: 'available'
retry:
delay: 5
count: 40
......@@ -165,7 +178,8 @@ restore_clone_snapshot:
wait_for_instance_creation:
description: 'Waits until the instance is active to continue'
action: nova.servers_find id=<% $.clone_id %> status='ACTIVE'
action: nova.servers_find id=<% $.clone_id %>
status: 'ACTIVE'
retry:
delay: 10
count: 180
......
......@@ -17,7 +17,9 @@ restore_inplace_snapshot:
tasks:
check_server_by_name:
description: 'Checks if there is an instance with the name specified as parameter'
action: nova.servers_find name=<% $.instance %>
action: nova.servers_find
input:
name: <% $.instance %>
publish:
instance: <% task(check_server_by_name).result.id %>
on-success:
......@@ -27,7 +29,9 @@ restore_inplace_snapshot:
check_server:
description: 'Retrieves information about the server and identifies if is a boot from image or boot from volume instance'
action: nova.servers_find id=<% $.instance %>
action: nova.servers_find
input:
id: <% $.instance %>
publish:
server: <% task(check_server).result %>
snapshot_name: <% $.pattern.format(task(check_server).result.name, datetime($.date).format("%Y%m%d")) %>
......@@ -73,7 +77,9 @@ restore_inplace_snapshot:
get_volume:
description: 'Gets the volume to retrieve some properties'
action: cinder.volumes_get volume_id= <% task(get_volume_snapshot).published.snapshot.get('volume_id') %>
action: cinder.volumes_get
input:
volume_id: <% task(get_volume_snapshot).published.snapshot.get('volume_id') %>
publish:
volume_type: <% task(get_volume).result.volume_type %>
on-success:
......@@ -98,7 +104,10 @@ restore_inplace_snapshot:
wait_for_volume_creation:
description: 'Waits until the snapshot has been marked as available'
action: cinder.volumes_find id=<% task(create_clone_volume).published.volume_id %> status='available'
action: cinder.volumes_find
input:
id: <% task(create_clone_volume).published.volume_id %>
status: 'available'
retry:
delay: 5
count: 40
......@@ -109,7 +118,9 @@ restore_inplace_snapshot:
delete_previous_instance:
description: 'Deletes previous instance'
action: nova.servers_delete server=<% task(check_server).published.server.id %>
action: nova.servers_delete
input:
server: <% task(check_server).published.server.id %>
on-success:
- wait_for_dns_entry
on-error:
......@@ -118,6 +129,7 @@ restore_inplace_snapshot:
wait_for_dns_entry:
description: 'Waits until dns has freed the instance name'
action: std.noop
wait-after: 1200
on-success:
- create_boot_from_volume_instance
on-error:
......@@ -147,7 +159,10 @@ restore_inplace_snapshot:
wait_for_instance_creation:
description: 'Waits until the instance is active to continue'
action: nova.servers_find id=<% $.clone_id %> status='ACTIVE'
action: nova.servers_find
input:
id: <% $.clone_id %>
status: 'ACTIVE'
retry:
delay: 10
count: 180
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment