[Pacemaker] Migrate/run resource only if m/s resource is master/promoted on target node

Martin Gombač martin at isg.si
Mon Dec 28 13:36:11 UTC 2009


Hi,

i have mostly working Xen + DRBD + Live migration + Resource fencing, 
but here is a slight issue with my crm config.

I want for resource Hosting to migrate to other node only when the drbd 
resource there is primary. I did try to achieve this using ordering (see 
config below). Currently it can happen, that drbd resouce is still in 
slave (secondary) while migration starts. Example:

1. Node1 preferred node for Hosting resource.
2. Shutdown node1 (gracefully).
3. Hosting resouce migrates to node2 works OK.
4. Add fw rule or disconnect DRBD sync cable
5. Start node1.
6. Node is started ms resource cannot be promoted, migration doesn't 
start as expected. Hosting still works.
7. Remove fw rule or replug the cable.
8. DRBD synchronizes but doesn't yet get into primary mode
9. Migration starts.
10. drbd get's promoted
11. Migration finishes
12. Migrated machine is without root disk. :-)

<-Xen already starting/migration
Dec 28 14:03:30 ibm1 kernel: device vif34.0 entered promiscuous mode
Dec 28 14:03:30 ibm1 kernel: ADDRCONF(NETDEV_UP): vif34.0: link is not ready
Dec 28 14:03:30 ibm1 kernel: device vif34.1 entered promiscuous mode
Dec 28 14:03:30 ibm1 kernel: ADDRCONF(NETDEV_UP): vif34.1: link is not ready
Dec 28 14:03:30 ibm1 kernel: vbd vbd-34-2049: 2 creating vbd structure
Dec 28 14:03:31 ibm1 crmd: [14892]: info: do_lrm_rsc_op: Performing 
key=18:31:0:63765da7-95a5-4d8c-91a6-6492a8c3fc2e op=drbd_r0:1_promote_0 )
<-Drbd ginally get's promoted
Dec 28 14:03:31 ibm1 lrmd: [14889]: info: rsc:drbd_r0:1:8: promote
Dec 28 14:03:31 ibm1 lrmd: [14889]: info: RA output: 
(drbd_r0:1:promote:stdout)         allow-two-primaries;
Dec 28 14:03:31 ibm1 kernel: block drbd0: role( Secondary -> Primary )
Dec 28 14:03:31 ibm1 lrmd: [14889]: info: RA output: 
(drbd_r0:1:promote:stdout) 
Dec 28 14:03:31 ibm1 crmd: [14892]: info: process_lrm_event: LRM 
operation drbd_r0:1_promote_0 (call=8, rc=0, cib-update=16, 
confirmed=true) ok
Dec 28 14:03:32 ibm1 crmd: [14892]: info: do_lrm_rsc_op: Performing 
key=58:31:0:63765da7-95a5-4d8c-91a6-6492a8c3fc2e op=drbd_r0:1_notify_0 )
Dec 28 14:03:32 ibm1 lrmd: [14889]: info: rsc:drbd_r0:1:9: notify
Dec 28 14:03:32 ibm1 crm_attribute: [15411]: info: Invoked: 
crm_attribute -N ibm1 -n master-drbd_r0:1 -l reboot -v 100
Dec 28 14:03:32 ibm1 lrmd: [14889]: info: RA output: 
(drbd_r0:1:notify:stdout) 



primitive Hosting ocf:heartbeat:Xen \
    params xmfile="/etc/xen/Hosting.cfg" \
    meta target-role="Started" allow-migrate="true" is-managed="true" \
    op monitor interval="120s" timeout="300s"
primitive drbd_r0 ocf:linbit:drbd \
    params drbd_resource="r0" \
    op monitor interval="15s" role="Master" timeout="30s" \
    op monitor interval="30s" role="Slave" timeout="30"
ms ms_drbd_r0 drbd_r0 \
    meta notify="true" master-max="2" inteleave="true"
location cli-prefer-Hosting Hosting \
    rule $id="cli-prefer-rule-Hosting" inf: #uname eq ibm1
colocation Hosting_on_ms_drbd_r0 inf: Hosting ms_drbd_r0:Master
order ms_drbd_r0_b4_Hosting inf: ms_drbd_r0:promote Hosting

How to require drbd_r0 in master mode, before Hosting resource can 
migrate or start there?
Regards,
M.




More information about the Pacemaker mailing list