-
Notifications
You must be signed in to change notification settings - Fork 500
-
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
Disks with allow_existing: true are cleaned up when domain is destroyed #746
Comments
Testing with a slight smaller config and a different box, this is currently working on vagrant 1.8.7 with vagrant-libvirt 0.0.37. Wonder if you could config that you're experiencing the same problem with the following Vagrantfile
I can't upgrade my local vagrant installation right now, so I'll have to come back to this, but if you can confirm you still see the bug with the pruned config above it'll help me narrow it down as I look at what changed between vagrant 1.8.7 and 1.9.1 to result in vagrant-libvirt not seeing the config correctly. |
Interestingly I cannot reproduce this any more, not with your Vagrantfile, or mine. In the end this issue didn't turn out to block me from what I was trying to do when I experienced the problem, and now it's very awkward to revert back to the exact state I had then. It seems very likely that the error was on my side, even though I took great precautions trying to prevent that, so perhaps you should just reject this ticket. Sorry for the inconvenience! |
Thanks for checking; closing until reproducable. |
Steps to reproduce
allow_existing: true
set, e.g.:vagrant up
vagrant destroy --force
Expected behaviour
The disk with
allow_existing: true
should still exist.Actual behaviour
The disk with
allow_existing: true
was removed byvagrant destroy --force
.System configuration
Debian Unstable
Libvirt version:
3.0.0-3
Output of
vagrant version; vagrant plugin list
:Installed Version: 1.9.1
vagrant-libvirt (0.0.37, system)
Output of
VAGRANT_LOG=debug vagrant ... --provider=libvirt
Irrelevant; nothing about disks is logged for
vagrant destroy
.A Vagrantfile to reproduce the issue:
The issue with the above Vagrantfile is that
apt-cacher-ng-data.qcow2
is cleaned up onvagrant destroy
.Are you using upstream vagrant package or your distros package?
Distro (Debian)
I looked briefly at the code for cleaning up disks in
lib/vagrant-libvirt/action/destroy_domain.rb
, and the problem is that we end up running the case withdomain.destroy(destroy_volumes: true)
; whenvagrant destroy
is run, the disks are not added toenv[:machine].provider_config.disks
(it's empty), so we never got to the case where we check disk-by-disk ifallow_existing
is set. In fact, when runningvagrant destroy
mydomain.storage
call from the above Vagrantfile is not run (actually the block passed toconfig.vm.provider
is not run), which explains why it's not getting added toenv[:machine].provider_config.disks
.The text was updated successfully, but these errors were encountered: