Giter VIP home page Giter VIP logo

cv4pve-autosnap's People

Contributors

franklupo avatar nicksmith53 avatar printplaatreparatie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cv4pve-autosnap's Issues

eve4autosnap creates error messages on non snapable images

If you create a backup of all images in a pool, you get errors in proxmox syslog if you have images that are not snapable.

eg: if there is a template image you get errors like:
"TASK ERROR: you can't take a snapshot if it's a template"

if a vm have a disk that is not snapable you get:
TASK ERROR: snapshot feature is not available

the cron job generating these errors looks like:
0 * * * * root eve4pve-autosnap snap --vmid=all --label='hourly' --keep=6 --script='/usr/share/doc/eve4pve-autosnap/examples/script-hook.sh' --syslog

autosnap should not try to snapshot templates, and non snapable images

kind regards
Ronny Aasen

Tool throws CSharp Exception

The tool worked for me for a few days and then stopped working.
I am using proxmox 6.3.3 from no-subscription channel.
In my cluster some nodes are shut down. This is the only obvious thing that might be different for my cluster compared to others.

/opt/cv4pve-autosnap --api-token 'root@pam!XXXXX' --host XXXX --vmid=200,201,202,204 snap --label='4hours' --keep=12 --debug
Method: GET, Url: https://XXXX:8006/api2/json/version
StatusCode:          OK
ReasonPhrase:        OK
IsSuccessStatusCode: True
{
  "data": {
    "version": "6.3-3",
    "keyboard": "de",
    "migration": {
      "type": "secure",
      "network": "192.168.88.1/24"
    },
    "release": "6.3",
    "repoid": "eee5f901"
  }
}
=============================
ACTION Snap
VMs:     200,201,202,204
Label:   4hours
Keep:    12
State:   False
Timeout: 30000
Method: GET, Url: https://XXXX:8006/api2/json/cluster/resources?type=vm
StatusCode:          OK
ReasonPhrase:        OK
IsSuccessStatusCode: True
{
  "data": [
    {
      "template": 0,
      "node": "pve3",
      "id": "qemu/118",
      "uptime": 2386396,
      "cpu": 0.0712415503131878,
      "name": "GITLAB",
      "netout": 156804366320,
      "maxcpu": 4,
      "netin": 12525075186,
      "disk": 0,
      "diskwrite": 372354505728,
      "maxdisk": 107374182400,
      "type": "qemu",
      "mem": 4637929472,
      "status": "running",
      "vmid": 118,
      "diskread": 351669629952,
      "maxmem": 12582912000
    },
    [........ all my VMs .........]
  ]
}
=============================
================ EXCEPTION ================ 
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
'System.Dynamic.ExpandoObject' does not contain a definition for 'name'
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.VMInfo.get_Name()
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.VmCheckIdOrName(VMInfo vm, String idOrNameCheck)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.<>c__DisplayClass3_0.<GetVMs>b__1(VMInfo a)
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVMs(PveClient client, String jolly)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.GetVMs(String vmIdsOrNames)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout)
   at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.<Snap>b__1()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)
================ EXCEPTION ================ 
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
'System.Dynamic.ExpandoObject' does not contain a definition for 'name'
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.VMInfo.get_Name()
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.VmCheckIdOrName(VMInfo vm, String idOrNameCheck)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.<>c__DisplayClass3_0.<GetVMs>b__1(VMInfo a)
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVMs(PveClient client, String jolly)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.GetVMs(String vmIdsOrNames)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout)
   at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.<Snap>b__1()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)

Option to do purge older than keep.

Is there a option to destroy snapshots only?
In case of replication then we should only destroy snapshots on the remote machine.
An option would be good.

There is no show version key.

Hi! Nice to see a new version. Thank you! Because you don't have a deb verison of v1.3.0 I have download binary like this:

wget https://github.com/Corsinvest/cv4pve-autosnap/releases/download/v1.3.0/cv4pve-autosnap-linux-x64.zip

root@osboxes:/tmp# cv4pve-autosnap -?

    ______                _                      __
   / ____/___  __________(_)___ _   _____  _____/ /_
  / /   / __ \/ ___/ ___/ / __ \ | / / _ \/ ___/ __/
 / /___/ /_/ / /  (__  ) / / / / |/ /  __(__  ) /_
 \____/\____/_/  /____/_/_/ /_/|___/\___/____/\__/


Automatic snapshot VM/CT with retention        (Made in Italy)

Automatic snapshot VM/CT with retention

Usage: cv4pve-autosnap [options] [command]

