Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give guests a chance to shutdown gracefully #104

Merged
merged 1 commit into from
May 18, 2020
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
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
myoung34 marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down