If "name" isn't specified, it inherits the name from the referenced nvpair.
It's very convenient if there are plenty of resources' parameters that are supposed to have same values.
Could I see a real-world example?
For example, we have an IPaddr2 resource that has the parameter ip="220.127.116.11". There could be quite a few other resources would like to reference the same IP address value, while they might have different parameter keys, like "host", "service_ip" and so on.
So referencing the original instance_attributes doesn't help because the new location might need the value supplied with a different name, eg. other-ip vs. ip. Is that the idea?
Because otherwise you can just split up the original attributes into shared and non-shared and use [instance-attributes id-ref="shared-ones"/]
Exactly the idea :-) And we think it's not uncommon that they have different parameter names
nvset.rng is used everywhere, even in 1.0.rng. So I added a separate nvset-nvpair-ref.rng for this, and only enabled it for resource instance attributes in 1.1.rng for now.
Any reason to limit it to just resources? The code works for everywhere right?
Yes, it works for everywhere. I was thinking resource instance attributes is the mostly used case. Do you prefer enabling it everywhere?
Its potentially easier to document - an admin would probably expect to use it anywhere.
Can you imagine any legitimate use outside of resources?
Would someone want to use a resource's attribute as a global crm_config or rsc_defaults? Inside of resources, probably it could be used also for utilization and meta_attributes. There seems to be no harm to enable it everywhere.
If we enable it everywhere, do you think it'd be better to move the old nvset.rng to nvset-1.0.rng for use of pacemaker-1.0, and to patch nvset.rng with the new feature, so that pacemaker-1.1 and pacemaker-1.2 will get it. So we use the best naming for latest stuff.
The current commits support idref in nvpair everywhere. Moved the old nvset.rng to nvset-1.0.rng
Feature: pengine: Support id-ref in nvpair with optional "name"
If "name" isn't specified, it inherits the name from the referenced
Test: pengine: Support id-ref in nvpair with optional "name"
Rebased. Hope I did the schema in the right way ;-) I guess we'd better move the old nvset.rng to nvset-1.0.rng when the feature is added for 1.2 schema.