Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1147153

Summary: OCF resources could utilize systemd RemainAfterExit=yes
Product: Red Hat OpenStack Reporter: Ihar Hrachyshka <ihrachys>
Component: openstack-neutronAssignee: Miguel Angel Ajo <majopela>
Status: CLOSED NEXTRELEASE QA Contact: Ofer Blaut <oblaut>
Severity: low Docs Contact:
Priority: low    
Version: 5.0 (RHEL 7)CC: chrisw, fdinitto, lpeer, majopela, nyechiel, oblaut, yeylon
Target Milestone: z4Keywords: Reopened, ZStream
Target Release: 5.0 (RHEL 7)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1180201 (view as bug list) Environment:
Last Closed: 2015-03-23 13:52:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1180201    
Attachments:
Description Flags
RemainAfterExit enabled for oneshot systemd services.
none
RemainAfterExit oneshot systemd scripts fix. none

Description Ihar Hrachyshka 2014-09-27 13:37:31 UTC
In RHEL7-OSP5 and later, we ship the following two OCF resources:
- NetnsCleanup.ocf_ra
- OVSCleanup.ocf_ra

Quoting the headers of the files:

# This file is used/cloned in EL6 + EL7, please upgrade both branches
# when that's necessary.
#
# reason: systemd one-shot scripts only accept the start verb, and
# always report themselves as dead. We need support for that on
# systemd to get rid of this on EL7 + HA/pacemaker.

Actually, systemd supports one-shot scripts that do not report themselves as dead, via RemainAfterExit=yes directive. So instead of copy-pasting those SysV-scripts from EL6, we could utilize systemd feature, avoiding redundant shell code from the package.

Comment 2 Miguel Angel Ajo 2014-10-13 15:57:07 UTC
Good catch!,
Adding support for this, but then we need to change the deployment tools to use back systemd resources before removing this.

Comment 3 Miguel Angel Ajo 2014-10-14 09:14:37 UTC
Checked, and it works at least individually, may need extra testing at integration time with pacemaker.

How to test, (RHEL7 only as this change is RHEL7 only):

1) service neutron-ovs-cleanup start
wait...

2) service neutron-ovs-cleanup status && echo OK
should say active(exited)
then OK at the end.

3) service neutron-ovs-cleanup stop

4) service neutron-ovs-cleanup status
should say (inactive) dead


Repeat for neutron-netns-cleanup


If this doesn't work, step 2 will fail.

Comment 5 Miguel Angel Ajo 2014-10-14 09:21:15 UTC
Created attachment 946777 [details]
RemainAfterExit enabled for oneshot systemd services.

Comment 6 Miguel Angel Ajo 2014-10-15 14:23:55 UTC
Hmmm, I believe now that it won't work for pacemaker, as pacemaker expects that cleanup happens at "start" and also at "stop" time.

neutron-agents-pre (cleanup) are depended by other agents, that makes the -pre to "start" before any agents, and "stop" when all other agents are gone, thus cleaning up (could be wrong here, but the mechanism is +/- this).

So this change wouldn't help to get rid of the OCF resources which actually implement this.

Comment 7 Miguel Angel Ajo 2014-10-15 14:24:55 UTC
Fabio, am I right with comment 6?

Comment 8 RHEL Program Management 2014-10-15 14:35:42 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Comment 9 Fabio Massimo Di Nitto 2014-10-15 14:41:03 UTC
(In reply to Miguel Angel Ajo from comment #7)
> Fabio, am I right with comment 6?

Yes you are correct.

Comment 10 Miguel Angel Ajo 2014-10-15 14:56:43 UTC
Hmmm, I found that this idea works, if we replicate the ExecStart= field of the service definition with an ExecStop= 

I tried this before, but without the RemainAfterExit=

So, it's possible to use it.

Sorry for the noise.

Comment 11 Miguel Angel Ajo 2014-10-15 14:57:10 UTC
needinfo asking for qa_ack+

Comment 12 Fabio Massimo Di Nitto 2014-10-15 15:26:00 UTC
I honestly have no strong opinion on the technical solution (systemd or pacemaker) but since it's working already as-is, while saving a few lines of code is nice, it means propagating lots of change between pacemaker config and puppet that might not be worth at all switching at this stage.

Just 2c.

Comment 13 Miguel Angel Ajo 2014-10-16 07:31:08 UTC
(In reply to Fabio Massimo Di Nitto from comment #12)
> I honestly have no strong opinion on the technical solution (systemd or
> pacemaker) but since it's working already as-is, while saving a few lines of
> code is nice, it means propagating lots of change between pacemaker config
> and puppet that might not be worth at all switching at this stage.
> 
> Just 2c.

Thanks Fabio,

Looking on the deployment side of things I believe you're right and I agree
with you, as we'd bounce deployments back eventually, and I'm not sure how 
well will puppet scripts handle a change from the OCF resources to the 
systemd ones. We ease maintenance, but could be risking already existing deployments, at least that'd require specific QA testing during upgrades.

As it's a tiny change to the already existing .service files, I'd go on with
it, and make it readily available on the packages without bouncing back 
deployment side unless we find a strong reason to do anytime later.

We ship already the service files, and those are used in normal deployments too,
so we may maintain those, and could eventually help.

Comment 14 Ihar Hrachyshka 2014-10-16 10:11:49 UTC
I agree that there is no strong push to replace OCF resources right now, and it's still ok to have those service files updated in case we change our mind in the future.

Comment 15 Miguel Angel Ajo 2014-10-17 08:40:40 UTC
Created attachment 947832 [details]
RemainAfterExit oneshot systemd scripts fix.

Comment 17 Ihar Hrachyshka 2015-03-19 10:51:55 UTC
I wonder whether we even want to have it outside of Delorean (RDO master). Is there any forseable use case for the change? If not, probably it's better to stay conservative with the change and avoid it in RHEL-OSP until Kilo when we get the patch from RDO.

Comment 18 lpeer 2015-03-19 17:15:19 UTC
Miguel - can you check this is available in delorean, if so let's close this bug as we can live without it in rhel-osp.

Comment 19 Miguel Angel Ajo 2015-03-23 13:52:23 UTC
I don't foresee any need for it, since the OCF resource could do the same job. So I guess we are good until Kilo?.

I will close it for now, but we can re-open if we find a good use or another good reason.