[Pacemaker] [PATCH]Bug 2567 - crm resource migrate should support an optional "role" parameter

Dejan Muhamedagic dejanmm at fastmail.fm
Mon Apr 18 18:25:56 UTC 2011


Hi Holger,

On Fri, Apr 08, 2011 at 03:21:31PM +0200, Holger Teutsch wrote:
> On Thu, 2011-04-07 at 12:33 +0200, Dejan Muhamedagic wrote:
> > > New syntax:
> > > -----------
> > > 
> > > crm_resource --move-from --resource myresource --node mynode
> > >    -> all resource variants: check whether active on mynode, then create standby constraint
> > > 
> > > crm_resource --move-from --resource myresource
> > >    -> primitive/group: set --node `current_node`, then create standby constraint
> > >    -> clone/master: refused
> > > 
> > > crm_resource --move-to --resource myresource --node mynode
> > >   -> all resource variants: create prefer constraint
> > > 
> > > crm_resource --move-to --resource myresource --master --node mynode
> > >   -> master: check whether active as slave on mynode, then create prefer constraint for master role
> > >   -> others: refused
> > > 
> > > crm_resource --move-cleanup --resource myresource
> > >   -> zap constraints
> > > 
> > > As we are already short on meaningful single letter options I vote for long options only.
> > > 
> > > Backwards Compatibility:
> > > ------------------------
> > > 
> > > crm_resource {-M|--move} --resource myresource
> > >   -> output deprecation warning
> > >   -> treat as crm_resource --move-from --resource myresource
> > > 
> > > crm_resource {-M|--move} --resource myresource --node mynode
> > >   -> output deprecation warning
> > >   -> treat as crm_resource --move-to --resource myresource --node mynode
> > > 
> > > crm_resource {-U|--unmove} --resource myresource
> > >   -> output deprecation warning
> > >   -> treat as crm_resource --move-cleanup --resource myresource
> > 
> > All looks fine to me.
> > 
> > > For the shell:
> > > Should we go for similar commands or keep "migrate-XXX"
> > 
> > migrate is a bit of a misnomer, could be confused with the
> > migrate operation. I'd vote to leave old migrate/unmigrate
> > as deprecated and introduce just move-from/to/cleanup variants.
> > 
> 
> Deajn & Andrew,
> please find attached the patches that implement these commands for
> review. The require the patch
>  
> Low: lib/common/utils.c: Don't try to print unprintable option values in crm_help
> 
> that I send separately because it is not directly related to the
> movement stuff.
> 
> I think that the preceding discussions were very valuable to fully
> understand issues and implications and I'm confident that the new
> command set is consistent and behaves with predictable outcome.

The shell part seems to be OK, if it works :) In a few usage
messages there's '_' used instead of '-' in command names. Also,
in deprecation messages the part "in the future" can be dropped,
for instance:

> +        common_warning("Deprecation warning: Instead of unmigrate use move-cleanup in the future")

       common_warning("unmigrate is deprecated, use move-cleanup")

Cheers,

Dejan




More information about the Pacemaker mailing list