Pacemaker: migrate resource without adding a "prefer" line in config

I know this bit old; but it seems like no one answered this satisfactorily, and the requester never posted if his problem was solved or not. So here is an explanation.

When you perform:

# crm resource migrate r0 node2

a cli-prefer-* rule is created.

Now when you want to move the r0 back to node1, you don't do:

# crm resource migrate r0 node1

but you perform:

# crm resource unmigrate r0

Using umigrate or unmove gets rid of the cli-prefer-* rule automatically.

If you try to delete this rule manually in cluster config, really bad things happen in cluster, or at least bad things happened in my case.