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

Can't snapshot a VM without disk #79

Closed Impact123 closed 1 year ago

Impact123 commented 1 year ago

What happened?

When attempting to snapshot a VM without a hard disk an error is thrown. Skip VM problem storage space out of 95%

When a disk exists, whether attached or not, it works fine. As you can see below I also have enough space available. A VM without a disk is very rare thing, of course, but since this works perfectly fine via the proxmox GUI I consider this a bug.

Expected behavior

A snapshot should be possible even without a disk attached.

Relevant log output

$ cv4pve-autosnap --host 'xxx' --vmid='104' --username 'xxx' --password 'xxx' snap --label daily --keep 7
ACTION Snap
PVE Version:      8.0.4
VMs:              104
Label:            daily
Keep:             7
State:            False
Only running:     False
Timeout:          30 sec.
Timestamp format: yyMMddHHmmss
Max % Storage :   95%
                  Storage      Type     Valid   Used %    Disk Size  Disk Usage
                pve/local       dir        Ok      13.1    98.25 GB    12.89 GB
             pve/ssdstore   lvmthin        Ok      19.2      800 GB   153.52 GB
----- VM 104 qemu stopped -----
VM 104 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent
Skip VM problem storage space out of 95%
Total execution 00:00:00.1896465


### Proxmox VE Version

8.0.4

### Version (bug)

1.14.8

### Version (working)

_No response_

### On what operating system are you experiencing the issue?

Linux

### Pull Request

- [ ] I would like to do a Pull Request
franklupo commented 1 year ago

Hi, Why vm without disks? You can exclude using "-104" from the vmid parameter.

Best regards

Impact123 commented 1 year ago

This particular VM is mostly used for testing various live distributions. I wanted to still be able to easily revert to older VM settings. It took me a minute to figure out how to build this but it works fine. Thanks!

franklupo commented 1 year ago

I fix the problem

Impact123 commented 1 year ago

You did. I just wanted to let you know that I tested the change and the issue is fixed.