In Oracle Database Releases earlier than 12c, an Automatic Storage Management (ASM) instance runs on every node in the cluster, and ASM Cluster File System (ACFS) Service on a node connects to the local ASM instance running on the same host. If the ASM instance on a node were to fail, then the shared Disk Groups and hence ACFS file systems can no longer be accessed on that node.
With introduction of Flex ASM in Oracle 12c, the hard dependency between ASM and its clients has been relaxed and a smaller number of ASM instances need run on a subset of servers in a cluster. In this scenario, when there might be nodes without an ASM instance, a new instance type has been introduced by Flex ASM – ASM proxy instance which gets metadata information from ASM instance on behalf of ACFS. If ASM instance is not available locally, ASM proxy instance connects to other ASM instances over the network to fetch the metadata. Moreover, if the local ASM instance fails, then ASM proxy instance can failover to another surviving ASM instance on a different server resulting in uninterrupted availability of shared storage and ACFS file systems. However, I/O to the underlying storage does not go through Oracle ASM, but goes directly through the Oracle ASM proxy instance. An ASM proxy instance must be running on a node which needs to provide ACFS service.
Figure 1 shows that as an ASM instance is not running on Hub Node 2, ADVM / ACFS services on Hub Node 2l utilize the ASM proxy instance (+APX2) to access the metadata from the remote ASM instance (+ASM1) running on Hub Node 1.
Figure 1.
Flex ASM can be configured on either a standard cluster or a Flex Cluster. When Flex ASM runs on a standard cluster, ASM services can run on a subset of cluster nodes servicing clients across the cluster. When Flex ASM runs on a Flex Cluster, ASM services can run on a subset of Hub Nodes servicing clients across all of the Hub Nodes in the Flex Cluster. Besides, in a flex cluster, only hub nodes can host the ACFS services because hub nodes have direct access to storage.
A Demonstration
To explore how ADVM / ACFS can leverage Flex ASM features, we will use an ASM Flex Cluster that is configured with two hub nodes (host01 and host02). Our first set of tasks is to create an ACFS file system resource.
Check Prerequisites
First, let’s verify that all kernel modules needed for ACFS and ADVM are loaded on both the nodes.
[root@host01 ~]# lsmod |grep oracle oracleacfs 2837904 1 oracleadvm 342512 1 oracleoks 409560 2 oracleacfs,oracleadvm oracleasm 84136 1 [root@host02 ~]# lsmod |grep oracle oracleacfs 2837904 1 oracleadvm 342512 1 oracleoks 409560 2 oracleacfs,oracleadvm oracleasm 84136 1
The ASM Dynamic Volume Manager (ADVM) proxy instance is a special Oracle instance which enables ADVM to connect to Flex ASM and is required to run on the same node as ADVM and ACFS. For a volume device to be visible on a node, an ASM proxy instance must be running on that node. Let’s verify that an ASM proxy instance is running on both the nodes.
[root@host02 ~]# crsctl stat res ora.proxy_advm -t ---------------------------------------------------------------- Name Target State Server State details ---------------------------------------------------------------- Local Resources ---------------------------------------------------------------- ora.proxy_advm ONLINE ONLINE host01 STABLE ONLINE ONLINE host02 STABLE
Create the ADVM Volume
We’ll next modify the compatible.advm attribute of the DATA ASM disk group to enable all the new ASM Dynamic Volume (ADVM) features included in release 12.1, and then create a new volume – VOL1 within the DATA disk group with a volume size of 300 MB.
[grid@host01 root]$ asmcmd setattr -G DATA compatible.advm 12.1.0.0.0 [grid@host01 root]$ asmcmd volcreate -G DATA -s 300m VOL1 [grid@host01 root]$ asmcmd volinfo -G DATA VOL1 Diskgroup Name: DATA Volume Name: VOL1 Volume Device: /dev/asm/vol1-106 State: ENABLED Size (MB): 320 Resize Unit (MB): 32 Redundancy: MIRROR Stripe Columns: 4 Stripe Width (K): 128 Usage: ACFS Mountpath:
Create ACFS File System and Corresponding Mount Point
Now let’s construct an ACFS file system on the newly-created volume VOL1 and also create a mount point on both the nodes to mount the ACFS file system.
[root@host01 ~]# mkfs -t acfs /dev/asm/vol1-106 [root@host01 ~]# mkdir -p /mnt/acfsmounts/acfs1 [root@host02 ~]# mkdir -p /mnt/acfsmounts/acfs1
Configure Cloud File System Resource For ACFS File System
Now using the srvctl commands, we will create an Oracle Cloud File System resource on the volume device VOL1 with the mount point /mnt/acfsmounts/acfs1:
[root@host01 ~]# srvctl add filesystem -m /mnt/acfsmounts/acfs1 -d /dev/asm/vol1-106
[root@host01 ~]# srvctl status filesystem -d /dev/asm/vol1-106
ACFS file system /mnt/acfsmounts/acfs2 is not mounted
[root@host01 ~]# mount | grep vol1
[root@host02 ~]# mount | grep vol1
We need to start the file system resource to mount the ACFS file system.
[root@host01 ~]# srvctl start filesystem -d /dev/asm/vol1-106 [root@host01 ~]# srvctl status filesystem -d /dev/asm/vol1-106 ACFS file system /mnt/acfsmounts/acfs2 is mounted on nodes host01,host02 [root@host01 ~]# mount | grep vol1 /dev/asm/vol1-106 on /mnt/acfsmounts/acfs1 type acfs (rw) [root@host02 ~]# mount | grep vol1 /dev/asm/vol1-106 on /mnt/acfsmounts/acfs1 type acfs (rw)
Verify The Cloud File System Resource
It can be verified that the new Cloud File System is indeed working properly as a small text file created on it from host01 can be successfully accessed from host02.
[root@host01 ~]# echo "Test File on ACFS" > /mnt/acfsmounts/acfs1/testfile.txt [root@host02 asm]# cat /mnt/acfsmounts/acfs1/testfile.txt Test File on ACFS
Leveraging Flex ASM
To demonstrate how ACFS / ADVM leverages these Flex ASM capabilities, let us first have a look at the current state of various cluster resources in our two node cluster.
View Baseline Status of Various Cluster Resources
It can be seen that currently:
- An ASM instance is running on both the nodes
- DATA disk group, volume VOL1 on DATA diskgroup and ACFS file system on VOL1 are all online on both the nodes.
[root@host01 ~]# crsctl stat res ora.asm -t ---------------------------------------------------------------- Name Target State Server State details ---------------------------------------------------------------- Cluster Resources ---------------------------------------------------------------- ora.asm 1 ONLINE ONLINE host01 STABLE 1 ONLINE ONLINE host02 STABLE ---------------------------------------------------------------- [root@host01 ~]# crsctl stat res ora.DATA.dg -t ---------------------------------------------------------------- Name Target State Server State details ---------------------------------------------------------------- Local Resources ---------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE host01 STABLE ONLINE ONLINE host02 STABLE ---------------------------------------------------------------- [root@host01 ~]# crsctl stat res ora.DATA.VOL1.advm -t ---------------------------------------------------------------- Name Target State Server State details ---------------------------------------------------------------- Local Resources ---------------------------------------------------------------- ora.DATA.VOL1.advm ONLINE ONLINE host01 Volume device /dev/a sm/vol1-106 is online,STABLE ONLINE ONLINE host02 Volume device /dev/a sm/vol1-106 is online,STABLE [root@host01 ~]# crsctl stat res ora.data.vol1.acfs NAME=ora.data.vol1.acfs TYPE=ora.acfs.type TARGET=ONLINE , ONLINE STATE=ONLINE on host01, ONLINE on host02
Confirm Flex ASM Proxy Instances
Let’s also verify that ASM proxy instances +APX1 running on host01 and +APX2 running on host02 are using ASM instances +ASM1 and +ASM2 running locally on their corresponding nodes.
SQL> col client_instance_name format a20 col asm_host_name for a20 SELECT DISTINCT i.instance_name asm_instance_name, i.host_name asm_host_name, c.instance_name client_instance_name, c.status FROM gv$instance i, gv$asm_client c WHERE i.inst_id = c.inst_id;
ASM_INSTANCE_NAM ASM_HOST_NAME CLIENT_INSTANCE_NAME STATUS ---------------- -------------------- -------------------- ------------ +ASM1 host01.example.com +APX1 CONNECTED +ASM1 host01.example.com +ASM1 CONNECTED +ASM2 host02.example.com +APX2 CONNECTED
To make ACFS / ADVM leverage Flex ASM capabilities, we can perform a simple test: On stopping the ASM instance on node host02 we should observe that ACFS / ADVM services will continue to run on host02 while utilizing an ASM proxy instance to satisfy metadata requests to a remote ASM instance – in this case, +ASM1 running on host01.
Halt ASM Instance On host02
Let’s halt ASM instance +ASM2 running on node host02.
[root@host01 ~]# srvctl stop asm -n host02 PRCR-1014 : Failed to stop resource ora.asm PRCR-1065 : Failed to stop resource ora.asm CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.DATA.dg', but the force option was not specified [root@host01 ~]# srvctl stop asm -n host02 -f [root@host01 ~]# srvctl status asm ASM is running on host01
Verify Availability of VOL1 On host02
If we now check we’ll find that even though the +ASM2 instance and the DATA disk group are not available on host02, volume VOL1 created on the DATA disk group is still mounted on host02 because of Flex ASM. Node host02 connects to the remote ASM instance +ASM1 running on host01 using its ASM proxy instance +APX2 to access the metadata, and that keeps volume VOL1 online.
[root@host01 ~]# crsctl stat res ora.asm -t ---------------------------------------------------------------- Name Target State Server State details ---------------------------------------------------------------- Cluster Resources ---------------------------------------------------------------- ora.asm 1 ONLINE ONLINE host01 STABLE 2 ONLINE OFFLINE host02 STABLE ---------------------------------------------------------------- [root@host01 ~]# crsctl stat res ora.DATA.dg -t ---------------------------------------------------------------- Name Target State Server State details ---------------------------------------------------------------- Local Resources ---------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE host01 STABLE OFFLINE OFFLINE host02 STABLE ---------------------------------------------------------------- [root@host01 ~]# crsctl stat res ora.DATA.VOL1.advm -t ---------------------------------------------------------------- Name Target State Server State details ---------------------------------------------------------------- Local Resources ---------------------------------------------------------------- ora.DATA.VOL1.advm ONLINE ONLINE host01 Volume device /dev/a sm/vol1-106 is online,STABLE ONLINE ONLINE host02 Volume device /dev/a sm/vol1-106 is online,STABLE
Verify Availability of Cloud File System acfs1 On host02
We can also verify that the file on cloud file system acfs1 is visible from both host01 and host02.
[root@host01 acfs1]# cat /mnt/acfsmounts/acfs1/testfile.txt “Test File on ACFS” [root@host02 asm]# cat /mnt/acfsmounts/acfs1/testfile.txt “Test File on ACFS”
Confirm Flex ASM Proxy Instances
We can also verify that since ASM instance +ASM2 running on host02 is no longer available, ACFS / ADVM leverages Flex ASM and ASM proxy instance +APX2 running on host02 accesses the metadata from remote ASM instance +ASM1 that is running on host01 to access volume VOL1 present on the DATA disk group.
SQL> col client_instance_name format a20
col asm_host_name for a20
SELECT DISTINCT
i.instance_name asm_instance_name,
i.host_name asm_host_name,
c.instance_name client_instance_name,
c.status
FROM gv$instance i, gv$asm_client c
WHERE i.inst_id = c.inst_id;
ASM_INSTANCE_NAM ASM_HOST_NAME CLIENT_INSTANCE_NAME STATUS
---------------- -------------------- -------------------- ------------
+ASM1 host01.example.com +APX1 CONNECTED
+ASM1 host01.example.com +ASM1 CONNECTED
+ASM1 host01.example.com +APX2 CONNECTED
Summary
- A new instance type has been introduced by Flex ASM – ASM proxy instance, which gets metadata information from ASM instance on behalf of ACFS.
- If an ASM instance is not available locally, ASM proxy instance connects to other ASM instances over the network resulting in uninterrupted availability of shared storage and ACFS file systems.
- This provides a much higher degree of flexibility, scalability and availability for file services to clients.
Load comments