Vagrant: `snapshot save <name>` tries to use snapshot name as machine name

Created on 20 Oct 2019  ยท  5Comments  ยท  Source: hashicorp/vagrant

Vagrant version

2.2.6 (does not happen in 2.2.5)

Host operating system

Ubuntu

Debug output

https://gist.github.com/wolfgang42/976afb5e5db1827bf11a3031b6ff9c15

Expected behavior

$ vagrant snapshot save foo
==> default: Snapshotting the machine as 'foo'...
==> default: Snapshot saved! You can restore the snapshot at any time by
==> default: using `vagrant snapshot restore`. You can delete it using
==> default: `vagrant snapshot delete`.

Actual behavior

$ vagrant snapshot save foo
The machine with the name 'foo' was not found configured for
this Vagrant environment.
bug commansnapshot has-pr regression

Most helpful comment

Hi @briancain, thanks for responding. In 2.2.5 our workflow controlled snapshots for whole multi-machine environment at once, keeping them in sync. A simple vagrant snapshot save/restore label applied to all guests at once. Should [vm-name] really be required? If so, how about a vagrant snapshot save * label?

All 5 comments

I have run into the same issue. My configuration is a multi-machine Vagrantfile on Windows.

This regression was introduced in #11097. If I revert those changes to save.rb then the save command works as expected.

Hi @staylorftr -If you're running in a multi-guest environment with Vagrant, you must pass the vm-name to take a snapshot. Especially in a multi-machine environment, the [vm-name] should be a required parameter.

@wolfgang42 - OK, that makes sense. For now you should be able to simply pass default to the snapshot command to get it to save a snapshot. If there is only one guest in the environment, we can make the guest name optional.

Hi @briancain, thanks for responding. In 2.2.5 our workflow controlled snapshots for whole multi-machine environment at once, keeping them in sync. A simple vagrant snapshot save/restore label applied to all guests at once. Should [vm-name] really be required? If so, how about a vagrant snapshot save * label?

@staylorftr - I noticed that it functions that way....I'll be sure to fix it up and also update the command docs so it's clearer it should behave that way. Thanks!

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DreadPirateShawn picture DreadPirateShawn  ยท  3Comments

barkingfoodog picture barkingfoodog  ยท  3Comments

rhencke picture rhencke  ยท  3Comments

RobertSwirsky picture RobertSwirsky  ยท  3Comments

lebogan picture lebogan  ยท  3Comments