<div dir="ltr">Hi, <div><br></div><div><span style="font-size:12.8px">* It is also possible to configure a monitor to ensure that the resource</span><br style="font-size:12.8px"><span style="font-size:12.8px">is not running on nodes where it&#39;s not supposed to be (a monitor with</span><br style="font-size:12.8px"><span style="font-size:12.8px">role=&quot;Stopped&quot;). You don&#39;t have one of these (which is fine, and common).</span><br></div><div><br></div><div>Can you provide more information/documentation about role=&quot;Stopped&quot;</div><div><br></div><div>And, please, can you explain how VirtualDomain resource agents manages the scenario I&#39;ve presented?</div><div><br></div><div><span style="font-size:12.8px"><i>What happens If I stop pacemaker and corosync services in all nodes and I start them again... ¿will I have all guests running twice?</i></span><br></div><div><br></div><div>Thanks a lot</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-17 16:38 GMT+01: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"><span class="">On 01/17/2017 08:52 AM, Ulrich Windl wrote:<br>
&gt;&gt;&gt;&gt; Oscar Segarra &lt;<a href="mailto:oscar.segarra@gmail.com">oscar.segarra@gmail.com</a>&gt; schrieb am 17.01.2017 um 10:15 in<br>
&gt; Nachricht<br>
&gt; &lt;<a href="mailto:CAJq8taG8VhX5J1xQpqMRQ-9omFNXKHQs54mBzz491_6df9akzA@mail.gmail.com">CAJq8taG8VhX5J1xQpqMRQ-<wbr>9omFNXKHQs54mBzz491_6df9akzA@<wbr>mail.gmail.com</a>&gt;:<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; Yes, I will try to explain myself better.<br>
&gt;&gt;<br>
&gt;&gt; *Initially*<br>
&gt;&gt; On node1 (vdicnode01-priv)<br>
&gt;&gt;&gt; virsh list<br>
&gt;&gt; ==============<br>
&gt;&gt; vdicdb01     started<br>
&gt;&gt;<br>
&gt;&gt; On node2 (vdicnode02-priv)<br>
&gt;&gt;&gt; virsh list<br>
&gt;&gt; ==============<br>
&gt;&gt; vdicdb02     started<br>
&gt;&gt;<br>
&gt;&gt; --&gt; Now, I execute the migrate command (outside the cluster &lt;-- not using<br>
&gt;&gt; pcs resource move)<br>
&gt;&gt; virsh migrate --live vdicdb01 qemu:/// qemu+ssh://vdicnode02-priv<br>
&gt;&gt; tcp://vdicnode02-priv<br>
&gt;<br>
&gt; One of the rules of successful clustering is: If resurces are managed by the cluster, they are managed by the cluster only! ;-)<br>
&gt;<br>
&gt; I guess one node is trying to restart the VM once it vanished, and the other node might try to shut down the VM while it&#39;s being migrated.<br>
&gt; Or any other undesired combination...<br>
<br>
<br>
</span>As Ulrich says here, you can&#39;t use virsh to manage VMs once they are<br>
managed by the cluster. Instead, configure your cluster to support live<br>
migration:<br>
<br>
<a href="http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Pacemaker_Explained/index.html#s-migrating-resources" rel="noreferrer" target="_blank">http://clusterlabs.org/doc/en-<wbr>US/Pacemaker/1.1-pcs/html-<wbr>single/Pacemaker_Explained/<wbr>index.html#s-migrating-<wbr>resources</a><br>
<br>
and then use pcs resource move (which is just location constraints under<br>
the hood) to move VMs.<br>
<br>
What&#39;s happening in your example is:<br>
<br>
* Your VM cluster resource has a monitor operation ensuring that is<br>
running properly on the desired node.<br>
<br>
* It is also possible to configure a monitor to ensure that the resource<br>
is not running on nodes where it&#39;s not supposed to be (a monitor with<br>
role=&quot;Stopped&quot;). You don&#39;t have one of these (which is fine, and common).<br>
<br>
* When you move the VM, the cluster detects that it is not running on<br>
the node you told it to keep it running on. Because there is no<br>
&quot;Stopped&quot; monitor, the cluster doesn&#39;t immediately realize that a new<br>
rogue instance is running on another node. So, the cluster thinks the VM<br>
crashed on the original node, and recovers it by starting it again.<br>
<br>
If your goal is to take a VM out of cluster management without stopping<br>
it, you can &quot;unmanage&quot; the resource.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
&gt;&gt; *Finally*<br>
&gt;&gt; On node1 (vdicnode01-priv)<br>
&gt;&gt;&gt; virsh list<br>
&gt;&gt; ==============<br>
&gt;&gt; *vdicdb01     started*<br>
&gt;&gt;<br>
&gt;&gt; On node2 (vdicnode02-priv)<br>
&gt;&gt;&gt; virsh list<br>
&gt;&gt; ==============<br>
&gt;&gt; vdicdb02     started<br>
&gt;&gt; vdicdb01     started<br>
&gt;&gt;<br>
&gt;&gt; If I query cluster pcs status, cluster thinks resource vm-vdicdb01 is only<br>
&gt;&gt; started on node vdicnode01-priv.<br>
&gt;&gt;<br>
&gt;&gt; Thanks a lot.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2017-01-17 10:03 GMT+01:00 emmanuel segura &lt;<a href="mailto:emi2fast@gmail.com">emi2fast@gmail.com</a>&gt;:<br>
&gt;&gt;<br>
&gt;&gt;&gt; sorry,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; But do you mean, when you say, you migrated the vm outside of the<br>
&gt;&gt;&gt; cluster? one server out side of you cluster?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2017-01-17 9:27 GMT+01:00 Oscar Segarra &lt;<a href="mailto:oscar.segarra@gmail.com">oscar.segarra@gmail.com</a>&gt;:<br>
&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I have configured a two node cluster whewe run 4 kvm guests on.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The hosts are:<br>
&gt;&gt;&gt;&gt; vdicnode01<br>
&gt;&gt;&gt;&gt; vdicnode02<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; And I have created a dedicated network card for cluster management. I<br>
&gt;&gt;&gt; have<br>
&gt;&gt;&gt;&gt; created required entries in /etc/hosts:<br>
&gt;&gt;&gt;&gt; vdicnode01-priv<br>
&gt;&gt;&gt;&gt; vdicnode02-priv<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The four guests have collocation rules in order to make them distribute<br>
&gt;&gt;&gt;&gt; proportionally between my two nodes.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The problem I have is that if I migrate a guest outside the cluster, I<br>
&gt;&gt;&gt; mean<br>
&gt;&gt;&gt;&gt; using the virsh migrate - - live...  Cluster,  instead of moving back the<br>
&gt;&gt;&gt;&gt; guest to its original node (following collocation sets),  Cluster starts<br>
&gt;&gt;&gt;&gt; again the guest and suddenly I have the same guest running on both nodes<br>
&gt;&gt;&gt;&gt; causing xfs corruption in guest.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Is there any configuration applicable to avoid this unwanted behavior?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks a lot<br>
<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>