Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions lib/vagrant-parallels/driver/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'vagrant/util/busy'
require 'vagrant/util/network_ip'
require 'vagrant/util/platform'
require 'vagrant/util/retryable'
require 'vagrant/util/subprocess'
require 'vagrant/util/which'

Expand Down Expand Up @@ -161,7 +162,11 @@ def delete_disabled_adapters
# @param [String] uuid Name or UUID of the target VM
# @param [String] snapshot_id Snapshot ID
def delete_snapshot(uuid, snapshot_id)
execute_prlctl('snapshot-delete', uuid, '--id', snapshot_id)
# Sometimes this command fails with 'Data synchronization is currently
# in progress'. Just wait and retry.
retryable(on: VagrantPlugins::Parallels::Errors::ExecutionError, tries: 2, sleep: 2) do
execute_prlctl('snapshot-delete', uuid, '--id', snapshot_id)
end
end

# Deletes any host only networks that aren't being used for anything.
Expand Down Expand Up @@ -537,7 +542,11 @@ def register(pvm_file, opts=[])
# @param [String] uuid Name or UUID of the target VM
# @param [String] snapshot_id Snapshot ID
def restore_snapshot(uuid, snapshot_id)
execute_prlctl('snapshot-switch', uuid, '-i', snapshot_id)
# Sometimes this command fails with 'Data synchronization is currently
# in progress'. Just wait and retry.
retryable(on: VagrantPlugins::Parallels::Errors::ExecutionError, tries: 2, sleep: 2) do
execute_prlctl('snapshot-switch', uuid, '-i', snapshot_id)
end
end

# Resumes the virtual machine.
Expand Down