Skip to content

Commit

Permalink
Merge pull request #104 from cliffe/give_guests_a_chance_to_shutdown
Browse files Browse the repository at this point in the history
Give guests a chance to shutdown gracefully
  • Loading branch information
myoung34 committed May 18, 2020
2 parents 640d640 + 029b53b commit f520dd7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/vagrant-ovirt4/action/halt_vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ def initialize(app, env)
def call(env)
env[:ui].info(I18n.t("vagrant_ovirt4.halt_vm"))

# Halt via OS capability
if env[:machine].guest.capability?(:halt)
env[:machine].guest.capability(:halt)
end
# Give the VM a chance to shutdown gracefully..."
sleep 10

machine = env[:vms_service].vm_service(env[:machine].id)
machine.stop rescue nil #todo dont rescue

Expand Down

0 comments on commit f520dd7

Please sign in to comment.