Skip to content

Commit

Permalink
Merge pull request #125 from jerryk55/wait_for_snapshot_success
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronagh Sorota authored and simaishi committed Sep 14, 2017
1 parent 8d71d0a commit 26ddc4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/manageiq/providers/azure/cloud_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def vm_create_evm_managed_snapshot(vm)
snap_svc.get(ssa_snap_name, resource_group)
rescue ::Azure::Armrest::NotFoundException, ::Azure::Armrest::ResourceNotFoundException => err
begin
snap_svc.create(ssa_snap_name, resource_group, snap_options)
response = snap_svc.create(ssa_snap_name, resource_group, snap_options)
# wait a minute at a time, allowing the Job Timeout to handle long-running snapshots here
next until snap_svc.wait(response.response_headers) =~ /^succe/i
return ssa_snap_name
rescue => err
_log.error("vm=[#{vm.name}], error: #{err}")
Expand All @@ -157,6 +159,8 @@ def vm_create_evm_blob_snapshot(vm)
_log.debug("vm=[#{vm.name}] creating SSA snapshot for #{vm.blob_uri}")
begin
snapshot_info = vm.storage_acct.create_blob_snapshot(vm.container, vm.blob, vm.key)
# wait a minute at a time, allowing the Job Timeout to handle long-running snapshots here
next until vm.storage_acct_service.wait(snapshot_info) =~ /^succe/i
return snapshot_info[:x_ms_snapshot]
rescue => err
_log.error("vm=[#{vm.name}], error:#{err}")
Expand Down

0 comments on commit 26ddc4f

Please sign in to comment.