Product SiteDocumentation Site

9.3.4. Resource Migration

Some resources, such as Xen virtual guests, are able to move to another location without lose of state. We call this resource migration and is different from the normal practice of stopping the resource on the first machine and starting it elsewhere.
Not all resources are able to migrate, see the Migration Checklist below, and those that can wont do so in all situations. Conceptually there are two requirements from which the other prerequisites follow:
The cluster is able to accommodate both push and pull migration models by requiring the resource agent to support two new actions: migrate_to (performed on the current location) and migrate_from (performed on the destination).
In push migration, the process on the current location transfers the to the new location where is it later activated. In this scenario, most of the work would be done in the migrate_to action and, if anything, the activation would occur during migrate_from.
Conversely for pull, the migrate_to action is practically empty and migrate_from does most of the work, extracting the relevant resource state from the old location and activating it.
There is no wrong or right way to implement migration for your service, as long as it works. Migration Checklist

  • The resource may not be a clone.
  • The resource must use an OCF style agent.
  • The resource must not be in a failed or degraded state.
  • The resource must not, directly or indirectly, depend on any primitive or group resources.
  • The resources must support two new actions: migrate_to and migrate_from and advertise them in its metadata.
  • The resource must have the allow-migrate meta-attribute set to true (not the default).
If the resource depends on a clone, and at the time the resource needs to be move, the clone has instances that are stopping and instances that are starting, then the resource will be moved in the traditional manner. The Policy Engine is not yet able to model this situation correctly and so takes the safe (yet less optimal) path.