Options:
  -?|-h|--help  Show help information
  --host        The host name host[:port]
  --username    User name <username>@<realm>
  --password    The password. Specify 'file:path_file' to store password in file.
  --vmid        The id or name VM/CT comma separated (eg. 100,101,102,TestDebian)
                -vmid or -name exclude (e.g. -200,-TestUbuntu)
                'all-???' for all VM/CT in specific host (e.g. all-pve1, all-\$(hostname)),
                'all' for all VM/CT in cluster

Commands:
  clean         Remove auto snapshots
  snap          Will snap one time
  status        Get list of all auto snapshots

Run 'cv4pve-autosnap [command] --help' for more information about a command.

Report bugs to [email protected]

I think there is need a key for show verison of program. It can be -V or --version

Best regards, Viktor.

Documentation a bit...lacking?

First I tried cv4pve-tools, then toolbox because after spending HOURS in the cli setting up proxmox and migrating a bunch of VM's I just really wanted something NOT in the cli...

However, this feedback is for all of it.

It goes from the install to configuring backups, nothing about the actual setting up of the tool, how to get your license key, the "IMSI IP" and the "IP" token formatting(an example of how your application wants it implemented would be nice), none of it.

I went to the resources tab on your website and there is nothing, just a broken link, I went to the documentation tab, and it just shows you how to install it.

I have tried to get all that working 4 times now, I just keep wiping the docker containers, when I put in the wrong information(i guess?), the application completely error's out and won't even let me restore backup to try again. I keep having to wipe and reinstall. After 4 times...I'm just done.

And yes I know there is a premium option for support, but spending that time just fiddling with it on a home lab to consider trying to sell it to my workplace is....I'd rather just use Veeam.

I know I am a bit frustrated right now, and I don't mean to sound standoffish, but I guess my feedback is the documentation needs a serious overhaul.

Upgrade from eve4pve-autosnap to cv4pve-autosnap

Hello,
what is the best way to upgrade from eve4pve to cv4pve ?
We have a multi node cluster and i have notice eve4pve doas'nt delete old snap any more..
Maybe:
dpkg -r eve4pve-autosnap_0.1.8_all.deb
dpkg -i cv4pve-autosnap_?.?.?-?_all.deb

hav i to delete the old cron file ? ( /etc/pve/eve/autosnap/eve4pve-autosnap.cron )

Many Thanks

My vm are off 10 seconds during the snapshot

Hello,
i use this crontab command to create a snapshot every 8 hours :

0 /8 * * * cv4pve-autosnap --host=localhost --username=user@pve --password=** --vmid="all" snap --label='8hours' --keep=5

but each snapshot shutdown the vm for 10 seconds, It doesn't matter 10 seconds, but I would like to know if it is possible to have a moment? or if there will always be a latency anyway?

Thanks

===== In execution release:
Version: 1.8.1

===== Last release:
Version: 1.9.5
Published At: 09/28/2020 09:16:59 +00:00
Download Url: https://github.com/Corsinvest/cv4pve-autosnap/releases/download/v1.9.5/cv4pve-autosnap-linux-x64.zip
Release Notes:

New version available: 1.9.5

Exit Code

Hello Daniele,
i have a strange result putting your great script inside a check script:
This is my routine:

if cv4pve-autosnap --host=127.0.0.1 --username=cv4pve@pve --password=xxx--vmid="all" snap --label='daily' --keep=15
then
echo "SNAP created"
else
notify "ERROR-SNAP-CVS"
exit 1
fi

When i put it on my crontab, i hav always the error exit code but the script was executed ..
Thanks!

Problem connection!

My automatic snapshot are broken. I updated Proxmox from 5.4 to 6.1. with these results :
root@nfs1:~# ./cv4pve-autosnap --version

Automatic snapshot VM/CT with retention (Made in Italy)
1.7.2

root@nfs1:~# ./cv4pve-autosnap --host=hostname --username=snapshot-user@pve --password=PASSWORD --debug --vmid=102 status
Method: POST, Url: https://hostname:8006/api2/json/access/ticket
Parameters:
password : PASSWORD
username : snapshot-user
realm : pve
StatusCode: ServiceUnavailable
ReasonPhrase: Service Unavailable
IsSuccessStatusCode: False
Problem connection!

