<div dir="ltr"><div><div>Hi,<br>I did a small research on the scripts<br><br>/usr/sbin/fence_vbox<br>def main():<br>...<br>conn = fence_login(options)<br></div><br></div>The fence_loging is scripted in the fencing.py and it should invoke function: _login_ssh_with_identity_file <div><div><br>/usr/share/fence/fencing.py<br>def _login_ssh_with_identity_file:<br>...<br>command = &#39;%s %s %s@%s -i %s -p %s&#39; % \<br>                (options[&quot;--ssh-path&quot;], force_ipvx, options[&quot;--username&quot;], options[&quot;--ip&quot;], \<br>                options[&quot;--identity-file&quot;], options[&quot;--ipport&quot;])<br><br></div><div>There are username and ip parameter used here (not login and ipaddr as in fence description) so I used:<br></div><div><br>pcs stonith create vbox-fencing fence_vbox ip=10.0.2.2 username=AW23321 identity_file=/root/.ssh/id_rsa host_os=windows vboxmanage_path=&quot;/cygdrive/c/Program\ Files/Oracle/VirtualBox/VBoxManage&quot; pcmk_host_map=&quot;nfsnode1:centos1;nfsnode2:centos2&quot; ssh=true inet4_only=true op monitor interval=5 -force<br><br>I still got the same warning in messages:<br>Jul  7 07:52:24 nfsnode1 stonith-ng[6244]: warning: fence_vbox[21564] stderr: [ Unable to connect/login to fencing device ]<br>Jul  7 07:52:24 nfsnode1 stonith-ng[6244]: warning: fence_vbox[21564] stderr: [  ]<br>Jul  7 07:52:24 nfsnode1 stonith-ng[6244]: warning: fence_vbox[21564] stderr: [  ]<br><br></div><div>&quot;Standalone&quot; test is working with the same parameters:<br></div><div>[root@nfsnode1 nfsinfo]# fence_vbox --ip 10.0.2.2 --username=AW23321 --identity-file=/root/.ssh/id_rsa --plug=centos2 --host-os=windows --action=status --vboxmanage-path=&quot;/cygdrive/c/Program\ Files/Oracle/VirtualBox/VBoxManage&quot; -4 -x<br>Status: ON<br><br></div><div>I could use more debug in the scripts.<br><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Pozdrawiam,<br>Arek</div></div></div></div>
<br><div class="gmail_quote">2017-07-06 17:31 GMT+02:00 Ken Gaillot <span dir="ltr">&lt;<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 07/06/2017 10:29 AM, Ken Gaillot wrote:<br>
&gt; On 07/06/2017 10:13 AM, ArekW wrote:<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; It seems that my the fence_vbox is running but there are errors in<br>
&gt;&gt; logs every few minutes like:<br>
&gt;&gt;<br>
&gt;&gt; Jul  6 12:51:12 nfsnode1 fence_vbox: Unable to connect/login to fencing device<br>
&gt;&gt; Jul  6 12:51:13 nfsnode1 stonith-ng[7899]: warning: fence_vbox[30220]<br>
&gt;&gt; stderr: [ Unable to connect/login to fencing device ]<br>
&gt;&gt; Jul  6 12:51:13 nfsnode1 stonith-ng[7899]: warning: fence_vbox[30220]<br>
&gt;&gt; stderr: [  ]<br>
&gt;&gt; Jul  6 12:51:13 nfsnode1 stonith-ng[7899]: warning: fence_vbox[30220]<br>
&gt;&gt; stderr: [  ]<br>
&gt;&gt;<br>
&gt;&gt; Eventually after fome time the pcs status shows Failed Actions:<br>
&gt;&gt;<br>
&gt;&gt; # pcs status --full<br>
&gt;&gt; Cluster name: nfscluster<br>
&gt;&gt; Stack: corosync<br>
&gt;&gt; Current DC: nfsnode1 (1) (version 1.1.15-11.el7_3.5-e174ec8) -<br>
&gt;&gt; partition with quorum<br>
&gt;&gt; Last updated: Thu Jul  6 13:02:52 2017          Last change: Thu Jul<br>
&gt;&gt; 6 13:00:33 2017 by root via crm_resource on nfsnode1<br>
&gt;&gt;<br>
&gt;&gt; 2 nodes and 11 resources configured<br>
&gt;&gt;<br>
&gt;&gt; Online: [ nfsnode1 (1) nfsnode2 (2) ]<br>
&gt;&gt;<br>
&gt;&gt; Full list of resources:<br>
&gt;&gt;<br>
&gt;&gt; Master/Slave Set: StorageClone [Storage]<br>
&gt;&gt;      Storage    (ocf::linbit:drbd):     Master nfsnode1<br>
&gt;&gt;      Storage    (ocf::linbit:drbd):     Master nfsnode2<br>
&gt;&gt;      Masters: [ nfsnode1 nfsnode2 ]<br>
&gt;&gt; Clone Set: dlm-clone [dlm]<br>
&gt;&gt;      dlm        (ocf::pacemaker:controld):      Started nfsnode1<br>
&gt;&gt;      dlm        (ocf::pacemaker:controld):      Started nfsnode2<br>
&gt;&gt;      Started: [ nfsnode1 nfsnode2 ]<br>
&gt;&gt; vbox-fencing   (stonith:fence_vbox):   Started nfsnode1<br>
&gt;&gt; Clone Set: ClusterIP-clone [ClusterIP] (unique)<br>
&gt;&gt;      ClusterIP:0        (ocf::heartbeat:IPaddr2):       Started nfsnode1<br>
&gt;&gt;      ClusterIP:1        (ocf::heartbeat:IPaddr2):       Started nfsnode2<br>
&gt;&gt; Clone Set: StorageFS-clone [StorageFS]<br>
&gt;&gt;      StorageFS  (ocf::heartbeat:Filesystem):    Started nfsnode1<br>
&gt;&gt;      StorageFS  (ocf::heartbeat:Filesystem):    Started nfsnode2<br>
&gt;&gt;      Started: [ nfsnode1 nfsnode2 ]<br>
&gt;&gt; Clone Set: WebSite-clone [WebSite]<br>
&gt;&gt;      WebSite    (ocf::heartbeat:apache):        Started nfsnode1<br>
&gt;&gt;      WebSite    (ocf::heartbeat:apache):        Started nfsnode2<br>
&gt;&gt;      Started: [ nfsnode1 nfsnode2 ]<br>
&gt;&gt;<br>
&gt;&gt; Failed Actions:<br>
&gt;&gt; * vbox-fencing_start_0 on nfsnode1 &#39;unknown error&#39; (1): call=157,<br>
&gt;&gt; status=Error, exitreason=&#39;none&#39;,<br>
&gt;&gt;     last-rc-change=&#39;Thu Jul  6 13:58:04 2017&#39;, queued=0ms, exec=11947ms<br>
&gt;&gt; * vbox-fencing_start_0 on nfsnode2 &#39;unknown error&#39; (1): call=57,<br>
&gt;&gt; status=Error, exitreason=&#39;none&#39;,<br>
&gt;&gt;     last-rc-change=&#39;Thu Jul  6 13:58:16 2017&#39;, queued=0ms, exec=11953ms<br>
&gt;&gt;<br>
&gt;&gt; The fence was created with command:<br>
&gt;&gt; pcs -f stonith_cfg stonith create vbox-fencing fence_vbox ip=10.0.2.2<br>
&gt;&gt; ipaddr=10.0.2.2 login=AW23321 username=AW23321<br>
&gt;&gt; identity_file=/root/.ssh/id_<wbr>rsa host_os=windows<br>
&gt;&gt; pcmk_host_check=static-list pcmk_host_list=&quot;centos1 centos2&quot;<br>
&gt;&gt; vboxmanage_path=&quot;/cygdrive/c/<wbr>Program\<br>
&gt;&gt; Files/Oracle/VirtualBox/<wbr>VBoxManage&quot; op monitor interval=5<br>
&gt;&gt;<br>
&gt;&gt; where centos1 and centos2 are VBox machines names (not hostnames). I<br>
&gt;&gt; used duplicated login/username parameters as it is indicated as<br>
&gt;&gt; required in stonith description fence_vbox.<br>
&gt;&gt;<br>
&gt;&gt; Then I updated the configuration and set:<br>
&gt;&gt;<br>
&gt;&gt; pcs stonith update vbox-fencing  pcmk_host_list=&quot;nfsnode1 nfsnode2&quot;<br>
&gt;&gt; pcs stonith update vbox-fencing<br>
&gt;&gt; pcmk_host_map=&quot;nfsnode1:<wbr>centos1;nfsnode2:centos2&quot;<br>
&gt;&gt;<br>
&gt;&gt; where nfsnode1 and nfsnode2 are the hostnames<br>
&gt;&gt;<br>
&gt;&gt; I&#39;not sure which config is correct but both shows Failed Actions after<br>
&gt;&gt; some time.<br>
&gt;<br>
&gt; You only need one of pcmk_host_list or pcmk_host_map. Use pcmk_host_list<br>
&gt; if fence_vbox recognizes the node names used by the cluster, or<br>
&gt; pcmk_host_map if fence_vbox knows the nodes by other names. In this<br>
&gt; case, it looks like you want to tell fence_vbox to use &quot;centos2&quot; when<br>
&gt; the cluster wants to fence nfsnode2, so your pcmk_host_map is the right<br>
&gt; choice.<br>
&gt;<br>
&gt;&gt; I&#39;ve successfully tested the fence connection to the VBox host with:<br>
&gt;&gt; fence_vbox --ip 10.0.2.2 --username=AW23321<br>
&gt;&gt; --identity-file=/root/.ssh/id_<wbr>rsa --plug=centos2 --host-os=windows<br>
&gt;&gt; --action=status --vboxmanage-path=&quot;/cygdrive/<wbr>c/Program\<br>
&gt;&gt; Files/Oracle/VirtualBox/<wbr>VBoxManage&quot;<br>
&gt;&gt;<br>
&gt;&gt; Why the above configuration work as standalone command and does not<br>
&gt;&gt; work in pcs ?<br>
&gt; Two main possibilities: you haven&#39;t expressed those identical options in<br>
&gt; the cluster configuration correctly; or, you have some permissions on<br>
&gt; the command line that the cluster doesn&#39;t have (maybe SELinux, or file<br>
&gt; permissions, or ...).<br>
<br>
</div></div>Forgot one other possibility: the status shows that the *start* action<br>
is what failed, not a fence action. Check the fence_vbox source code to<br>
see what start does, and try to do that manually step by step.<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
Users mailing list: <a href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a><br>
<a href="http://lists.clusterlabs.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.clusterlabs.org/<wbr>mailman/listinfo/users</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" rel="noreferrer" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" rel="noreferrer" target="_blank">http://www.clusterlabs.org/<wbr>doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://bugs.clusterlabs.org" rel="noreferrer" target="_blank">http://bugs.clusterlabs.org</a><br>
</div></div></blockquote></div><br></div>