[ClusterLabs] Antw: OCF agent validation proposal (was Re: fence_scsi no such device)

Kristoffer Grönlund kgronlund at suse.com
Tue Mar 22 11:15:18 CET 2016


Ulrich Windl <Ulrich.Windl at rz.uni-regensburg.de> writes:

>>>> Kristoffer Grönlund <kgronlund at suse.com> schrieb am 22.03.2016 um 09:40 in
>> Incidentally, my plan for today was to create a submit request for
>> resource-agents adding a validation regex for resource parameters, just
>> to see if I could get a discussion going. I'd really like to see
>> something like this as well.
>
> Could you explain why checking parameters with the validate method is
> sufficient. Saying that validate doesn't check the parameters for validity is
> probably not an argument.
> Otherwise I think most parameters have a syntax too complex to check before
> passing it to validate, considering that the default types are unspecific as
> "(string|integer|boolean|time)".
> For example, there is no syntax for a non-negative integer, for a positive
> integer, for a fractional value, for an IPv4 address, for a file name, etc.

I don't really understand what it is you are saying, sorry. The reason I
want parameter validation is for use in user interfaces, where you want
to be able to validate individual parameter values as they are being
entered (to show red/green indication on the field itself). This would
then have to be complemented with a complete validation of the final
configuration to detect problems where each individual parameter may be
valid on its own, but the total configuration is not.

Unfortunately, the "validate-all" call is largely unusable by frontends
since it needs all dependencies running and also needs to run as
root. For example, to validate the configuration of a Filesystem
resource which is configured to mount a filesystem on a DRBD volume
using the "validate-all" call requires mounting the DRBD volume. I'd
rather not have to actually mount the DRBD volume as part of the user
interface validation, and since Hawk doesn't run as root, it would mean
having to ask the user for root privileges to apply any cluster
configuration.

The reason to go with a relatively simple regular expression support is
twofold:

1) Make it easy for agent implementors to add validation to parameters
without having to learn complex or unfamiliar syntax.

2) Make it easy for user interface implementors to parse and apply the
validation.

>
> Regards,
> Ulrich
>
>
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org

-- 
// Kristoffer Grönlund
// kgronlund at suse.com



More information about the Users mailing list