Package versions
proxmox-ve: 6.1-2 (running kernel: 5.3.13-3-pve)
pve-manager: 6.1-7 (running version: 6.1-7/13e58d5e)
pve-kernel-5.3: 6.1-3
pve-kernel-helper: 6.1-3
pve-kernel-5.3.13-3-pve: 5.3.13-3
pve-kernel-4.15.18-24-pve: 4.15.18-52
ceph: 14.2.6-pve1
ceph-fuse: 14.2.6-pve1
corosync: 3.0.3-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.14-pve1
libpve-access-control: 6.0-6
libpve-apiclient-perl: 3.0-2
libpve-common-perl: 6.0-11
libpve-guest-common-perl: 3.0-3
libpve-http-server-perl: 3.0-4
libpve-storage-perl: 6.1-4
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 3.2.1-1
lxcfs: 3.0.3-pve60
novnc-pve: 1.1.0-1
openvswitch-switch: 2.10.0+2018.08.28+git.8ca7c82b7d+ds1-12+deb10u1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-3
pve-cluster: 6.1-4
pve-container: 3.0-19
pve-docs: 6.1-4
pve-edk2-firmware: 2.20191127-1
pve-firewall: 4.0-10
pve-firmware: 3.0-4
pve-ha-manager: 3.0-8
pve-i18n: 2.0-4
pve-qemu-kvm: 4.1.1-2
pve-xtermjs: 4.3.0-1
qemu-server: 6.1-5
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.3-pve1

My old installation with cv4pve-autosnap.1.2.0.debian-x64.deb does not work also.

root@nfs1:~# cv4pve-autosnap --host=hostname --username=snapshot-user@pve --password=PASSWORD --debug --vmid=102 status
Method: POST, Url: https://hostname:8006/api2/json/access/ticket
Parameters:
password : PASSWORD
username : snapshot-user
realm : pve
StatusCode: ServiceUnavailable
ReasonPhrase: Service Unavailable
IsSuccessStatusCode: False
================ EXCEPTION ================
Newtonsoft.Json.JsonReaderException
Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Corsinvest.ProxmoxVE.Api.ClientBase.ExecuteAction(String resource, HttpMethod method, IDictionary`2 parameters)
at Corsinvest.ProxmoxVE.Api.ClientBase.Login(String userName, String password, String realm)
at Corsinvest.ProxmoxVE.Api.ClientBase.Login(String userName, String password)
at Corsinvest.ProxmoxVE.Api.Extension.Utils.Shell.CommandOptionExtension.ClientTryLogin(CommandLineApplication command)
at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.CreateApp(CommandLineApplication parent) in C:\Users\Daniele\source\repos\OpenSource\ProxmoxVE\cv4pve-autosnap\src\dotnet\Corsinvest.ProxmoxVE.AutoSnap\ShellCommands.cs:line 32
at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass4_1.b__1() in C:\Users\Daniele\source\repos\OpenSource\ProxmoxVE\cv4pve-autosnap\src\dotnet\Corsinvest.ProxmoxVE.AutoSnap\ShellCommands.cs:line 69
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)

What is wrong?

Autosnap does nothing

Hello,
I have installed autosnap in a licensed proxmox 4.4.
The command:

eve4pve-autosnap snap --vmid=all --label='daily' --keep=10

gives no output

The command:

eve4pve-autosnap snap --vmid=104 --label='daily' --keep=10

gives:
ERROR: VM 104 - Unknown tecnology

What can I do?
Thanks,
Mario

Thank you!

Hi,

It's not really a ticket but I just wanted to say thank you for this useful script! Very handy!

Keep up the good work please!

Skip snapshot when disk going full

Hi there,

Thank for awesome tool, but in proxmox when a disk got full, all QMEMU/LXC instance will get Pause due to I/O error so to avoid when snapshot cause disk getting full, can we have a feature like skip snapshot when disk is over 95% capacity?

save RAM on or off?

thanks a lot for cv4pve-autosnap!

Is there a way to turn saving RAM on or off?
Since this can be selected in the Web-Gui while saving Live-Snapshots.

aborts with error "System.AggregateException"

Today it aborted with this error:

# /usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username=snapshot@pve --password='MYPass' --vmid=all snap --label='daily' --keep=14 --state
ACTION Snap
VMs:   all
Label: daily
Keep:  14
State: True
----- VM 104 -----
Create snapshot: autodaily200820013035
VM execution 00:04:01.3424864
----- VM 105 -----
Create snapshot: autodaily200820013436
================ EXCEPTION ================
System.AggregateException
One or more errors occurred. (An error occurred while sending the request.)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Corsinvest.ProxmoxVE.Api.PveClientBase.ExecuteAction(String resource, MethodType methodType, IDictionary`2 parameters)
   at Corsinvest.ProxmoxVE.Api.PveClientBase.TaskIsRunning(String node, String task)
   at Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinish(String node, String task, Int64 wait, Int64 timeOut)
   at CallSite.Target(Closure , CallSite , PveClient , String , Object , Int32 , Int64 )
   at Corsinvest.ProxmoxVE.Api.Extension.ResultExtension.WaitForTaskToFinish(Result result, VMInfo vm, Int64 timeout)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.Snapshots.Create(String name, String description, Boolean state, Int64 timeout)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout)
   at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.<Snap>b__1()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)
