On Thu, Feb 27, 2025 at 11:18 AM <ale...@pavlyuts.ru> wrote: > > Hi All, > > > > We have a project where Pacemaker is under the hood and all the high-level > business-logic managed by external custom software, mostly by reading and > writing cib XML with cibadmin binary. > > > > I need to store some extra properties of the managed resources for these > business-logic handlers. Pacemaker itself need no this data. > > > > I found that if I add custom nvpair element in primitive/meta_attributes to > cib xml and store it with cibadmin –replace it seems to be accepted and > stored in CIB database without problem. And reading back well keeping this > “custom meta-attribute”. > > > > Example: > > <primitive id="vlan-ens18_10-ens18.10" class="ocf" type="iface-vlan" > provider="heartbeat"> > > <meta_attributes id="vlan-ens18_10-ens18.10-meta_attributes"> > > <nvpair id="vlan-ens18_10-ens18.10-meta_attributes-custom" > name="custom" value="true"/> > > </meta_attributes> > > <instance_attributes id="vlan-ens18_10-ens18.10-instance_attributes"> > > <nvpair id="vlan-ens18_10-ens18.10-instance_attributes-vlan_id" > name="vlan_id" value="10"/> > > <nvpair > id="vlan-ens18_10-ens18.10-instance_attributes-vlan_interface" > name="vlan_interface" value="ens18"/> > > <nvpair id="vlan-ens18_10-ens18.10-instance_attributes-vlan_name" > name="vlan_name" value="ens18.10"/> > > </instance_attributes> > > <operations> > > <op name="monitor" interval="10s" timeout="20s" > id="vlan-ens18_10-ens18.10-monitor-interval-10s"/> > > <op name="start" interval="0s" timeout="30s" > id="vlan-ens18_10-ens18.10-start-interval-0s"/> > > <op name="stop" interval="0s" timeout="20s" > id="vlan-ens18_10-ens18.10-stop-interval-0s"/> > > </operations> > > </primitive> > > > > > > But the question is: how valid this action is? For now, for future version? > Is there a chance that some of Pacekeeper internals or utilities wipe it up > or break on it?
Completely valid. This is one of the intended use cases for meta-attributes. From the Pacemaker Explained documentation: "In addition to the cluster-defined meta-attributes described above, you may also configure arbitrary meta-attributes of your own choosing. Most commonly, this would be done for use in rules. For example, an IT department might define a custom meta-attribute to indicate which company department each resource is intended for. To reduce the chance of name collisions with cluster-defined meta-attributes added in the future, it is recommended to use a unique, organization-specific prefix for such attributes." https://clusterlabs.org/projects/pacemaker/doc/3.0/Pacemaker_Explained/singlehtml/#resource-meta-attributes > > > > I will be very grateful for any information on it, thank you in advance! > > > > Sincerely, > > > > Alex > > _______________________________________________ > Manage your subscription: > https://lists.clusterlabs.org/mailman/listinfo/users > > ClusterLabs home: https://www.clusterlabs.org/ -- Regards, Reid Wahl (He/Him) Senior Software Engineer, Red Hat RHEL High Availability - Pacemaker _______________________________________________ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/users ClusterLabs home: https://www.clusterlabs.org/