[GH-ISSUE #51] Skip snapshot when disk going full #47

Closed
opened 2026-02-26 17:44:09 +03:00 by kerem · 11 comments
Owner

Originally created by @bds-congnguyen on GitHub (Jul 26, 2021).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/51

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?

Originally created by @bds-congnguyen on GitHub (Jul 26, 2021). Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/51 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?
kerem closed this issue 2026-02-26 17:44:09 +03:00
Author
Owner

@franklupo commented on GitHub (Aug 23, 2021):

Hi,
All disks attached to the virtual machine should be checked. Now I think how this functionality can be implemented.

best regards

<!-- gh-comment-id:903786170 --> @franklupo commented on GitHub (Aug 23, 2021): Hi, All disks attached to the virtual machine should be checked. Now I think how this functionality can be implemented. best regards
Author
Owner

@franklupo commented on GitHub (Dec 3, 2021):

Hi,
I want to add a parameter --max-perc-storage to specify any percentage for statrage other than the default 95%.
For each VM I check the disks on which storage it is supported, from the storage I check used if lower percentage. If one of the disks is on a storage out of range, the snapshot of the VM will not be taken and an error will be reported.

What do you think?

best regards

<!-- gh-comment-id:985440884 --> @franklupo commented on GitHub (Dec 3, 2021): Hi, I want to add a parameter --max-perc-storage to specify any percentage for statrage other than the default 95%. For each VM I check the disks on which storage it is supported, from the storage I check used if lower percentage. If one of the disks is on a storage out of range, the snapshot of the VM will not be taken and an error will be reported. What do you think? best regards
Author
Owner

@adrianvg commented on GitHub (Dec 4, 2021):

@franklupo

Is this the error you mention will be reported?
This autosnap is being run on a proxmox cluster node that is 90% full.

ACTION Snap
VMs:              all
Label:            daily
Keep:             1
State:            False
Timeout:          30000
Timestamp format: yyMMddHHmmss
Max % Storage :   95%
================ EXCEPTION ================ 
System.TypeInitializationException
The type initializer for 'Humanizer.Configuration.Configurator' threw an exception.
   at Humanizer.Configuration.Configurator.get_Formatters() in /_/src/Humanizer/Configuration/Configurator.cs:line 37
   at Humanizer.Configuration.Configurator.GetFormatter(CultureInfo culture) in /_/src/Humanizer/Configuration/Configurator.cs:line 101
   at Humanizer.Bytes.ByteSize.GetLargestWholeNumberSymbol(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 72
   at Humanizer.Bytes.ByteSize.ToString(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 231
   at Humanizer.Bytes.ByteSize.ToString() in /_/src/Humanizer/Bytes/ByteSize.cs:line 223
   at BetterConsoleTables.Table.GetColumnLengths()
   at BetterConsoleTables.Table.ToString()
   at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows)
   at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows)
   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.<>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)
<!-- gh-comment-id:986015260 --> @adrianvg commented on GitHub (Dec 4, 2021): @franklupo Is this the error you mention will be reported? This autosnap is being run on a proxmox cluster node that is 90% full. ``` ACTION Snap VMs: all Label: daily Keep: 1 State: False Timeout: 30000 Timestamp format: yyMMddHHmmss Max % Storage : 95% ================ EXCEPTION ================ System.TypeInitializationException The type initializer for 'Humanizer.Configuration.Configurator' threw an exception. at Humanizer.Configuration.Configurator.get_Formatters() in /_/src/Humanizer/Configuration/Configurator.cs:line 37 at Humanizer.Configuration.Configurator.GetFormatter(CultureInfo culture) in /_/src/Humanizer/Configuration/Configurator.cs:line 101 at Humanizer.Bytes.ByteSize.GetLargestWholeNumberSymbol(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 72 at Humanizer.Bytes.ByteSize.ToString(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 231 at Humanizer.Bytes.ByteSize.ToString() in /_/src/Humanizer/Bytes/ByteSize.cs:line 223 at BetterConsoleTables.Table.GetColumnLengths() at BetterConsoleTables.Table.ToString() at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) 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.<>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) ```
Author
Owner

@bds-congnguyen commented on GitHub (Dec 4, 2021):

yes, I've tried with storage usage is 91,5% and --max-perc-storage=90 and return same error

