[GH-ISSUE #22] exit 0 when vm is locked #19

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

Originally created by @GusevVictor on GitHub (Oct 8, 2019).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/22

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!

Originally created by @GusevVictor on GitHub (Oct 8, 2019). Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/22 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!**
kerem 2026-02-26 17:43:59 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@GusevVictor commented on GitHub (Oct 8, 2019):

A small workarround:

 cv4pve-autosnap --host host --username root@pam --password='xxx' --vmid monitor snap --label='bar' --keep=2 --debug|grep 'VM is locked'| while read line ; do echo "FAIL" ; done
 FAIL

You can do any command insted print 'FAIL' word

<!-- gh-comment-id:539528179 --> @GusevVictor commented on GitHub (Oct 8, 2019): A small workarround: ``` cv4pve-autosnap --host host --username root@pam --password='xxx' --vmid monitor snap --label='bar' --keep=2 --debug|grep 'VM is locked'| while read line ; do echo "FAIL" ; done FAIL ``` You can do any command insted print 'FAIL' word
Author
Owner

@franklupo commented on GitHub (Oct 8, 2019):

I have handled errors from the task result.
The output will be:

Error in task: VM is locked (backup)

In the coming days I will release the new version.

Best regards

<!-- gh-comment-id:539591517 --> @franklupo commented on GitHub (Oct 8, 2019): I have handled errors from the task result. The output will be: > Error in task: VM is locked (backup) In the coming days I will release the new version. 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#19
No description provided.