Corsinvest / cv4pve-autosnap

Automatic snapshot tool for Proxmox VE
https://www.corsinvest.it/cv4pve
GNU General Public License v3.0
413 stars 51 forks source link

Same error trying to snap on proxmox 6.2 #68

Closed JosemirLujambio closed 2 years ago

JosemirLujambio commented 2 years ago

Hello. thanx in advance for your help and for making this extraordinary tool. I am getting an error when snapping on proxmox 6.2. have 5 servers with this version and all of them fails with the same error. Snapping on proxmox 7.2 works fine.

root@server:~# cv4pve-autosnap --host="10.20.20.5" --username=snapuser@pam --password='password' --vmid=103 snap --label=test --state --keep=1 --debug Method: POST, Url: https://10.20.20.5:8006/api2/json/access/ticket Parameters: password : password username : snapuser realm : pam StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": { "username": "snappuser@pam", "CSRFPreventionToken": "63197843:YvIlZMwwtX9fghG3gMThiXqGF90iH+Nf5mxWFXRAlqY", "cap": { "access": {}, "storage": { "Datastore.Allocate": 1, "Datastore.Audit": 1, "Datastore.AllocateSpace": 1 }, "dc": { "Sys.Audit": 1 }, "sdn": {}, "nodes": { "Sys.Console": 1, "Sys.Audit": 1 }, "vms": { "VM.Config.CDROM": 1, "VM.Console": 1, "VM.Backup": 1, "VM.PowerMgmt": 1, "VM.Monitor": 1, "VM.Audit": 1, "VM.Snapshot": 1 } }, "ticket": "PVE:snapuser@pam:63197843::lkHnGtEdMQaKOokPLxw3734KKHMZ8r5NYMKmqmPSpPR275tqx4ejXMS0+Wq76hIwPIcJetKU2FRYVSwJ2fhPnpLTq/UduBuGcA5ieFvz5VvPBGLOtPXsDGyvY44l8H3V+cir8r5a+d9NFx7wSo8lHwCzwpkvwtk26hWocLMtJoxbJQWFXyJRL03LwOOpI4MVR5eKxeW6xF1v2QyORzRzOe7B+6XSYagi/sOc/R6NO03rcf8+tMM6wPOtDx5VWg3XKkNFjqu3vgd9LP/3usiTwRfCavMOhEYp8SywwqMz99elPjik/zBzezlRzb5ZM5s09IE284NVvbkAXj+kyuaGCQ==" } }

ACTION Snap VMs: 103 Label: test Keep: 1 State: True Timeout: 30000 Timestamp format: yyMMddHHmmss Max % Storage : 95% Method: GET, Url: https://10.20.20.5:8006/api2/json/cluster/resources?type=vm StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": [ { "netout": 8145415421, "diskread": 75923569152, "maxdisk": 54760833024, "diskwrite": 30711913472, "vmid": 103, "template": 0, "type": "qemu", "status": "running", "name": "xxx-s03", "mem": 3713068523, "id": "qemu/103", "maxcpu": 2, "netin": 2667255612, "cpu": 0.145460183162257, "disk": 0, "uptime": 1868233, "node": "xxx-svr", "maxmem": 4294967296 }, { "netout": 4392310042, "diskread": 81947025408, "maxdisk": 53687091200, "diskwrite": 62910087168, "vmid": 101, "status": "running", "template": 0, "type": "qemu", "id": "qemu/101", "mem": 3522277376, "name": "xxx-s01", "cpu": 0.0616034730929708, "maxcpu": 4, "netin": 16564351363, "disk": 0, "node": "xxx-svr", "uptime": 1868110, "maxmem": 8589934592 } ] }

Method: GET, Url: https://10.20.20.5:8006/api2/json/cluster/resources?type=storage StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": [ { "maxdisk": 100924641280, "disk": 15425761280, "node": "xxx-svr", "storage": "local", "type": "storage", "status": "available", "shared": 0, "id": "storage/xxx-svr/local" }, { "shared": 0, "id": "storage/xxx-svr/local-lvm", "type": "storage", "status": "available", "node": "xxx-svr", "storage": "local-lvm", "disk": 663019319197, "maxdisk": 1836618612736 } ] }

================ EXCEPTION ================ Microsoft.CSharp.RuntimeBinder.RuntimeBinderException 'System.Dynamic.ExpandoObject' does not contain a definition for 'content' at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.<>cDisplayClass23_0.b1(Object a) at System.Linq.Enumerable.WhereListIterator1.ToArray() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.OrderedEnumerable1.GetEnumerator()+MoveNext() at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 optMaxPercentageStorage) at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>cDisplayClass9_1.b1() at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>cDisplayClass144_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.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args) ================ EXCEPTION ================ Microsoft.CSharp.RuntimeBinder.RuntimeBinderException 'System.Dynamic.ExpandoObject' does not contain a definition for 'content' at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.<>cDisplayClass23_0.b1(Object a) at System.Linq.Enumerable.WhereListIterator1.ToArray() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.OrderedEnumerable1.GetEnumerator()+MoveNext() at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 optMaxPercentageStorage) at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>cDisplayClass9_1.b1() at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>cDisplayClass144_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.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)

franklupo commented 2 years ago

Hi, which version do you use autosnap?

best regards

JosemirLujambio commented 2 years ago

Hello frank, version 1.13.3

franklupo commented 2 years ago

download latest version https://github.com/Corsinvest/cv4pve-autosnap/releases/tag/v1.14.5

JosemirLujambio commented 2 years ago

i updated as suggfested and now i get different error:

root@server:~# cv4pve-autosnap --host=10.20.20.5 --username=snapuser@pam --password='password' --vmid=101 snap --label=test --state --keep=1 --debug dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Login: snapuser@pam dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: POST, Url: https://10.20.20.5/api2/json/access/ticket dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Parameters: password : password username : snapuser realm : pam dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "data": { "cap": { "access": {}, "sdn": {}, "storage": { "Datastore.Allocate": 1, "Datastore.AllocateSpace": 1, "Datastore.Audit": 1 }, "vms": { "VM.Config.CDROM": 1, "VM.Audit": 1, "VM.Monitor": 1, "VM.PowerMgmt": 1, "VM.Console": 1, "VM.Backup": 1, "VM.Snapshot": 1 }, "nodes": { "Sys.Console": 1, "Sys.Audit": 1 }, "dc": { "Sys.Audit": 1 } }, "CSRFPreventionToken": "631A11AA:ThLFxiIQxgJXTso6LTiU6kaajrISDCFgN13BV4XFkdc", "username": "snapuser@pam", "ticket": "PVE:snapuser@pam:631A11AA::TQJkih65skDYE8bmVpnNX8sf/kIGGEkKs17c6YQfHGRiPVZh8/ogAZ5OsfMbrJddXkmEJLq51N3/v0Ae7b3HHb/HZPeGCAyD3VwNINpSQJtslfketPbZ/s+drO8XDPjsQNKxUXXXtg/0UuJxhg8h99BrlKNvaBew6B5bVbC2HWOvMf2BMi3HqYOg/PHHdGVlaZohEpM7Kt7xvugkf0l1t06GYQq2UyMQ1m4gdZBoWfkWKyZc/X7oADwaeYPqfr3qf0ChLTsqF9uQNwb0JLoE73WO3jJdNFpwNrsAOJ6pH+p2sj+9ufKjcU8qUuYF3J1qxirlQa0kqDS6QvvgOasMKg==" } } dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: GET, Url: https://10.20.20.5/api2/json/version dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "data": { "repoid": "b287dd27", "release": "6.2", "version": "6.2-12", "keyboard": "en-us" } } ACTION Snap PVE Version: 6.2-12 VMs: 101 Label: test Keep: 1 State: True Timeout: 30 sec. Timestamp format: yyMMddHHmmss Max % Storage : 95% dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: GET, Url: https://10.20.20.5/api2/json/cluster/resources?type=vm dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "data": [ { "maxdisk": 53687091200, "diskread": 84833408000, "diskwrite": 64613082112, "netout": 4482401755, "disk": 0, "maxmem": 8589934592, "node": "xxx-svr", "uptime": 1907381, "template": 0, "type": "qemu", "status": "running", "vmid": 101, "netin": 16869972435, "maxcpu": 4, "cpu": 0.0662405251201612, "name": "xxx-s01", "mem": 4746559488, "id": "qemu/101" }, { "mem": 3728905198, "name": "xxx-s03", "id": "qemu/103", "maxcpu": 2, "netin": 2750590231, "cpu": 0.137858509844173, "vmid": 103, "template": 0, "type": "qemu", "status": "running", "uptime": 1907503, "node": "xxx-svr", "maxmem": 4294967296, "disk": 0, "netout": 8286949343, "diskwrite": 31386835968, "diskread": 76584864768, "maxdisk": 54760833024 } ] } dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: GET, Url: https://10.20.20.5/api2/json/cluster/resources?type=storage dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "data": [ { "shared": 0, "id": "storage/xxx-svr/local-lvm", "status": "available", "type": "storage", "storage": "local-lvm", "node": "xxx-svr", "disk": 663753966642, "maxdisk": 1836618612736 }, { "shared": 0, "id": "storage/xxx-svr/local", "type": "storage", "status": "available", "storage": "local", "node": "xxx-svr", "maxdisk": 100924641280, "disk": 15426510848 } ] } Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object. at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.<>cDisplayClass23_0.b1(IClusterResourceStorage a) at System.Linq.Enumerable.WhereEnumerableIterator1.ToArray() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.OrderedEnumerable1.GetEnumerator()+MoveNext() at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 maxPercentageStorage) at Corsinvest.ProxmoxVE.AutoSnap.Commands.<>cDisplayClass12_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context) at System.CommandLine.Invocation.InvocationPipeline.<>cDisplayClass4_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass18_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass13_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass22_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass20_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b19_0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass17_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b6_0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<b__0>d.MoveNext()

franklupo commented 2 years ago

what version is it? 6.2????

JosemirLujambio commented 2 years ago

what version is it? 6.2????

Yes, 6.2-12

franklupo commented 2 years ago

You can run the command on the host and attach the result?

pvesh get /cluster/resources -type=storage --output-format json-pretty

best regards

JosemirLujambio commented 2 years ago

ok:

root@xxx-svr:~# pvesh get /cluster/resources -type=storage --output-format json- pretty [ { "disk" : 665223261532, "id" : "storage/xxx-svr/local-lvm", "maxdisk" : 1836618612736, "node" : "xxx-svr", "shared" : 0, "status" : "available", "storage" : "local-lvm", "type" : "storage" }, { "disk" : 15439167488, "id" : "storage/xxx-svr/local", "maxdisk" : 100924641280, "node" : "xxx-svr", "shared" : 0, "status" : "available", "storage" : "local", "type" : "storage" } ]

franklupo commented 2 years ago

ok, in 6.4-13 the json has a new item "content". This i for check the space sotrage.

I think a solutions