# /usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username=snapshot@pve --password='MYPass' --vmid=all snap --label='daily' --keep=14 --state
ACTION Snap
VMs:   all
Label: daily
Keep:  14
State: True
----- VM 104 -----
Create snapshot: autodaily200820014343
VM execution 00:01:36.5933939
----- VM 105 -----
Create snapshot: autodaily200820014520
VM execution 00:01:41.4674355
----- VM 106 -----
Create snapshot: autodaily200820014701
VM execution 00:01:15.2446069
----- VM 107 -----
Create snapshot: autodaily200820014816
================ EXCEPTION ================
System.AggregateException
One or more errors occurred. (An error occurred while sending the request.)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Corsinvest.ProxmoxVE.Api.PveClientBase.ExecuteAction(String resource, MethodType methodType, IDictionary`2 parameters)
   at Corsinvest.ProxmoxVE.Api.PveClientBase.TaskIsRunning(String node, String task)
   at Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinish(String node, String task, Int64 wait, Int64 timeOut)
   at CallSite.Target(Closure , CallSite , PveClient , String , Object , Int32 , Int64 )
   at Corsinvest.ProxmoxVE.Api.Extension.ResultExtension.WaitForTaskToFinish(Result result, VMInfo vm, Int64 timeout)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.Snapshots.Create(String name, String description, Boolean state, Int64 timeout)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout)
   at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.<Snap>b__1()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)

What could be the problem?

I run it from latest ProxmoxVE.

exit 0 when vm is locked

Hi all. I have use this perfect script. It looks like a very good solution but there is a small problem...

When VM status is locked there is no any kind of altert about it.

For example,

Tru lock a VM like this:

qm set 20009 --lock backup

Run a command like this:

root@osboxes:~# cv4pve-autosnap --host myhost --username root@pam --password=xxx --vmid 20009 snap --label='bar' --keep=2
ACTION Snap 
VMs:   20009
Label: bar 
Keep:  2 
State: False
----- VM 20009 -----
VM 20009 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent
Create snapshot: autobar191008075027
root@osboxes:~# echo $?
0

In cluster log we have an error because vm is locked. There is no create a snap for that vm but script runs without an error...

Please fix that because proxmox can lock vm e.g. during backup, and unlock in again in some cases...

Best regard, Viktor. Thank alot for you job!

Use on Docker

How would one use this on crontab-ui? I've downloaded cv4pve-autosnap to the docker container, but it's unable to execute it since it's running with busybox. In order from cron to work it seem it would need to execute cv4pve-autosnap locally somehow.

Any tips how to set this up would be great.

UnicodeDecodeError while trying to remove a snap when accentuated characters in old snap description

I got the following error while testing autosnap on my LXC containers.

Traceback (most recent call last):
  File "/root/proxmox-autosnap/proxmox-autosnap.py", line 119, in <module>
    remove_snapsot(vmid=k, virtualization=v, label=argp.label, keep=argp.keep, mute=argp.mute)
  File "/root/proxmox-autosnap/proxmox-autosnap.py", line 25, in create_pid
    return func(*args, **kwargs)
  File "/root/proxmox-autosnap/proxmox-autosnap.py", line 68, in remove_snapsot
    snapshots = run_command([virtualization, 'listsnapshot', vmid])
  File "/root/proxmox-autosnap/proxmox-autosnap.py", line 35, in run_command
    return {'status': True, 'message': out.decode('utf-8').rstrip()}
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 45: invalid continuation byte

It's due to the fact that one of my containers has already a snap with accentuated characters in the comment.

Once the accentuated character removed, the process runs smoothly

Problems on Proxmox 6.2

Hi,

I try to run the tool locally on my Proxmox server but I am running in connection issues.

This is what I have tried:

/usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username=snap@pve --password=pwd --vmid=all snap --label='daily' --keep=7
/usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username=snap@pve --password=pwd --vmid=all snap --label='weekly' --keep=4
/usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username=snap@pve --password=pwd --vmid=all snap --label='monthly' --keep=2

/usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username=root@pam --password=pwd --vmid=all snap --label='daily' --keep=7
/usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username=root@pam --password=pwd --vmid=all snap --label='weekly' --keep=4
/usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username=root@pam --password=pwd --vmid=all snap --label='monthly' --keep=2

Everytime I get an "Problem connection!" message.

I also tried to use localhost or the regular IP.

There is no example how to work with script agrument

Please post an example in a doc how to use script argument with env like $CV4PVE_AUTOSNAP_VMID

I think a linux example will be very nice! Thank a lot!

Can you post an example here too, please? I don't know how to use that.

Best regard, Viktor.

does not work with proxmox ve 6.0

root@cv4pve:~# cv4pve-autosnap --host=10.10.90.50 --username=root@pam --password=[PW] --vmid=800 status
================ EXCEPTION ================
System.Exception
Problem connection!
at Corsinvest.ProxmoxVE.Api.Extension.Shell.Utils.CommandOptionExtension.ClientTryLogin(CommandLineApplication command)
at Corsinvest.ProxmoxVE.Api.Extension.App.AutoSnap.ShellCommand.CreateApp(CommandLineApplication autosnapCmd)
at Corsinvest.ProxmoxVE.Api.Extension.App.AutoSnap.ShellCommand.<>c__DisplayClass7_1.b__1()
at McMaster.Extensions.CommandLineUtils.CommandLineApplicationExtensions.<>c__DisplayClass9_0.b__0()
at Corsinvest.ProxmoxVE.Api.Extension.Shell.Utils.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, TextWriter std
Out, String[] args)

VM sometimes remain locked "snapshot-delete" status

Hi there,
I'm using your utility, running in crontab this command everynight:
cv4pve-autosnap --host=localhost --username=xxxxxxx --password=yyyyyyyy --timeout=8600 --vmid="all" snap --label='daily' --keep=7

Works everything since a lot of months except that, sometimes, on large disks VMs (for example VM with 2 Tb hdu), when it should purge old snapshots, it goes in error and vm status remain locked with "snapshot-delete" status. In also, old snapshot remains in "delete" status, it doesn't get deleted e I have to remove it manually with force switch.

In this state, VM is still running, but we cannot obviously do next snapshots in the next night, or even a vm backup.
So we must monitor every morning VM status and correct manually when this happens.

To fix this problem I use these commands:
qm unlock
qm delsnapshots "snapshots-name" -f

Our Proxmox filesystem is the old, but still reliable, directory filesystem over phisical hard disks, using qcow2 as vm file format.

Host is killed / pool filled up by snapshot creation when free zfs space is lower than written bytes in dataset?

We had a crash of a whole host in our cluster (proxmox 6.2), in the following scenario:

  • Running different VMs on the host
  • the free disk space was about 2 TB
  • largest VM dataset consumes 2 TB
  • on day X, the left free space was lower than the written space of the dataset of which a snapshot was taken
  • just at the moment when the snapshot was taken, free space, was completely absorbed by the snapshot
  • the snapshot itself showed a size of 0B - after deleting the not really taken snapshot there was 1TB additional space
  • Later we realized that at this point other 0-byte snapshots were taken that consumed as much as the original data set from which the snapshot was taken.
  • Please have a look at the statistics on the picture - nothing happens all week - but on this particular day, the disk space on the hard drive implodes the moment the snapshots were taken.

We have not yet reconstructed the scenario - it is only a guess... but the impact was really deep...

grafik

Snapshot is not created

I'm using proxmox 6.2

I'm running the script on the host itself (just for now, untill we have another server available to put the script on).

I'm running this command:

/usr/sbin/cv4pve-autosnap --host='localhost' --api-token='MY TOKEN' --vmid='101' snap --label='daily' --keep=14 --debug

This is the output:

Method: GET, Url: https://localhost:8006/api2/json/version
StatusCode:          OK
ReasonPhrase:        OK
IsSuccessStatusCode: True
{
  "data": {
    "version": "6.2-11",
    "keyboard": "fr-be",
    "release": "6.2",
    "repoid": "22fb4983"
  }
}
=============================
ACTION Snap
VMs:     101
Label:   daily
Keep:    14
State:   False
Timeout: 30000
Method: GET, Url: https://localhost:8006/api2/json/cluster/resources?type=vm
StatusCode:          OK
ReasonPhrase:        OK
IsSuccessStatusCode: True
{
  "data": []
}
=============================
Total execution 00:00:00.0246552

The connection is OK, but the snapshot was not created. I'm not sure why... the VM is online.

Snapshots are not deleted automaticaly

Hi. After latest updates installation from no-subscription repository no snapshots are deleted after "eve4pve-autosnap snap" execution with "keep" parameter enabled. Checked log files and there are only snapshot creation entries, no errors.
On Proxmox machine with enterprise repository everything works like it should.

Trouble on Cloudlinux VPS KVM istance

Using eve4 to snap a Cloudlinux istance, the freeze option
cause filesystem lock.. it becomes read only.
We have tested it on 8 Server ( ZFS Filesystem )
The Web interface snap or replication snap are safe.
My question is, why do you use "freeze" ?
Is it possible to disable it and perform a standard zfs snapshot ?


Versione Italina:
Ciao Ragazzi, sempre molte grazie per il vostro tool veramente utilissimo.
Lo stiamo testando su 8 nodi Proxmox 5 (ZFS) ultima versione ma sulle istanze Cloudlinux ci causa un problema al kernel, che va in Read Only.
Gli snapshot fatti a riga di comando, via interfaccia web o quelli eseguiti dalle repliche sono OK.
Abbiamo notato che eve usa un opzione di freeze del Filesystem del VPS... e sembra questa la causa.
Forse è usato per renderlo compatibile con LVM ?.. sarebbe possibile poterlo disabilitare ?

Grazie!

Change Timestamp String to be Compatible with Unix date Timestamp

I have setup an SMB fileserver in an LXC container. My problem is that i cannot use these timestamps in the samba vfs shadow_copy2 module, because that need a 4-digit year string with some "_" separators to be compatible.

An example of this is the following: autohourly_20201213_193822
|
| -> name,"" separator, 4-digit year, 2-digit month, 2-digit day, "" separator, 2-digit hour,
2-digit minute, 2-digit second.

when using "--vmid=all" fails at different VM's might make it one host or three hosts before failing, but does not continue with other VM's

================ EXCEPTION ================
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
'System.Dynamic.ExpandoObject' does not contain a definition for 'data'
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at CallSite.Target(Closure , CallSite , Object )
at Corsinvest.ProxmoxVE.Api.PveClientBase.TaskIsRunning(String node, String task)
at Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinish(String node, String task, Int64 wait, Int64 timeOut)
at CallSite.Target(Closure , CallSite , PveClient , String , Object , Int32 , Int64 )
at Corsinvest.ProxmoxVE.Api.Extension.ResultExtension.WaitForTaskToFinish(Result result, VMInfo vm, Boolean wait)
at Corsinvest.ProxmoxVE.Api.Extension.VM.Snapshots.Remove(Snapshot snapshot, Boolean wait)
at Corsinvest.ProxmoxVE.AutoSnap.Commands.SnapshotsRemove(VMInfo vm, String label, Int32 keep)
at Corsinvest.ProxmoxVE.AutoSnap.Commands.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state)
at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass6_1.b__1()
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.b__0(CancellationToken _)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Corsinvest.ProxmoxVE.Api.Extension.Helpers.Shell.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, TextWriter stdOut, String[] args)

provide deb-package in continuity

I would like to thank the developer(s) for the efforts and the availability of a stable tool for autosnap as an addition to the proxmox VE for a long time. I appreciate the new efforts.

Apparently the new version of the tool provides static binaries only and heavily relies on Dotnet. I am aware there are open source claims of the .NET Foundation and the Technical Steering Group involved. I do not want to question there may be good cause and some business reasons to join such efforts.

Nevertheless, I would appreciate if you could provide deb-packages in continuity.

QEMU Agent enabled but not recognized v1.1.2

Hi, the latest release, always show the warning of QEMU Agent not enabled, on both windows and linux VM:

VM XXX consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent

VM500 - W10 Pro, Latest QEMU-GA
VM800 - Debian 10 apt'd get qemu-ga
VM900 - Ubuntu lxc container

ACTION Snap 
VMs:   all  
Label: Daily 
Keep:  7 
State: False
----- VM 500 -----
VM 500 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent
Create snapshot: autoDaily190904155355
----- VM 800 -----
VM 800 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent
Create snapshot: autoDaily190904155408
----- VM 900 -----
Create snapshot: autoDaily190904155409

EDIT:

After some digging, i've found that the error show up only if the option "Run guest-trim after clone disk" it's enabled

Exclude VMs from mask

Hello,

First of all, thank you for amazing tool!

Is it possible to exclude certain VMs from 'all'?

Thanks,
ignaqui

Problem connection! no tokenid specified

Hello. Cannot create snapshot. What i do wrong?

root@proxmox:~# /usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --api-token='cv4pve@pve!cv4pve' --timestamp-format=yyMMddss --vmid='1005' snap --label='-daily-' --keep=3
Problem connection! no tokenid specified

Taking a snapshot of virtual machine ranges

I have a logical division of virtual machines into ranges, like windows 101-110, linux 201-220, etc. is it possible to make the pictures can be indicated by the range? Example

/usr/local/bin/pve-autosnap --host=127.0.0.1 --username=root@pam --password=MySecretPassword --vmid='111-119,202-205,302-304' snap --label='-daily-' --keep=1

when zfs dataset is busy the code leaves a vm or ct in lock-delete mode.

issue with version 1.2.0 So when a zfs sync is taking longer than the snapshot interval then zfs blocks deletion of snapshots.
cv4pve autosnapshot then leaves the all containers in locked mode preventing taking new snapshots.

We want to keep taking new snapshots so the code needs to detect fail due to dataset busy and unlock the vm after posting delete fail task.

cv4pve_autosnap has stopped cleaning up old snapshots

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.

Change Naming of the snapshots

Hello,

first of all, tanks to all contributes for this project.

Now my problem: Is there any way to change the naming of the snapshots? Currently they are named after autodaily%y%m%d%H%M. However, I would like to change it to auto-daily-%Y-%m%d-%H%M e.g.

Installation Error - Missing dependencies

Hello,

I tried installing this on my Proxmox host (v. 6.0-5) and receive the following dependency errors that I cannot figure out how to resolve.

None of the missing dependencies have any installation candidates.

root@prox1-R610:~# dpkg -i cv4pve-autosnap.1.1.1.debian-x64.deb
Selecting previously unselected package cv4pve-autosnap.
(Reading database ... 54863 files and directories currently installed.)
Preparing to unpack cv4pve-autosnap.1.1.1.debian-x64.deb ...
Unpacking cv4pve-autosnap (1.1.1) ...
dpkg: dependency problems prevent configuration of cv4pve-autosnap:
 cv4pve-autosnap depends on liblttng-ust0; however:
  Package liblttng-ust0 is not installed.
 cv4pve-autosnap depends on libssl0.9.8 | libssl1.0.0 | libssl1.0.1 | libssl1.0.2; however:
  Package libssl0.9.8 is not installed.
  Package libssl1.0.0 is not installed.
  Package libssl1.0.1 is not installed.
  Package libssl1.0.2 is not installed.

dpkg: error processing package cv4pve-autosnap (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 cv4pve-autosnap

Any suggestions?

On a side note, should this be installed on the Proxmox host or another local server?

Thanks,
Mike

rpm package do not install under Centos 7

Hi i have try to install cv4pve-autosnap.1.2.0.linux-x64.rpm, but rpm exit with error:

rpm -Uvh cv4pve-autosnap.1.2.0.linux-x64.rpm
warning: cv4pve-autosnap.1.2.0.linux-x64.rpm: Header V3 RSA/SHA256 Signature, key ID 811c1468: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:cv4pve-autosnap-1.2.0-0          ################################# [100%]
error: unpacking of archive failed on file /usr/sbin/cv4pve-autosnap;5d7a460c: cpio: Unknown file type

README installation instructions

The README.md provides a section on Configuration and Use that is incorrect:

Download package eve4pve-autosnap_?.?.?-?_all.deb, on your Proxmox VE host and install:

wget https://github.com/EnterpriseVE/eve4pve-autosnap/releases/latest
dpkg -i eve4pve-autosnap_?.?.?-?_all.deb

(The latest file contains a pointer to the downloadable deb, not the archive itself.) Here are instructions that work for me:

wget https://github.com/$(wget -qO- https://github.com/EnterpriseVE/eve4pve-autosnap/releases/latest | grep -Po '(?<="/).*\.deb(?=")')
dpkg -i eve4pve-autosnap_?.?.?-?_all.deb

Error after enabling TFA in Proxmox host

cv4pve-autosnap was working flawlessly until 2FA was enabled. It's running from a local machine inside the same network.

Here is the command and the result:

cv4pve-autosnap --host=10.0.1.1 --username=root@pam --password=PASSWORD --vmid="100" snap --label='mediodía' --keep=1 --debug

Method: POST, Url: https://10.0.1.1:8006/api2/json/access/ticket
Parameters:
password : PASSWORD
username : root
realm : pam
StatusCode: OK
ReasonPhrase: OK
IsSuccessStatusCode: True
{
"data": {
"clustername": "Cluster",
"NeedTFA": 1,
"username": "root@pam",
"CSRFPreventionToken": "5F11EA78:aSSo+iNEUzoVR4xrBagTdHqdBdRAKXiXSxjUqmD5u80",
"ticket": "PVE:tfa!root@pam:5F11EA78::iOsiFA3xER3OncdByrFziOwnefCm92JDWKoQU4/vbDO0Fu0S1s+tbBRud/k8wXd7DesBjoyL7z5jUKHizPMtEjUIS0b06sgeXtbbK/V7tN/FdGEPeQ357tI8wymLeoTAfwCL1UruSyl6jczDE1x3kTAwDOdRsa/jXZc7clLT1+rgIL32EsTob8swtgo883QgSglfhaXFspfvDRjvVF9L8XsCa3ofPPJlnL8kvw5EadebUnzFCRFamALczAHsBAmKrAqt/eoWW+v0VKb3BDb1h8L6rA2zhz/Ic3r+O/iYKj2cy0opNZQUN0mWIPOqwUCmhAK1rSY/C9MyUXtZupZaew=="
}
}

ACTION Snap
VMs: 100
Label: mediodia
Keep: 1
State: False
Phase: snap-job-start
Method: GET, Url: https://10.0.1.1:8006/api2/json/cluster/resources?type=vm
StatusCode: Unauthorized
ReasonPhrase: No ticket
IsSuccessStatusCode: False
null

================ EXCEPTION ================
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
'System.Dynamic.ExpandoObject' does not contain a definition for 'data'
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVMs(PveClient client)
at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVMs(PveClient client, String jolly)
at Corsinvest.ProxmoxVE.AutoSnap.Commands.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state)
at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass6_1.b__1()
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.b__0(CancellationToken _)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Corsinvest.ProxmoxVE.Api.Extension.Helpers.Shell.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, TextWriter stdOut, String[] args)

cv4pve in /etc/cron.d , won't auto start

OS: debian 9
PVE Version: pve-manager/5.4-10/9603c337
cv4pve version: 1.7.2

I changed backup method from eve4pve to cv4pve couple days ago.
using the same way , add a file in /etc/cron.d , with almost the same content , except the snapshot command.
but cv4pve wont take snapshot at the specified time in crontab.
I have no idea why .
I could run the command in prompt without problems , but it just won' start in crontab

here is /etc/cron.d/cv4pve-autosnap

2020-04-17 11:19:46 [root@hqs030 ~]$ cat /etc/cron.d/cv4pve-autosnap 
MAILTO="[email protected]"
#ansible
0 2 * * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_"
#build
0 3 1 * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 100 snap --keep 3 --label "_kw_build_"
2020-04-17 11:22:12 [root@hqs030 ~]$

in /var/log/cron.log , it shows the command already been executed.

Apr 16 23:00:01 hqs030 CRON[23813]: (root) CMD (tar czvf "/usr/local/backup/pve_\$(date '+%Y-%m-%d').tgz" /etc/pve)
Apr 17 02:00:01 hqs030 CRON[5722]: (root) CMD (cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_")

but pve didnt see the sanpshot.

2020-04-17 11:24:56 [root@hqs030 cron.d]$ qm listsnapshot 101
`-> init_ansiblecontrol         2019-07-15 10:15:17     no-description
    `-> before_upgrade_ansible_to_27 2019-07-19 11:29:56     no-description
`-> auto_kw_ansible_200415110438 2020-04-15 11:04:39     cv4pve-autosnap
    `-> current                                         You are here!
2020-04-17 11:25:37 [root@hqs030 cron.d]$ 

any suggestions ??

snap failed

proxmox version 6.0-4
cv4pve-autosnap version v1.11.0

I can login web by 192.168.0.28:8006

image

I don't know why, is it the problem of connection or password or others?

inverted commas in example

Generated following the example:
cv4pve-autosnap --host=192.168.1.230 --username=root@pam --password=XXXXXX --vmid=500 snap --label='daily' --keep=2 at Windows machine.

The result is as follows:
ACTION Snap
VMs: 500
Label: 'daily'
Keep: 2
State: False
Timeout: 30000
Timestamp format: yyMMddHHmmss
----- VM 500 Qemu -----
Create snapshot: auto'daily'210919215747
snapname : invalid format - invalid configuration ID 'auto'daily'210919215747'

The removal of ' (inverted commas) solved the problem. I suggest to edit the sample script by removing the inverted commas.
The inverted commas are redundant. The commas are useful for the phrases containing spaces, yet it is unlikely that Proxmox would be ok with the snapshot names with spaces anyway. Even if it does, it is still not a good idea to put spaces into the snapshot name, so it should be discouraged.

Process all VMs from a pool

It would be good to process all VMs from a specified pool.
For example something like this:

cv4pve-autosnap --vmid="@Poolname"

Problem after upgrade Proxmox to v6

Hi there,
we've a problem with cv4pve-autosnap after upgrading to Proxmox v6.0.7 (coming from 5.4.13 that was working perfectly).

When we try to do anything, even just using "status" command, we get an exception error. We attach ths error here below.
errore cv4pve.txt

Best regards,
Paolo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.