Skip to content
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

crm configure requires both deprecated and obsoletes params #370

Open
nrwahl2 opened this issue May 14, 2018 · 4 comments
Open

crm configure requires both deprecated and obsoletes params #370

nrwahl2 opened this issue May 14, 2018 · 4 comments
Labels

Comments

@nrwahl2
Copy link

nrwahl2 commented May 14, 2018

If a resource's metadata contains a deprecated param (deprecated="1") and a new one that obsoletes it, and both params have required="1", then crm configure requires both parameters. This is unexpected behavior. Only one or the other param should be specified in the CIB.

Example/reproducer:

# rpm -q crmsh fence-agents-vmware-soap redhat-release-server
crmsh-3.0.0-6.1.noarch
fence-agents-vmware-soap-4.0.11-86.el7.x86_64
redhat-release-server-7.5-8.el7.x86_64

# crm configure
crm(live)configure# primitive vmfence stonith:fence_vmware_soap \
   > params ipaddr=1.2.3.4 login=fence_user passwd=secret_pass pcmk_host_map="node1:node-1;node2:node-2"
crm(live)configure# commit
ERROR: vmfence: required parameter ip not defined
ERROR: vmfence: required parameter username not defined
ERROR: vmfence: required parameter plug not defined
Do you still want to commit (y/n)? n
crm(live)configure# quit
bye

# crm configure
crm(live)configure# primitive vmfence stonith:fence_vmware_soap \
   > params ip=1.2.3.4 username=fence_user passwd=secret_pass plug=dummy_val pcmk_host_map="node1:node-1;node2:node-2"
crm(live)configure# commit
ERROR: vmfence: required parameter ipaddr not defined
ERROR: vmfence: required parameter login not defined
Do you still want to commit (y/n)? n
crm(live)configure# quit
bye

# /usr/sbin/fence_vmware_soap -o metadata | egrep 'name="(ip|ipaddr|login|username|plug|pcmk_host_list)"'
	<parameter name="ipaddr" unique="0" required="1" deprecated="1">
	<parameter name="login" unique="0" required="1" deprecated="1">
	<parameter name="plug" unique="0" required="1" obsoletes="port">
	<parameter name="username" unique="0" required="1" obsoletes="login">
	<parameter name="ip" unique="0" required="1" obsoletes="ipaddr">

If the problem is that the deprecated and obsoletes params should not both have required="1", then I can open an issue or BZ against fence-agents.

A secondary, closely related concern is that this tool requires plug, when pcmk_host_map should take care of that requirement. I am likewise unsure here whether the issue should be against crmsh (for metadata parsing) or fence-agents (for metadata output).

@krig
Copy link
Contributor

krig commented May 14, 2018

I am likewise unsure here whether the issue should be against crmsh (for metadata parsing) or fence-agents (for metadata output).

Possibly both.. the metadata does seem incorrect there, plug probably shouldn't be marked as required. But the other problem is that crmsh lacks support for the deprecated attribute. This will need fixing regardless.

@krig krig added the bug label May 14, 2018
@liangxin1300
Copy link
Collaborator

I'm wandering where does these attributes(required|deprecated|obsoletes) defined? Can you give me a link?:) @nrwahl2

@nrwahl2
Copy link
Author

nrwahl2 commented Jun 1, 2018

@liangxin1300 Are you asking where the meaning is defined or where these attributes are attached to the fence agent? They're attached to the fence agent's attributes in the metadata.

I'm unable to find definitions in the fence-agents repo including the developer doc. However, two key occurrences in the code:

Metadata spec:
https://github.com/ClusterLabs/fence-agents/blob/master/lib/metadata.rng#L17-L23

fencing.py - determines whether attribute has deprecated, obsoletes, or neither:
https://github.com/ClusterLabs/fence-agents/blob/master/lib/fencing.py.py#L581-L587

@liangxin1300
Copy link
Collaborator

hi @nrwahl2 ,
krig has created #322 last year, maybe a solution for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants