AFD Configuration and Error ASMCMD-9520: AFD is not 'supported'

Hello Friend's,

In this post we will disscuss the issue while configuring the configuration of Oracle AFD

What is Oracle AFD .

Oracle Automatic Storage Management Filter Driver (Oracle ASMFD) rejects write I/O requests that are not issued by Oracle software.

This filter helps to prevent users with administrative privileges from inadvertently overwriting Oracle ASM disks,

thus preventing corruption in Oracle ASM disks and files within the disk group. For disk partitions,

the area protected is the area on the disk managed by Oracle ASMFD, assuming the partition table is left untouched by the user.

Oracle ASMFD simplifies the configuration and management of disk devices by eliminating the need to rebind disk devices used with Oracle ASM

each time the system is restarted.

ASMFD is a superset of ASMLIB; therefore it includes base-ASMLIB features (permissions persistence & sharing open handles).

• Reject non-Oracle I/Os.

As a manager of Oracle storage, ASM is exposed to the capabilities of the Operating System (OS) when it comes to dealing with storage devices.

In particular, non-Oracle commands have the ability to overwrite the contents of ASM disks which may lead to unrecoverable data loss.

ASMFD only allows writes using an Oracle-specific interface and prevents non-Oracle applications from writing to ASM disks.

This protects ASM from accidental corruption.

• Reduce OS resource usage.

An ASM instance contains numerous processes, or threads on Windows. Without ASMFD, each process that is I/O capable

needs to have its own dedicated open file descriptor for each disk. When a database has thousands of processes accessing hundreds of disks,

there is an explosion of file descriptors leading to considerable OS resource consumption.

ASMFD exposes a portal device that can be used for all I/O on a particular host.

The same portal device can be shared by all the processes associated with multiple database instances.

The result is that using ASMFD, the required number of open file descriptors is drastically reduced.

• Enable device name persistence.

ASMFD do not require additional configuration to ensure device name persistence by using udev rules or third-party storage drivers.

• Faster node recovery.

With the current implementation of Oracle Clusterware, init.d scripts panic the node in situations when Cluster Synchronization Services (CSS) is not functioning

correctly. Using this mechanism, nodes are fenced to ensure the integrity of the rest of the cluster.

While effective, this solution is costly because of the time required to reboot the node and restart all the required processes.

ASMFD allows Oracle Clusterware to perform node level fencing without a reboot. So with ASMFD,

it is possible to achieve the same result by restarting the Oracle software stack instead of rebooting the entire node.

This process is just as effective, but far quicker.

ASM Filter Driver Wroking.

AFD Configuration and Error ASMCMD-9520: AFD is not 'supported'

Supported Version for OS and Database (19c) for ACFS and AFD .

Supported Version for OS and Database (21c) for ACFS and AFD .

I started with the base version of 19.3 Got the error below .

Install Oracle Grid Software only .

/oracle/app/grid/gr_home/perl/bin/perl -I /oracle/app/grid/gr_home/perl/lib -I /oracle/app/grid/gr_home/crs/install /oracle/app/grid/gr_home/crs/install/roothas.pl

Error on base version : 19.3


dm01db01:~ # asmcmd afd_configure
ASMCMD-9520: AFD is not 'supported'
dm01db01:~ #
dm01db01:~ #
dm01db01:~ # uname -a
Linux dm01db01 4.12.14-122.37-default #1 SMP Sun Sep 6 05:00:36 UTC 2020 (fe8cacf) x86_64 x86_64 x86_64 GNU/Linux

Patch Oracle Grid 19.3 to 19.16 :


dm01db01:/oracle/app/grid/gr_home/OPatch # ./opatchauto apply /oracle/Patch/34130714 -oh /oracle/app/grid/gr_home

OPatchauto session is initiated at Thu Aug 18 03:48:40 2022

System initialization log file is /oracle/app/grid/gr_home/cfgtoollogs/opatchautodb/systemconfig2022-08-18_03-48-46AM.log.

Session log file is /oracle/app/grid/gr_home/cfgtoollogs/opatchauto/opatchauto2022-08-18_03-48-50AM.log
The id for this session is M9EA

Executing OPatch prereq operations to verify patch applicability on home /oracle/app/grid/gr_home
Patch applicability verified successfully on home /oracle/app/grid/gr_home


Executing patch validation checks on home /oracle/app/grid/gr_home
Patch validation checks successfully completed on home /oracle/app/grid/gr_home


Performing prepatch operations on CRS - bringing down CRS service on home /oracle/app/grid/gr_home
Prepatch operation log file location: /oracle/app/grid/crsdata/dm01db01/crsconfig/hapatch_2022-08-18_03-50-13AM.log
CRS service brought down successfully on home /oracle/app/grid/gr_home


Start applying binary patch on home /oracle/app/grid/gr_home
Binary patch applied successfully on home /oracle/app/grid/gr_home


Performing postpatch operations on CRS - starting CRS service on home /oracle/app/grid/gr_home
Postpatch operation log file location: /oracle/app/grid/crsdata/dm01db01/crsconfig/hapatch_2022-08-18_04-01-22AM.log
CRS service started successfully on home /oracle/app/grid/gr_home

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:dm01db01
SIHA Home:/oracle/app/grid/gr_home
Version:19.0.0.0.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /oracle/Patch/34130714/33575402
Log: /oracle/app/grid/gr_home/cfgtoollogs/opatchauto/core/opatch/opatch2022-08-18_03-50-28AM_1.log

Patch: /oracle/Patch/34130714/34133642
Log: /oracle/app/grid/gr_home/cfgtoollogs/opatchauto/core/opatch/opatch2022-08-18_03-50-28AM_1.log

Patch: /oracle/Patch/34130714/34139601
Log: /oracle/app/grid/gr_home/cfgtoollogs/opatchauto/core/opatch/opatch2022-08-18_03-50-28AM_1.log

Patch: /oracle/Patch/34130714/34160635
Log: /oracle/app/grid/gr_home/cfgtoollogs/opatchauto/core/opatch/opatch2022-08-18_03-50-28AM_1.log

Patch: /oracle/Patch/34130714/34318175
Log: /oracle/app/grid/gr_home/cfgtoollogs/opatchauto/core/opatch/opatch2022-08-18_03-50-28AM_1.log



OPatchauto session completed at Thu Aug 18 04:01:40 2022
Time taken to complete the session 13 minutes, 0 second

-----------------------------------Patching Completed----------------------------------------------

Configure Oracle AFD now it's working


dm01db01:/oracle/app/grid/gr_home/OPatch # asmcmd afd_configure
AFD-627: AFD distribution files found.
AFD-634: Removing previous AFD installation.
AFD-635: Previous AFD components successfully removed.
AFD-9294: updating file /etc/sysconfig/oracledrivers.conf
AFD-636: Installing requested AFD software.
AFD-637: Loading installed AFD drivers.
AFD-9321: Creating udev for AFD.
AFD-9323: Creating module dependencies - this may take some time.
AFD-9154: Loading 'oracleafd.ko' driver.
AFD-649: Verifying AFD devices.
AFD-9156: Detecting control device '/dev/oracleafd/admin'.
AFD-638: AFD installation correctness verified.
Modifying resource dependencies - this may take some time.

dm01db01:/oracle/app/grid/gr_home/OPatch # uname -a
Linux dm01db01 4.12.14-122.37-default #1 SMP Sun Sep 6 05:00:36 UTC 2020 (fe8cacf) x86_64 x86_64 x86_64 GNU/Linux

dm01db01:/oracle/app/grid/gr_home/OPatch # asmcmd afd_state
ASMCMD-9526: The AFD state is 'LOADED' and filtering is 'ENABLED' on host 'dm01db01'

Do below steps before partitioning .


#acfsload stop
#acfsload start
#lsmod | grep acfs

Partition the Raw Disk in linux


dm01db01:/oracle/app/grid/gr_home/OPatch # fdisk -l
Disk /dev/sdf: 5 GiB, 5368709120 bytes, 10485760 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sde: 5 GiB, 5368709120 bytes, 10485760 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdc: 5 GiB, 5368709120 bytes, 10485760 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdg: 5 GiB, 5368709120 bytes, 10485760 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdd: 5 GiB, 5368709120 bytes, 10485760 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 5 GiB, 5368709120 bytes, 10485760 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

example fdisk : Need to do with all unpartition disk that will be used for ASM

Same needs to be done for all remaining disk.



dm01db01:~ # fdisk /dev/sdf

Welcome to fdisk (util-linux 2.33.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x3c344787.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-10485759, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-10485759, default 10485759):

Created a new partition 1 of type 'Linux' and of size 5 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

After fdisk result :


Disk /dev/sdf: 5 GiB, 5368709120 bytes, 10485760 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3c344787

Device     Boot Start      End  Sectors Size Id Type
/dev/sdf1        2048 10485759 10483712   5G 83 Linux

Deploying udev in a Grid Infrastructure Environment

vi /etc/udev/rules.d/99-oracle-asmdevices.rules


KERNEL=="sdb1",NAME="DATA4",OWNER="oracle",GROUP="oinstall",MODE="0660"
KERNEL=="sdc1",NAME="RECO1",OWNER="oracle",GROUP="oinstall",MODE="0660"
KERNEL=="sdd1",NAME="DATA2",OWNER="oracle",GROUP="oinstall",MODE="0660"
KERNEL=="sde1",NAME="DATA1",OWNER="oracle",GROUP="oinstall",MODE="0660"
KERNEL=="sdf1",NAME="DATA3",OWNER="oracle",GROUP="oinstall",MODE="0660"
KERNEL=="sdg1",NAME="RECO2",OWNER="oracle",GROUP="oinstall",MODE="0660"

On root prompt run the rules

udevadm control --reload-rules

Label the disk as ASM AFD disk.

$ORACLE_HOME/bin/asmcmd afd_label DATAC1 /dev/sde1

$ORACLE_HOME/bin/asmcmd afd_label DATAC2 /dev/sdd1

$ORACLE_HOME/bin/asmcmd afd_label DATAC3 /dev/sdf1

$ORACLE_HOME/bin/asmcmd afd_label DATAC4 /dev/sdb1

$ORACLE_HOME/bin/asmcmd afd_label RECO1 /dev/sdc1

$ORACLE_HOME/bin/asmcmd afd_label RECO2 /dev/sdg1


dm01db01:~ # $ORACLE_HOME/bin/asmcmd afd_label DATAC1 /dev/sde1
dm01db01:~ #
dm01db01:~ # $ORACLE_HOME/bin/asmcmd afd_label DATAC2 /dev/sdd1
dm01db01:~ #
dm01db01:~ # $ORACLE_HOME/bin/asmcmd afd_label DATAC3 /dev/sdf1
dm01db01:~ #
dm01db01:~ # $ORACLE_HOME/bin/asmcmd afd_label DATAC4 /dev/sdb1
dm01db01:~ #
dm01db01:~ # $ORACLE_HOME/bin/asmcmd afd_label RECO1 /dev/sdc1
dm01db01:~ #
dm01db01:~ # $ORACLE_HOME/bin/asmcmd afd_label RECO2 /dev/sdg1

Scan the labeled Disk and List the disks


dm01db01:~ # asmcmd afd_scan

dm01db01:~ # asmcmd afd_lsdsk
--------------------------------------------------------------------------------
Label                     Filtering   Path
================================================================================
DATAC1                      ENABLED   /dev/sde1
DATAC2                      ENABLED   /dev/sdd1
DATAC3                      ENABLED   /dev/sdf1
DATAC4                      ENABLED   /dev/sdb1
RECO1                       ENABLED   /dev/sdc1
RECO2                       ENABLED   /dev/sdg1


dm01db01:~ # asmcmd afd_lslbl
--------------------------------------------------------------------------------
Label                     Duplicate  Path
================================================================================
DATAC1                                /dev/sde1
DATAC2                                /dev/sdd1
DATAC3                                /dev/sdf1
DATAC4                                /dev/sdb1
RECO1                                 /dev/sdc1
RECO2                                 /dev/sdg1

select d.name, d.path, d.library, dg.name
from v$asm_disk d left join v$asm_diskgroup dg on (dg.group_number = d.group_number)
where dg.name = 'DATA';

NAME                           PATH                           LIBRARY                                                 NAME
------------------------------ ------------------------------ ------------------------------------------------------- ------------------------------
DATAC1                         AFD:DATAC1                     AFD Library - Generic , version 3 (KABI_V3)             DATA
DATAC2                         AFD:DATAC2                     AFD Library - Generic , version 3 (KABI_V3)             DATA
DATAC3                         AFD:DATAC3                     AFD Library - Generic , version 3 (KABI_V3)             DATA
DATAC4                         AFD:DATAC4                     AFD Library - Generic , version 3 (KABI_V3)             DATA

select d.name, d.path, d.library, dg.name
from v$asm_disk d left join v$asm_diskgroup dg on (dg.group_number = d.group_number)
where dg.name = 'RECO';

NAME                           PATH                           LIBRARY                                                 NAME
------------------------------ ------------------------------ ------------------------------------------------------- ------------------------------
RECO1                          AFD:RECO1                      AFD Library - Generic , version 3 (KABI_V3)             RECO
RECO2                          AFD:RECO2                      AFD Library - Generic , version 3 (KABI_V3)             RECO

Configration Completed

Hope this help's.

If there is any suggestion please post it in comment box.

Regards

Sultan Khan

Previous
Next Post »