Skip to content
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

'snapshot delete' does not take 'id' or 'description' #143

Open
daFritz84 opened this issue Jan 18, 2021 · 2 comments
Open

'snapshot delete' does not take 'id' or 'description' #143

daFritz84 opened this issue Jan 18, 2021 · 2 comments

Comments

@daFritz84
Copy link

I already asked this on the snapshot list issue (#133), but it was probably missed:

I tried both the id and the description as a parameter for vagrant snapshot delete. Both did not work and reported an unknown snapshot.

Log:

❯ vagrant snapshot list
==> test1: Retrieving list of snapshots...
==> test1:
                                  id     description                          date
15423774-3dbf-46d8-8b4f-ec66ddc5d383             fun     2021-01-16T13:31:34+01:00
e3fe7587-89ea-4c3c-a22b-380cf48e1fdf           clean     2021-01-16T13:46:57+01:00
==> test2: Retrieving list of snapshots...
==> test2:
                                  id     description                          date
2bf7fdc1-3447-4fde-b815-bf97af4f3d67          notfun     2021-01-16T13:31:55+01:00
❯ vagrant snapshot delete test1 15423774-3dbf-46d8-8b4f-ec66ddc5d383
==> test1: Retrieving list of snapshots...
The snapshot name `15423774-3dbf-46d8-8b4f-ec66ddc5d383` was not found for the
virtual machine `test1`.
❯ vagrant snapshot delete test1 fun
==> test1: Retrieving list of snapshots...
The snapshot name `fun` was not found for the
virtual machine `test1`.

Do I miss something obvious here? @myoung34 @GervaisdeM how did you guys use this command?
From digging into the code base, I believe that vagrant itself does a per line string comparison on the output of snapshot list. I did try this as well, but I also don't get any satisfactory results.

Anyways, if this is indeed a bug and needs to be addressed. What is the prefered name for vagrant snapshot delete?
The id, i.e. the uuid from vagrant snapshot list or the description?

@GervaisdeM
Copy link

I thought this worked when I tested everything, but today's testing confirms that vagrant snapshot delete does not work and I am seeing the same result as you are.

As for which is preferred for identifying snapshots for delete... id seems safest to me, unless perhaps if the machine name were somehow prepended (or appended) to the snapshot name. Or you sort out the snapshot list to only show entries for the machine in question and not the entire cluster.

For most things in vagrant, the id and name are able to be used interchangeably.
eg.
vagrant ssh 5bbf96a or vagrant ssh i7latest_dev (assuming that the i7latest_dev's id is 5bbf96a)

@daFritz84
Copy link
Author

My fix for snapshot list has been merged so only snapshots of vagrant managed VMs are shown.

On the one hand, id has the advantage of being guaranteed unique while being bulky to handle (i.e., non human friendly naming, rather long). It maybe also less friendly for scripting, since the id is generated by ovirt and not something the user can define in his script (i.e., the id has to be looked up). On the other hand the description is a chosen identifier by a human, so there is some meaning behind it (semantics). But it maybe bulky as well (i.e. whole sentence) and is not guranteed to be unique.

I think I will go forth and create a PR based on the id for now. Maybe I can find a way to accept both id and description as this would be the optimal solution. However I have no control about the string comparison algorithm as this is done in vagrant and not in the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants