-
Notifications
You must be signed in to change notification settings - Fork 500
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
after upgrading vagrant to 2.2.9 (from 2.2.7) a vagrant up destroys the domain on error #1122
Comments
The change in behavior was introduced at #984. To restore the old behavior we just need to use the |
Since this has bitten me numerous times (and some machines take a long time to provision) I made a bash wrapper that ensure that #!/bin/bash
function idx {
local str a
str="${1}"
shift
a=( "${@}" )
for i in $(seq 0 "${#}"); do
if [ "${str}" = "${a[i]}" ]; then
echo "$((i + 1))"
return 0
fi
done
return 1
}
a=( "${@}" )
if i="$(idx up "${@}")"; then
a=( "${a[@]:0:$i}" "--no-destroy-on-error" "${a[@]:$i}" )
fi
exec /usr/bin/vagrant "${a[@]}" |
Since the default with the VirtualBox provisioner is to keep the VM running, i was really confused for a long time what was happening and looked in all the wrong corners. I do not see any environment variable or configuration to disable the default of deleteing the VM. Is there? Because if not, i would have suspect this provisioner to work the same was as the VirtualBox one does. |
Steps to reproduce
exit 1
.Expected behaviour
The libvirt domain/vm is not destroyed.
Actual behaviour
The libvirt domain/vm is destroyed when there is a provisioning error.
System configuration
OS/Distro version:: Ubuntu 20.04
Libvirt version:
Output of
vagrant version; vagrant plugin list
:Output of
VAGRANT_LOG=debug vagrant ... --provider=libvirt
It seems vagrant is calling DestroyDomain:
the full log is at https://gist.github.com/rgl/1c849e1909435adb80af94bb43754a59
A Vagrantfile to reproduce the issue:
Are you using upstream vagrant package or your distros package?
Upstream
The text was updated successfully, but these errors were encountered: