<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>This question builds on questions I was talking to kgaillot on
IRC.</p>
<p>I am try to prevent a resource from being allowed to migrate to
or start on a given node. When I asked about this, Ken talked
about node attributes, which I've been trying to implement. <br>
</p>
<p>To try to figure this out / test this, I setup an attribute
against a resource called 'srv01-sql' called
'drbd-fenced_srv01-psql' that sets a location constraint of
-INFINITY. I had the resource running on 'mk-a01n01' and then set
'drbd-fenced_srv01-psql=1' to trigger the constraint against
'mk-a01n02'. I verified this was set, then tried migrating it, and
it happily migrated.</p>
<p>Clearly I am missing something. :)<br>
</p>
<p>====<br>
[root@mk-a01n01 ~]# crm_attribute --type nodes --node mk-a01n02
--name drbd-fenced_srv01-sql --query<br>
scope=nodes name=drbd-fenced_srv01-sql value=1<br>
<br>
[root@mk-a01n01 ~]# pcs constraint location config<br>
Location Constraints:<br>
Resource: srv01-sql<br>
Enabled on:<br>
Node: mk-a01n02 (score:100)<br>
Node: mk-a01n01 (score:200)<br>
Constraint: location-srv01-sql<br>
Rule: score=-INFINITY<br>
Expression: drbd-fenced_srv01-sql eq 0<br>
Resource: srv02-web<br>
Enabled on:<br>
Node: mk-a01n02 (score:100)<br>
Node: mk-a01n01 (score:200)<br>
<br>
[root@mk-a01n01 ~]# crm_attribute --type nodes --node mk-a01n02
--name drbd-fenced_srv01-sql --query<br>
scope=nodes name=drbd-fenced_srv01-sql value=1<br>
<br>
[root@mk-a01n01 ~]# pcs resource status srv01-sql<br>
* srv01-sql (ocf::alteeve:server): Started mk-a01n01<br>
<br>
[root@mk-a01n01 ~]# pcs constraint location srv01-sql prefers
mk-a01n02=200 mk-a01n01=100<br>
<br>
[root@mk-a01n01 ~]# pcs resource status srv01-sql<br>
* srv01-sql (ocf::alteeve:server): Migrating mk-a01n01<br>
<br>
[root@mk-a01n01 ~]# pcs resource status srv01-sql<br>
* srv01-sql (ocf::alteeve:server): Started mk-a01n02<br>
====</p>
<p>I feel like this shouldn't be so complicated, so I am likely
over-thinking this, or missing something obvious... <br>
</p>
<pre class="moz-signature" cols="72">--
Madison Kelly
Alteeve's Niche!
Chief Technical Officer
c: +1-647-471-0951
<a class="moz-txt-link-freetext" href="https://alteeve.com/">https://alteeve.com/</a></pre>
</body>
</html>