-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sap_ha_pacemaker_cluster: Allow to append manual cluster config to the generated config #922
base: dev
Are you sure you want to change the base?
Conversation
…e generated config
@rob0d |
This specific role has certain limits and will not be able to cover all custom cases. As @marcelmamula already mentioned, just appending the variables in this role is not good enough due to the vars having to follow the correct syntax. It is not safe to do this without quite some effort of syntax validation and such logic, to make sure that what will be fed into Please share more details of your particular use case, so we could assess if it would justify putting effort into this enhancement. Note: The variables section in the README is generated from |
Sorry, I probably should have explained this a bit more/better. The key thing here is that ha_cluster doesn't allow modification of cluster settings. It will always recreate the cluster from scratch. So for any non-standard behaviours or advanced functionality we need to add those to The two typical non-default functions is to add are: Ethmonitor to monitor if the network interface has gone down (see) or checking the network connectivity using the ping agent (see). This is obviously just our usage case, other people may need other functionality. The Ethmonitor is a must if the cluster uses multiple NICs (e.g. a separate heartbeat interface as generally recommended). Everything is fine when this config is put in Unfortunately the order of resources and primitives definitions matter, so if we defined Ethmonitor first (with the location constraints) everything is fine until ha_cluster tries to create the cluster. This fails as the location constraint can't be defined as the resource we are referring to doesn't exist. This is not something ha_cluster or sap_ha_pacemaker_cluster can safely and correctly detect without some serious coding. Therefore I am suggesting that we allow the *_append variables for the user to define additional config on top of what sap_ha_pacemaker_cluster generates. I think that whether we allow user to predefine some config in An example of how I'm using it is below. To test the current behaviour you can just remove the _append and it should run (and then fail during cluster creation) with the current code. sap_ha_cluster_resource_primitives_append:
- id: ethmonitor-ens192
agent: ocf:heartbeat:ethmonitor
instance_attrs:
- attrs:
- name: interface
value: ens192
- name: link_status_only
value: 'true'
sap_ha_cluster_resource_clones_append:
- resource_id: ethmonitor-ens192
sap_ha_cluster_constraints_location_append:
- resource:
id: "grp_{{ sap_system_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }}"
rule: "ethmonitor-ens192 ne 1"
id: "location-grp_{{ sap_system_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }}"
options:
- name: score
value: -INFINITY
- resource:
id: "grp_{{ wdp_system_sid }}_WDP{{ sap_ha_pacemaker_cluster_wdp_instance_nr }}"
rule: "ethmonitor-ens192 ne 1"
id: "location-grp_{{ wdp_system_sid }}_W{{ sap_ha_pacemaker_cluster_wdp_instance_nr }}"
options:
- name: score
value: -INFINITY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rob0d @ja9fuchs
I have tested this code (with changes mentioned in my comments) and it worked.
We should be fine after they are implemented as long as this is marked as experimental functionality.
Readme instructions should be added in Further Information using <details><summary>
so it is available. Example:
<details> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge into append vars
…ations for HA cluster configuration
@marcelmamula @ja9fuchs fixed the readme, updated argument_specs and renamed variables. |
@@ -146,6 +146,22 @@ It is recommended to execute this role together with other roles in this collect | |||
|
|||
<!-- BEGIN Further Information --> | |||
## Further Information | |||
|
|||
### sap_ha_pacemaker_cluster_*_append variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section should be done same as I did it here:
<details> |
<details>
<summary>Appending custom cluster resources</summary>
...
</details>
@marcelmamula @ja9fuchs
This is based on the discussion we had several months ago with @ja9fuchs.
This role generally respects pre-defined ha_cluster* variables and tries to merge the configuration it generates with the content of the pre-defined variables. It works really well, however, in some cases the order of resources is important.
The new variables allow to append a specific cluster configuration AFTER the configuration generated by this role.
I've added information to the README file which explains the behaviour. It's a non-breaking change as it just enhances the functionality without changing anything else.