VMs:              @all-pve5
Label:            15min
Keep:             1
State:            False
Timeout:          30000
Timestamp format: yyMMddHHmmss
Max % Storage :   90%
================ EXCEPTION ================ 
System.TypeInitializationException
The type initializer for 'Humanizer.Configuration.Configurator' threw an exception.
   at Humanizer.Configuration.Configurator.get_Formatters() in /_/src/Humanizer/Configuration/Configurator.cs:line 37
   at Humanizer.Configuration.Configurator.GetFormatter(CultureInfo culture) in /_/src/Humanizer/Configuration/Configurator.cs:line 101
   at Humanizer.Bytes.ByteSize.GetLargestWholeNumberSymbol(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 72
   at Humanizer.Bytes.ByteSize.ToString(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 231
   at Humanizer.Bytes.ByteSize.ToString() in /_/src/Humanizer/Bytes/ByteSize.cs:line 223
   at BetterConsoleTables.Table.GetColumnLengths()
   at BetterConsoleTables.Table.ToString()
   at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows)
   at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows)
   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.<>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)```
<!-- gh-comment-id:986046471 --> @bds-congnguyen commented on GitHub (Dec 4, 2021): yes, I've tried with storage usage is 91,5% and --max-perc-storage=90 and return same error ```ACTION Snap VMs: @all-pve5 Label: 15min Keep: 1 State: False Timeout: 30000 Timestamp format: yyMMddHHmmss Max % Storage : 90% ================ EXCEPTION ================ System.TypeInitializationException The type initializer for 'Humanizer.Configuration.Configurator' threw an exception. at Humanizer.Configuration.Configurator.get_Formatters() in /_/src/Humanizer/Configuration/Configurator.cs:line 37 at Humanizer.Configuration.Configurator.GetFormatter(CultureInfo culture) in /_/src/Humanizer/Configuration/Configurator.cs:line 101 at Humanizer.Bytes.ByteSize.GetLargestWholeNumberSymbol(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 72 at Humanizer.Bytes.ByteSize.ToString(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 231 at Humanizer.Bytes.ByteSize.ToString() in /_/src/Humanizer/Bytes/ByteSize.cs:line 223 at BetterConsoleTables.Table.GetColumnLengths() at BetterConsoleTables.Table.ToString() at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) 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.<>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)```
Author
Owner

@franklupo commented on GitHub (Dec 4, 2021):

Hi,
Which version do you use of Proxmox?

<!-- gh-comment-id:986047553 --> @franklupo commented on GitHub (Dec 4, 2021): Hi, Which version do you use of Proxmox?
Author
Owner

@franklupo commented on GitHub (Dec 4, 2021):

@franklupo

Is this the error you mention will be reported? This autosnap is being run on a proxmox cluster node that is 90% full.

ACTION Snap
VMs:              all
Label:            daily
Keep:             1
State:            False
Timeout:          30000
Timestamp format: yyMMddHHmmss
Max % Storage :   95%
================ EXCEPTION ================ 
System.TypeInitializationException
The type initializer for 'Humanizer.Configuration.Configurator' threw an exception.
   at Humanizer.Configuration.Configurator.get_Formatters() in /_/src/Humanizer/Configuration/Configurator.cs:line 37
   at Humanizer.Configuration.Configurator.GetFormatter(CultureInfo culture) in /_/src/Humanizer/Configuration/Configurator.cs:line 101
   at Humanizer.Bytes.ByteSize.GetLargestWholeNumberSymbol(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 72
   at Humanizer.Bytes.ByteSize.ToString(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 231
   at Humanizer.Bytes.ByteSize.ToString() in /_/src/Humanizer/Bytes/ByteSize.cs:line 223
   at BetterConsoleTables.Table.GetColumnLengths()
   at BetterConsoleTables.Table.ToString()
   at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows)
   at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows)
   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.<>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)

No, this is an error. Can execute with --debug optional attach log.

Remember remove password

Best regards

<!-- gh-comment-id:986047897 --> @franklupo commented on GitHub (Dec 4, 2021): > @franklupo > > Is this the error you mention will be reported? This autosnap is being run on a proxmox cluster node that is 90% full. > > ``` > ACTION Snap > VMs: all > Label: daily > Keep: 1 > State: False > Timeout: 30000 > Timestamp format: yyMMddHHmmss > Max % Storage : 95% > ================ EXCEPTION ================ > System.TypeInitializationException > The type initializer for 'Humanizer.Configuration.Configurator' threw an exception. > at Humanizer.Configuration.Configurator.get_Formatters() in /_/src/Humanizer/Configuration/Configurator.cs:line 37 > at Humanizer.Configuration.Configurator.GetFormatter(CultureInfo culture) in /_/src/Humanizer/Configuration/Configurator.cs:line 101 > at Humanizer.Bytes.ByteSize.GetLargestWholeNumberSymbol(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 72 > at Humanizer.Bytes.ByteSize.ToString(IFormatProvider provider) in /_/src/Humanizer/Bytes/ByteSize.cs:line 231 > at Humanizer.Bytes.ByteSize.ToString() in /_/src/Humanizer/Bytes/ByteSize.cs:line 223 > at BetterConsoleTables.Table.GetColumnLengths() > at BetterConsoleTables.Table.ToString() > at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) > at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) > 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.<>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) > ``` No, this is an error. Can execute with --debug optional attach log. Remember remove password Best regards
Author
Owner

@adrianvg commented on GitHub (Dec 5, 2021):

No, this is an error. Can execute with --debug optional attach log.

Remember remove password

Best regards

@franklupo

Attached. Thanks for any insights!

autosnap.log

<!-- gh-comment-id:986223313 --> @adrianvg commented on GitHub (Dec 5, 2021): > No, this is an error. Can execute with --debug optional attach log. > > Remember remove password > > Best regards @franklupo Attached. Thanks for any insights! [autosnap.log](https://github.com/Corsinvest/cv4pve-autosnap/files/7655853/autosnap.log)
Author
Owner

@franklupo commented on GitHub (Dec 5, 2021):

The error is fixed in new version.
Please download last release.

Best rrgards

<!-- gh-comment-id:986223567 --> @franklupo commented on GitHub (Dec 5, 2021): The error is fixed in new version. Please download last release. Best rrgards
Author
Owner

@adrianvg commented on GitHub (Dec 5, 2021):

The error is fixed in new version. Please download last release.

Best rrgards

Just noticed it.
Trying it out. Seems okay so far.
Thanks for the quick fix!

Update:
It's done. No problems. Thank you very much!

<!-- gh-comment-id:986223986 --> @adrianvg commented on GitHub (Dec 5, 2021): > The error is fixed in new version. Please download last release. > > Best rrgards Just noticed it. Trying it out. Seems okay so far. Thanks for the quick fix! Update: It's done. No problems. Thank you very much!
Author
Owner

@bds-congnguyen commented on GitHub (Dec 6, 2021):

Hi there and @franklupo
I think the table of Storage status is not right, since I'm running snapshot only for pve5 but table also show storages of other hosts
also, we should skip check storage if this type of storage is not contains disk images, container like pbs_ohan_backup as below because it's storage of proxmox backup server and contain only VZDump backup file

VMs:              @all-pve5
Label:            15min
Keep:             1
State:            False
Timeout:          30000
Timestamp format: yyMMddHHmmss
Max % Storage :   50%
-----------------------------------------------------------------------                                                                                                           
| Storage               | Valid | Used %  | Max Disk (GB) | Disk (GB) |                                                                                                           
-----------------------------------------------------------------------                                                                                                           
| pve1/backup_ohan      | Ok    | 1.4     | 241200        | 3493      |                                                                                                           
| pve1/data             | Ko    | 72.5    | 3689          | 2676      |                                                                                                           
| pve1/local            | Ok    | 5.6     | 176           | 9         |                                                                                                           
| pve1/pbs_ohan_backup  | Ok    | 13.7    | 275446        | 37738     |                                                                                                                                                                                                               
| pve5/backup_ohan     | Ok    | 1.4     | 241200        | 3493      |                                                                                                           
| pve5/data            | Ko    | 81.9    | 7003          | 5737      |                                                                                                           
| pve5/local           | Ok    | 3.4     | 152           | 5         | ```
<!-- gh-comment-id:986371007 --> @bds-congnguyen commented on GitHub (Dec 6, 2021): Hi there and @franklupo I think the table of Storage status is not right, since I'm running snapshot only for pve5 but table also show storages of other hosts also, we should skip check storage if this type of storage is not contains `disk images`, `container` like `pbs_ohan_backup` as below because it's storage of proxmox backup server and contain only VZDump backup file ```ACTION Snap VMs: @all-pve5 Label: 15min Keep: 1 State: False Timeout: 30000 Timestamp format: yyMMddHHmmss Max % Storage : 50% ----------------------------------------------------------------------- | Storage | Valid | Used % | Max Disk (GB) | Disk (GB) | ----------------------------------------------------------------------- | pve1/backup_ohan | Ok | 1.4 | 241200 | 3493 | | pve1/data | Ko | 72.5 | 3689 | 2676 | | pve1/local | Ok | 5.6 | 176 | 9 | | pve1/pbs_ohan_backup | Ok | 13.7 | 275446 | 37738 | | pve5/backup_ohan | Ok | 1.4 | 241200 | 3493 | | pve5/data | Ko | 81.9 | 7003 | 5737 | | pve5/local | Ok | 3.4 | 152 | 5 | ```
Author
Owner

@franklupo commented on GitHub (Dec 6, 2021):

Ok, in the next release i check the content type of storage and the nodes used for Autosnap.

Best regards

<!-- gh-comment-id:986552323 --> @franklupo commented on GitHub (Dec 6, 2021): Ok, in the next release i check the content type of storage and the nodes used for Autosnap. 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#47
No description provided.