Bug 1947246

Summary: [RFE] oraasm: The oraasm resource agent should manage the specified Oracle ASM diskgroup (RHEL 8)
Product: Red Hat Enterprise Linux 8 Reporter: Reid Wahl <nwahl>
Component: resource-agentsAssignee: Oyvind Albrigtsen <oalbrigt>
Status: ASSIGNED --- QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.3CC: agk, cluster-maint, fdinitto, sbradley
Target Milestone: betaKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 2088962 (view as bug list) Environment:
Last Closed: Type: Feature Request
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: 2088962    

Description Reid Wahl 2021-04-08 04:39:12 UTC
Description of problem:

The oraasm resource agent accepts a diskgroup as a required parameter, but it does nothing to manage that diskgroup directly. It simply starts, stops, and monitors Oracle Clusterware High Availability Services (HAS) (via the ohasd service).

This is problematic for a couple of reasons:
  - It can return a false positive monitoring result when HAS is active but ASM is inactive or the specified diskgroup is not mounted. (See also BZ1786812.)
  - It does not allow the creation of multiple individual oraasm resource agents to manage multiple individual diskgroups. If a user creates two oraasm resource agents, then both of them will simply manage the ohasd service as a whole. This is much less useful than being able to manage one diskgroup per resource. It's also counter-intuitive, as the average user expects the resource to manage the diskgroup that it's configured to manage.

We should overhaul this resource agent, potentially creating a revised "oraasm2" to reflect the significant changes in behavior.

At a high level, what it ought to do appears to be pretty straightforward:
  - Start: Mount the specified diskgroup[1].
  - Stop: Unmount ("dismount" in Oracle's terminology) the specified diskgroup[1].
  - Monitor: If Oracle cluster services are running, check the status of the specified diskgroup (using the `asmcmd lsdg` command[2]).

IMO, the oraasm resource agent should never start or stop the ohasd (Oracle High Availability Services Daemon) service at all. Currently, **all** it does is start, stop, and monitor the ohasd service. It doesn't do anything specific to the diskgroup that it claims to manage. (A user could create a separate LSB-class resource to manage the ohasd service.)

Additionally, `diskgroup` is listed in the RA metadata as a required option. However, it's either ignored or practically ignored:
  - If `home` is set, then `diskgroup` is ignored entirely.
  - If `home` is not set, then `diskgroup` is used to look up a home directory from `/etc/oratab`. Then it's ignored after that.

The monitor operation (checking the status of a diskgroup) can be done with `asmcmd lsdg`. Mounting and unmounting have to be done via SQL commands. That's more complicated, but I hope we'd be able to re-use a lot of the logic from the oracle resource agent.

[1] https://docs.oracle.com/database/121/OSTMG/GUID-4782D609-766B-4686-B5E4-90A8EFC10DEA.htm#OSTMG94155
[2] https://docs.oracle.com/cd/B28359_01/server.111/b31107/asm_util.htm#OSTMG94273

-----

Version-Release number of selected component (if applicable):

resource-agents-4.1.1-68.el8