[GH-ISSUE #15] cv4pve_autosnap has stopped cleaning up old snapshots #12

Closed
opened 2026-02-26 17:43:55 +03:00 by kerem · 7 comments
Owner

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.

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.
kerem 2026-02-26 17:43:55 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@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

<!-- gh-comment-id:527426248 --> @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
Author
Owner

@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?

<!-- gh-comment-id:527870030 --> @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?
Author
Owner

@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' status

System.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)

<!-- gh-comment-id:527883948 --> @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' status` System.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.<OnExecute>b__0() at Corsinvest.ProxmoxVE.Api.Extension.Utils.Shell.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, TextWriter stdOut, String[] args)
Author
Owner

@franklupo commented on GitHub (Sep 4, 2019):

Hi,
You can send me a list of snapshots that the 518 vm?

Best regards

<!-- gh-comment-id:527888646 --> @franklupo commented on GitHub (Sep 4, 2019): Hi, You can send me a list of snapshots that the 518 vm? Best regards
Author
Owner

@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.

VM_519_snapshots

<!-- gh-comment-id:527904226 --> @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. ![VM_519_snapshots](https://user-images.githubusercontent.com/6999196/64259688-cf4c3e80-cf29-11e9-9689-f687bef303f0.png)
Author
Owner

@franklupo commented on GitHub (Sep 4, 2019):

Hi,
I fixed the error. New version released during the day.

Best regards

<!-- gh-comment-id:527912529 --> @franklupo commented on GitHub (Sep 4, 2019): Hi, I fixed the error. New version released during the day. Best regards
Author
Owner

@franklupo commented on GitHub (Sep 5, 2019):

See new release 1,2.0

Best regards

<!-- gh-comment-id:528369866 --> @franklupo commented on GitHub (Sep 5, 2019): See new release 1,2.0 Best regards
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-autosnap#12
No description provided.