ClusterLabs / crmsh

Command-line interface for High-Availability cluster management on GNU/Linux systems.
GNU General Public License v2.0
131 stars 94 forks source link

Detect and upgrade configurations for older pacemaker versions #65

Open krig opened 9 years ago

krig commented 9 years ago

The current version of crmsh doesn't interact well with CIB schemas that are configured to validate with the schema for pacemaker-1.0, for example. It would be useful if crmsh had some means of detecting and upgrading such schemas so that they can be validated with the latest schema.

dmuhamedagic commented 9 years ago

On Thu, Oct 30, 2014 at 04:26:59AM -0700, Kristoffer Grönlund wrote:

The current version of crmsh doesn't interact well with CIB schemas that are configured to validate with the schema for pacemaker-1.0, for example. It would be useful if crmsh had some means of detecting and upgrading such schemas so that they can be validated with the latest schema.

There's the configure schema command. I think it even does CIB verify to see if the CIB is valid with the new schema. IIRC, it doesn't change any element, so "configure commit" is going to complain that nothing changed. Otherwise, I don't think that crmsh should modify schema automatically (though it could suggest it).

krig commented 9 years ago

Ah! I forgot about the configure schema command. I wonder if that actually works, will need to try it :)

I agree that automatically changing the schema is probably not a good idea, but warning about old schemas would be helpful, since as it is you get inscrutable errors from Pacemaker when trying to apply configuration changes instead.

dmuhamedagic commented 9 years ago

On Thu, Oct 30, 2014 at 05:29:33AM -0700, Kristoffer Grönlund wrote:

Ah! I forgot about the configure schema command. I wonder if that actually works, will need to try it :)

It did the last time I tried :) Isn't it covered by the regression tests?

I agree that automatically changing the schema is probably not a good idea, but warning about old schemas would be helpful, since as it is you get inscrutable errors from Pacemaker when trying to apply configuration changes instead.

If you know which schema cannot be supported, then just refuse to run until it gets upgraded (or offer to upgrade it). However, note that that depends not only on the schema, but most probably also on the pacemaker version. IIRC, crmsh used to support all schemas equally well, i.e. you could run the current crmsh with any pacemaker v1.1 (v1.0 is supported only by some older crmsh version which is still part of that pacemaker codebase).

krig commented 9 years ago

Right, the problem in this case was indeed schema pacemaker-1.0: https://bugzilla.suse.com/show_bug.cgi?id=903037

The configure schema command is in fact covered by regression tests, but I don't think it would work in this case either. I will need to check.