-
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 missing features to snapshot restore/pop #6879
Add missing features to snapshot restore/pop #6879
Conversation
In our test environments, it's good to be able to roll back to the same, anonymous, snapshot repeatedly. This patch adds a `--no-delete` option to the `snapshot pop` command allowing this. This makes the new core snapshot behaviour more consistent with what we were doing with vagrant-multiprovider-snap (https://github.com/scalefactory/vagrant-multiprovider-snap)
I've also added a patch to allow the provisioning flags (available with the |
We talked about this on the other issue and I agree that it would require a semver boundary to adjust the default behavior, even if it wasn't correct (since snapshot was not considered a preview). |
snapshot_name = "push_#{Time.now.to_i}_#{rand(10000)}" | ||
|
||
# Save the snapshot. This will raise an exception if it fails. | ||
machine.action(:snapshot_save, snapshot_name: snapshot_name) | ||
end | ||
|
||
def pop(machine) | ||
def pop(machine,opts={}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit - comma space on all these args.
LGTM - thanks @jtopper! |
Add missing features to snapshot restore/pop
Update website docs for #6879
* commit '1f88a9737369eda3dede0d3aeb30928adf82a9f7': website: catch more atlas.hashicorp.com and fix enterprise spelling Update CHANGELOG website: add a page to send folks to get to a signup link for atlas Corrected binary logic description. Restart network after reconfiguration fix Update CHANGELOG Update website docs for hashicorp#6879 Fixed centos 7 networks if using more than 3 ethernet adapters. fixes hashicorp#7098 only specifying Hyper-V generation if the parameter is supported Update CHANGELOG.md Fix up style nit. Update docs Update CHANGELOG Support provisioning flags on snapshot rollback Add --no-delete to 'snapshot pop' command
In case anyone else ends up here the same way I did: It looks like updates to the docs have been released prematurely. As I write this they mention the new $ vagrant --version
Vagrant 1.8.1
$ vagrant snapshot restore --help
Usage: vagrant snapshot restore [options] [vm-name] <name>
Restore a snapshot taken previously with snapshot save.
-h, --help Print this help Happy to find that --no-provision is coming though! |
In our test environments, it's good to be able to roll back to the same,
anonymous, snapshot repeatedly. This patch adds a
--no-delete
optionto the
snapshot pop
command allowing this.This makes the new core snapshot behaviour more consistent with what we
were doing with vagrant-multiprovider-snap which I intend to deprecate eventually.