<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 27, 2017 at 4:58 PM, Gianluca Cecchi <span dir="ltr"><<a href="mailto:gianluca.cecchi@gmail.com" target="_blank">gianluca.cecchi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail-h5"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 27, 2017 at 4:43 PM, Gianluca Cecchi <span dir="ltr"><<a href="mailto:gianluca.cecchi@gmail.com" target="_blank">gianluca.cecchi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div>I'm trying to use fence_rhevm in a CentOS 6.8 guest that is part of a virtual rhcs cluster</div><div><br></div><div>My sw version for fence_agents inside guest is fence-agents-4.0.15-12.el6.x86<wbr>_64 and I notice that for this particular agent nothing changes also using the latest available package fence-agents-4.0.15-13.el6.x86<wbr>_64.rpm apart</div><div><br></div><div><div>[root@p2vnorasvi1 ~]# diff fence_rhevm /usr/sbin/fence_rhevm</div><div>13c13</div><div>< BUILD_DATE="(built Wed Mar 22 04:24:11 UTC 2017)"</div><div>---</div><div>> BUILD_DATE="(built Tue May 10 22:28:47 UTC 2016)"</div><div>[root@p2vnorasvi1 ~]# </div></div><div><br></div><div>The VM name in oVirt 4.1.1 is p2vorasvi1</div><div><br></div><div>Running this command against the engine I get</div><div><br></div><div><div>[root@p2vnorasvi1 network-scripts]# fence_rhevm -a 10.4.192.43 -l "admin@internal" -p "mypassword" -z --shell-timeout=20 --power-wait=10 -v -o status -n p2vorasvi1</div><div>vms/?search=name%3Dp2vorasvi1</div><div><br></div><div><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"></div><div><html><head></div><div><title>404 Not Found</title></div><div></head><body></div><div><h1>Not Found</h1></div><div><p>The requested URL /api/vms/ was not found on this server.</p></div><div></body></html></div><div><br></div><div><br></div><div>Failed: Unable to obtain correct plug status or plug is not available</div><div><br></div><div>Actually I get the same error even if I put a wrong password....</div><div><br></div></div><div>What am I missing...?</div><div>Do I have to specify DC/cluster if I have more than one, or other parameters?</div><div><br></div><div>Thanks,</div><div>Gianluca</div></div>
</blockquote></div><br></div><div class="gmail_extra"><br></div></div></div><div class="gmail_extra">If I change this in fence_rhevm</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">[root@p2vnorasvi1 sbin]# diff fence_rhevm fence_rhevm.orig </div><div class="gmail_extra">84c84</div><div class="gmail_extra">< <span class="gmail-m_1165617795609213334gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>url += "//" + opt["--ip"] + ":" + str(opt["--ipport"]) + "/ovirt-engine/api/" + command</div><div class="gmail_extra">---</div><div class="gmail_extra">> <span class="gmail-m_1165617795609213334gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>url += "//" + opt["--ip"] + ":" + str(opt["--ipport"]) + "/api/" + command</div><div><br></div><div>I now get 401 unauthorized....</div><div><br></div><div><div>[root@p2vnorasvi1 sbin]# fence_rhevm -a 10.4.192.43 -z -l "admin@internal" -p "mypassword" --shell-timeout=20 --power-wait=10 -v -o status -n p2vorasvi1</div><div>vms/?search=name%3Dp2vorasvi1</div><div><br></div><div><html><head><title>Error</<wbr>title></head><body><wbr>Unauthorized</body></html></div><span class="gmail-"><div><br></div><div>Failed: Unable to obtain correct plug status or plug is not available</div><div><br></div><div><br></div></span><div>[root@p2vnorasvi1 sbin]# </div></div><div><br></div><div>and in engine ssl_access.log</div><div><br></div><div><div>127.0.0.1 - - [27/Apr/2017:16:51:55 +0200] "POST /ovirt-engine/sso/oauth/token HTTP/1.1" 200 153</div><div>10.4.168.91 - - [27/Apr/2017:16:51:55 +0200] "GET /ovirt-engine/api/vms/?search=<wbr>name%3Dp2vorasvi2 HTTP/1.1" 401 71</div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Tried also using v3 in url, this way:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">[root@p2vnorasvi1 sbin]# diff fence_rhevm fence_rhevm.orig </div><div class="gmail_extra">84c84</div><div class="gmail_extra">< <span class="gmail-Apple-tab-span" style="white-space:pre">        </span>url += "//" + opt["--ip"] + ":" + str(opt["--ipport"]) + "/ovirt-engine/api/v3/" + command</div><div class="gmail_extra">---</div><div class="gmail_extra">> <span class="gmail-Apple-tab-span" style="white-space:pre">        </span>url += "//" + opt["--ip"] + ":" + str(opt["--ipport"]) + "/api/" + command</div><div class="gmail_extra">[root@p2vnorasvi1 sbin]# </div><div><br></div><div><div>[root@p2vnorasvi1 sbin]# fence_rhevm -a 10.4.192.43 -z -l "admin@internal" -p "mypassword" --shell-timeout=20 --login-timeout=20 --power-wait=10 -v -o status -n p2vorasvi1</div><div>vms/?search=name%3Dp2vorasvi1</div><div><br></div><div><html><head><title>Error</title></head><body>Unauthorized</body></html></div><div><br></div><div>Failed: Unable to obtain correct plug status or plug is not available</div><div><br></div><div><br></div><div>[root@p2vnorasvi1 sbin]# </div></div><div><br></div></div></div>