mirror of
https://github.com/Corsinvest/cv4pve-autosnap.git
synced 2026-04-25 08:55:49 +03:00
[GH-ISSUE #15] cv4pve_autosnap has stopped cleaning up old snapshots #12
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cv4pve-autosnap#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @codesmaker on GitHub (Sep 2, 2019).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/15
Hi,
First of all, I would like to thank you guys for your work on this very useful script.
I've noticed recently that the "cv4pve_autosnap" has stopped removing old snapshots based on the "--keep" option. It seems that it has no effect.
Here is the command I'm running:
`cv4pve-autosnap snap --vmid=514 --label='24hours' --keep=2
2019-09-02 23:26:11 DEBUG: cv4pve-autosnap 0.1.11
2019-09-02 23:26:11 DEBUG: Command line: snap --vmid=514 --label=24hours --keep=2
2019-09-02 23:26:11 DEBUG: ------------------------------------------------------------
2019-09-02 23:26:11 DEBUG: CV4PVE_AUTOSNAP_PHASE: snap-job-start
2019-09-02 23:26:11 DEBUG: CV4PVE_AUTOSNAP_VMID: 514
2019-09-02 23:26:11 DEBUG: CV4PVE_AUTOSNAP_VMTECNOLOGY:
2019-09-02 23:26:11 DEBUG: CV4PVE_AUTOSNAP_LABEL: 24hours
2019-09-02 23:26:11 DEBUG: CV4PVE_AUTOSNAP_KEEP: 2
2019-09-02 23:26:11 DEBUG: CV4PVE_AUTOSNAP_VMSTATE: 0
2019-09-02 23:26:11 DEBUG: CV4PVE_AUTOSNAP_SNAP_NAME: -
2019-09-02 23:26:11 DEBUG: ------------------------------------------------------------
2019-09-02 23:26:12 DEBUG: ------------------------------------------------------------
2019-09-02 23:26:12 DEBUG: CV4PVE_AUTOSNAP_PHASE: snap-create-pre
2019-09-02 23:26:12 DEBUG: CV4PVE_AUTOSNAP_VMID: 514
2019-09-02 23:26:12 DEBUG: CV4PVE_AUTOSNAP_VMTECNOLOGY: qm
2019-09-02 23:26:12 DEBUG: CV4PVE_AUTOSNAP_LABEL: 24hours
2019-09-02 23:26:12 DEBUG: CV4PVE_AUTOSNAP_KEEP: 2
2019-09-02 23:26:12 DEBUG: CV4PVE_AUTOSNAP_VMSTATE: 0
2019-09-02 23:26:12 DEBUG: CV4PVE_AUTOSNAP_SNAP_NAME: auto24hours190902232611
2019-09-02 23:26:12 DEBUG: ------------------------------------------------------------
VM 514 - Creating snapshot auto24hours190902232611
2019-09-02 23:26:12 DEBUG: qm snapshot 514 auto24hours190902232611 -description 'cv4pve-autosnap'
2019-09-02 23:26:14 DEBUG: return 0
2019-09-02 23:26:14 DEBUG: ------------------------------------------------------------
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_PHASE: snap-create-post
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_VMID: 514
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_VMTECNOLOGY: qm
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_LABEL: 24hours
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_KEEP: 2
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_VMSTATE: 0
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_SNAP_NAME: auto24hours190902232611
2019-09-02 23:26:14 DEBUG: ------------------------------------------------------------
2019-09-02 23:26:14 DEBUG: ------------------------------------------------------------
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_PHASE: snap-job-end
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_VMID: 0
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_VMTECNOLOGY:
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_LABEL: 24hours
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_KEEP: 2
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_VMSTATE: 0
2019-09-02 23:26:14 DEBUG: CV4PVE_AUTOSNAP_SNAP_NAME: -
2019-09-02 23:26:14 DEBUG: ------------------------------------------------------------
2019-09-02 23:26:14 DEBUG: Execution: 3 sec.`
It creates a new snapshot but it never deletes.
Thanks a lot for your help.
@franklupo commented on GitHub (Sep 3, 2019):
Hi,
the problem was that the Proxmox Ve developers change the output command. Use another version that uses the native APIs. It can be used externally and works on the whole clustrer.
Best regards
@codesmaker commented on GitHub (Sep 4, 2019):
The script that uses the native API works now. Awesome job!
Since the new script needs a username and password to use the API, do you think it is possible to save the credentials in a file and pass it as an option to the script?
Also, what is the minimum role we can assign to the PVE user in order to be able to snapshot VMs?
@codesmaker commented on GitHub (Sep 4, 2019):
Another issue is that the 'status' option works for some VMs but it doesn't for others. Here is the error message that I'm getting:
cv4pve-autosnap --host=192.168.50.100 --username='test@pve' --password='password' --vmid='518' statusSystem.IndexOutOfRangeException
Index was outside the bounds of the array.
at BetterConsoleTables.Table.ToString(Int32[] columnLengths)
at Corsinvest.ProxmoxVE.AutoSnap.Commands.Status(String vmIdsOrNames, String label) in C:\Users\Daniele\source\repos\OpenSource\ProxmoxVE\cv4pve-autosnap\src\dotnet\Corsinvest.ProxmoxVE.AutoSnap\Commands.cs:line 68
at McMaster.Extensions.CommandLineUtils.CommandLineApplicationExtensions.<>c__DisplayClass9_0.b__0()
at Corsinvest.ProxmoxVE.Api.Extension.Utils.Shell.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, TextWriter stdOut, String[] args)
@franklupo commented on GitHub (Sep 4, 2019):
Hi,
You can send me a list of snapshots that the 518 vm?
Best regards
@codesmaker commented on GitHub (Sep 4, 2019):
Hi Franklupo,
The "518" VM has no snapshots. I have another VM (519) which has one snapshot. When I try to get its status, I get the same error message. Please find attached a picture for the snapshot.
@franklupo commented on GitHub (Sep 4, 2019):
Hi,
I fixed the error. New version released during the day.
Best regards
@franklupo commented on GitHub (Sep 5, 2019):
See new release 1,2.0
Best regards