Skip to content

Dev: Parsing resource meta attributes dynamically #1424

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

Conversation

liangxin1300
Copy link
Collaborator

@liangxin1300 liangxin1300 commented May 20, 2024

With the latest pacemaker version (since 2.1.8),
crmsh can get the resource meta attributes by parsing the output of crm_resource --list-options=primitive --output-as=xml command.

The benefit of this approach:

  • Avoid hardcoding the resource meta attributes
  • Provide help info at interactive mode for each meta attribute
crm(live/alp-1)configure# rsc_defaults maintenance=
maintenance (boolean, [false]): If true, the cluster will not schedule any actions involving the resource
    If true, the cluster will not start, stop, promote, or demote the resource on any node, and will pause any recurring monitors (except those specifying role as "Stopped"). If false, a true value for the maintenance-mode cluster option or maintenance node attribute overrides this.

crm(live/alp-1)configure# primitive d Dummy meta  allow-migrate= 
allow-migrate (boolean): Whether the cluster should try to "live migrate" this resource when it needs to be moved
    Whether the cluster should try to "live migrate" this resource when it needs to be moved. The default is true for ocf:pacemaker:remote resources, and false otherwise.

Note: This PR also supports original way for resource meta if pacemaker doesn't have such option

@liangxin1300 liangxin1300 force-pushed the 20240520_resource_meta_attributes branch from 90906b1 to a9a3c56 Compare May 24, 2024 00:32
Copy link

codecov bot commented May 24, 2024

Codecov Report

Attention: Patch coverage is 65.71429% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 53.75%. Comparing base (ea6db17) to head (06a5332).
Report is 2 commits behind head on master.

Files Patch % Lines
crmsh/ui_configure.py 16.66% 10 Missing ⚠️
crmsh/ra.py 91.66% 1 Missing ⚠️
crmsh/utils.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1424   +/-   ##
=======================================
  Coverage   53.75%   53.75%           
=======================================
  Files          80       80           
  Lines       24059    24091   +32     
=======================================
+ Hits        12932    12951   +19     
- Misses      11127    11140   +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@liangxin1300 liangxin1300 force-pushed the 20240520_resource_meta_attributes branch 2 times, most recently from d4d0a93 to f31b7f6 Compare May 24, 2024 07:28
@liangxin1300 liangxin1300 marked this pull request as ready for review May 24, 2024 08:41
…PED-8249)

With the latest pacemaker version (since 2.1.8),
crmsh can get the resource meta attributes by parsing the output of
`crm_resource --list-options=primitive --output-as=xml` command.

The benefit of this approach:
- Avoid hardcoding the resource meta attributes
- Provide help info at interactive mode for each meta attribute
@liangxin1300 liangxin1300 force-pushed the 20240520_resource_meta_attributes branch from 0f75576 to 06a5332 Compare May 24, 2024 10:06
@liangxin1300 liangxin1300 merged commit b5b23f4 into ClusterLabs:master Jun 4, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants