-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
add 'vagrant snapshot' option #143
Comments
Marked as a feature request. I probably won't make this happen by Vagrant 0.6 for a few reasons, but mostly because this will require a lot of thought which I haven't dedicated to it yet. But it is marked for later. |
ya or at least an easy way to do it via regular virtualbox gui |
+1 Just to provide a sample use case, I'm using Vagrant to make localhostin' a little more convenient when developing Chef cookbooks and modeling infrastructure. It would be really nice if Vagrant provided some commands to facilitate easy incremental development so that, for instance, one could:
Getting to Step 1 may take a long time for package downloads and installations, and no one wants to keep repeating that if working through a problem later in the build that hoses system state so further testing isn't useful or reliable :-) |
+1 for implementing this, I almost have the same use case of ches |
|
Currently working on a solr chef recipe, I'm using vagrant to make things easier. Being able to snapshot just before the beginning of the recipe I work on would be really neat, definitely, so +1! Somewhat slower maybe, maybe there is some way to create a box out of current state ? |
Oh hell yes...give me some of that. I could so use a snapshot/rollback capability right now... |
+1, Snapshots would be really handy. Even a single rollback point would be sweet. |
I have the same Chef development use case. I'm having success using vbox snapshots via the VirtualBox GUI. I can take snapshots at any time and I can restore old snapshots after running |
Agreed, being able to rollback to set state would be an extremely helpful feature. |
What should a workflow look like? How should we inform vagrant that we'd like it to snapshot before provisioning? After build deps are installed? Other times? Vagrantfile? Then underlying virtualbox gem (https://github.com/mitchellh/virtualbox) looks like it already supports everything we might want to do. |
I think it would be nice to have a named snapshot. $ vagrant snapshot mytest And, if that already exists to append a version to it - mytest.1 or something. Then you'd have to specify that name on the rollback too. To the second question...maybe just extend the up command to be 'sup', and then provide an argument to specify when the snapshot should happen. 'sup afterpuppet'. Good stuff. |
@ryansch - thanks for the tip on VirtualBox snapshots, I wasn't aware of that! |
Hmm, that's a good question @ryansch -- I was initially just thinking of manual work on the developer's part to edit the run list / manifests executed before/between snapshots, but it might be nice if Vagrant had some smarts built in. I'll give some thought to what a nice workflow might be based on my understanding of how Virtualbox's snapshot capabilities work, perhaps will put some brainstorming in a wiki page and link it from here. If anyone gets around to it first, please share :-) It could also be interesting/convenient to exploit Virtualbox's ability to set a disk image as immutable, whereby all writes to it are discarded next time the VM is powered on. These can be attached to more than one VM, so might be useful for testing rollout of interdependent cookbooks/roles to a cluster with homogenous base systems. |
I've never been able to have vagrant resume from a suspended virtualbox image. it just freezes up. anyone else have that? |
Hi! I came over this issue coincidentally and my immediate thought was: sahara by @jedi4ever
Details / Source: https://github.com/jedi4ever/sahara |
@ctrabold That's a great find! It appears to call out to VBoxManage to work with a single snapshot named sahara-sandbox. sandbox on - Creates snapshot This is simpler than the suggested workflows for native vagrant snapshot support as it only works with a single snapshot but is an excellent stopgap until myself or someone else can find time to implement a fuller feature set. |
@joevandyk: Are you suspending or halting your vagrant VM first? As an alternative try the sahara gem that was just commented on. |
+1 for this feature request. Should be really nice.
Or something.. |
I'm out of office until the 4th of August. You can contact Torsten Lesmann in case there's problems with WPC. |
Some great ideas happening here. I just want to let everyone know that I am reading these and will incorporate snapshots in the future, but definitely post-1.0 (not as far away as you think...) Mitchell |
There is a new plugin called vagrant-snap now by t9md |
I can't tell if jedi4ever is recommending vagrant-snap over sahara, but it seems like the easiest way forward is to bless one of the plugins and merge it in. |
Let me quickly make it clear why I have been leaving this issue alone so that people don't think I'm neglecting this for no reason :) I've wanted for some time for Vagrant to support more than just VirtualBox. I started this work around 6 months back but found that the change necessary would be huge and would introduce instability to an otherwise fairly stable tool, so I decided to punt this feature until post-1.0. Snapshots are a fairly VirtualBox-specific idea. I'd like to avoid integrating these for now since it would make it harder to support more hypervisors later without saying "Sorry, but not snapshots with X." I fully intend to bring snapshots in at some point, but for now I'm quite pleased with the plugin ecosystem surrounding it. |
This feature will come eventually, but not for version 1.0. Go with the plugins for now, they work very well. I'm trying to clean up issues for 1.0 so I'm closing this for now. Mitchell |
The plugins for creating snapshots don't seem to be working anymore. Sahara gem works fine but it does not allow multiple snapshots. Anyone know of a plugin that is currently working? |
subscribing. let me know if you find one. |
I'm using This is my gem "vagrant", "~> 1.0.3"
gem "vagrant-snap", "~> 0.10" |
Probably some incompatibility with my virtual box version then, or something... With the same Gemfile I can't make it work... Guess I'll stick to sahara for now. |
I'm wondering what happens if you manually take the snapshots in VirtualBox? Won't it work? |
(FYI, https://github.com/t9md/vagrant-snap is broken in new versions of vagrant) vboxmanage can make snapshots if it has the UUID. The UUID is available from the .vagrant file, and this very fragile code can get it into bash:
This would be easy to off-load if vagrant had a command to get the UUID like: vagrant uuid
|
I made this simple gist inspired by @MichaelJCole's comment and @t9md's previous efforts. |
If you're running Vagrant 1.1+ and you miss @t9md's vagrant-snap, see https://github.com/dergachev/vagrant-vbox-snapshot |
+1 |
This would be so cool to have. Anyone know if there is a way to make this work with the vmware provider? |
@bbhoss for VMWare this was recently released: https://github.com/scalefactory/vagrant-multiprovider-snap |
It would be helpful to allow access to Virtual Box's 'snapshot' feature by allowing a 'vagrant snapshot' command. Associated rollback commands would be even more helpful.
The text was updated successfully, but these errors were encountered: