crmsh
crmsh copied to clipboard
Dev: parse: cli_to_xml: populate default monitor/start/stop operations
Changes include:
- Set the default operation values if monitor/start/stop not input in command line
crm(live/15sp4-1)configure# primitive vip IPaddr2 params ip=10.10.10.176
crm(live/15sp4-1)configure# show
node 1: 15sp4-1
primitive vip IPaddr2 \
params ip=10.10.10.176 \
op monitor interval=10s timeout=20s \
op start interval=0s timeout=20s \
op stop interval=0s timeout=20s
- Complete default operation values if miss interval or timeout attributes
crm(live/15sp4-1)configure# primitive vip IPaddr2 params ip=10.10.10.176 op monitor timeout=22s op start timeout=23s
crm(live/15sp4-1)configure# show
node 1: 15sp4-1
primitive vip IPaddr2 \
params ip=10.10.10.176 \
op monitor timeout=22s interval=10s \
op start timeout=23s interval=0s \
op stop interval=0s timeout=20s
- Keep origin configured RA unchanged
crm(live/15sp4-1)configure# show
node 1: 15sp4-1
node 2: 15sp4-2
primitive d Dummy
primitive d2 Dummy \
op monitor interval=10s timeout=20s \
op start interval=0s timeout=20s \
op stop interval=0s timeout=20s
d
was original configured
d2
was configured after applied this PR
- And for sure, the sbd ra will be configured like this after bootstraping:
primitive stonith-sbd stonith:external/sbd \
op monitor interval=3600 timeout=20 \
op start interval=0s timeout=20 \
op stop interval=0s timeout=15
From my impression, I prefer to change the commit title to make the use case it a little more clear, something like,
From
Dev: parse: Populate some default operations when configuring primitive resource
To
Dev: parse: cli_to_xml: populate default monitor/start/stop operations
After updated, it looks like now:
crm(live/15sp4-1)configure# primitive vip IPaddr2 params ip=10.10.10.176
crm(live/15sp4-1)configure# show
node 1: 15sp4-1
primitive vip IPaddr2 \
params ip=10.10.10.176 \
op monitor timeout=20s interval=10s \
op_params depth=0 \
op start timeout=20s interval=0s \
op stop timeout=20s interval=0s
crm(live/15sp4-1)configure# primitive vip IPaddr2 params ip=10.10.10.176 op monitor timeout=22s op start timeout=23s
crm(live/15sp4-1)configure# show
node 1: 15sp4-1
primitive vip IPaddr2 \
params ip=10.10.10.176 \
op monitor timeout=22s interval=10s \
op_params depth=0 \
op start timeout=23s interval=0s \
op stop timeout=20s interval=0s
crm(live/15sp4-1)configure# primitive st ocf:pacemaker:Stateful
crm(live/15sp4-1)configure# show
node 1: 15sp4-1
primitive st ocf:pacemaker:Stateful \
op monitor timeout=20s interval=10s role=Promoted \
op_params depth=0 \
op monitor timeout=20s interval=11s role=Unpromoted \
op_params depth=0 \
op start timeout=20s interval=0s \
op stop timeout=20s interval=0s \
op promote timeout=10s interval=0s \
op demote timeout=10s interval=0s
I'm wondering if just skip depth
since it seems rarely used
Hi @fmherschel, @lpinne Any comment about this PR?
Thanks!