Right permissions to stop VM with "fence_pve"

xtavras

Renowned Member
Jun 29, 2015
31
2
73
Berlin
Hi,

I'm testing "fence_pve" [1] stonith agent right now, it works fine with root@pam user, but not with dedicated one.
I've created new role "Stonith-role" with "VM.PowerMgmt" and "VM.Audit" permissions and attached it to hitman@pam user, I can login with this user in Proxmox GUI and stop/start VM without problem, but using "fence_pve" I'm getting timeout.


Code:
redis1:~# fence_pve --action=reboot --ip=192.168.122.6 --username=hitman@pam --password=secret --plug=100
Failed: Timed out waiting to power OFF

but "status" action actually works

Code:
redis1:~# fence_pve --action=status --ip=192.168.122.6 --username=hitman@pam --password=secret --plug=100
Status: ON

Does anybody knows what missing?


[1] https://www.mankier.com/8/fence_pve
 
I also tried that last year and it was not working. I switch to 'root' and it was working as expected. Please try that.
 
Wireshark has built-in support for decrypting SSL. You only need to supply wirewark with the corresponding SSL private and public keys/certificates and DH session key.
 
LnxBil, yes, I've mentioned it by "without using MITM decryption", because as far I know I need to run wireshark live on server to be able to do that (importing tcpdump dump file wil not work).
 
I did a post-portem analysis of a tcpdump with given SSL certificates, but it was some years ago. It was possible then.
 
my co-worker has fixed the problem, I hope it will be merged here https://github.com/ClusterLabs/fence-agents/pull/75

here is the patch for "fence_pve":


fence_pve_disable_skiplock.patch

Code:
--- fence_pve    2016-05-25 10:25:27.794815427 +0200

+++ fence_pve.modified    2016-05-25 10:25:01.722815492 +0200
@@ -103,7 +103,10 @@
         conn.setopt(pycurl.COOKIE, options["auth"]["ticket"])
         conn.setopt(pycurl.HTTPHEADER, [options["auth"]["CSRF_token"]])
     if post is not None:
-        conn.setopt(pycurl.POSTFIELDS, urllib.urlencode(post))
+        if "skiplock" in post:
+            conn.setopt(conn.CUSTOMREQUEST, 'POST')
+        else:
+            conn.setopt(pycurl.POSTFIELDS, urllib.urlencode(post))
     conn.setopt(pycurl.WRITEFUNCTION, output_buffer.write)
     conn.setopt(pycurl.TIMEOUT, int(options["--shell-timeout"]))
     if options.has_key("--ssl") or options.has_key("--ssl-secure"):
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!