Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exit 0 when vm is locked #22

Closed
GusevVictor opened this issue Oct 8, 2019 · 2 comments
Closed

exit 0 when vm is locked #22

GusevVictor opened this issue Oct 8, 2019 · 2 comments
Labels

Comments

@GusevVictor
Copy link

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!

@GusevVictor
Copy link
Author

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

@franklupo
Copy link
Member

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

@franklupo franklupo added the bug label Oct 8, 2019
franklupo added a commit that referenced this issue Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants