Wednesday, May 17, 2017

NFSv4 ownership as nobody:nobody

RHEL6.3 and newer NFS clients and servers disable idmapping when utilizing the AUTH_SYS/UNIX authentication flavor by enabling the following booleans:

        NFS client
 # echo 'Y' > /sys/module/nfs/parameters/nfs4_disable_idmapping

NFS server

# echo 'Y' > /sys/module/nfsd/parameters/nfs4_disable_idmapping 

Wednesday, March 22, 2017

AIX unique FCS ID & disk ID (UDID)

Recently I discovered a new switch to lspv command -u. It seems to be available since AIX7 TL1 and AIX6 TL7. Thanks for this switch IBM; I like it very much.
A physical volume (hdisk) to an LPAR can be provided in several ways:
  • without VIOS
    • local physical disk connected to a physical disk SCSI/SAS controller owned by the LPAR
    • SAN disk connected to a physical FC controller
  • with VIOS
    • SAN disk connected to a virtual FC controller
    • a physical disk mapped through a virtual scsi
    • SAN disk mapped through a virtual scsi
    • logical volume on VIOS mapped through a virtual scsi
If you need to know where a specific disk comes from without looking into your documentation (which, indeed, is up to date and precise) or loging in to VIOSes etc, lspv -u helps significantly.
The command switch displays unique id of disks (UDID) and does the same job as the code I was using before, but in a more handy way.
lsdev -Cc disk -F name | while read hdisk; do
  echo ${hdisk},$(odmget -q "name=${hdisk} and attribute=unique_id" CuAt|grep value|cut -d '"' -f2)
done
UDID is build up using a certain logic. I haven't seen the code, but some of the interesting parts are easy to spot:
  • unique_id attribute of an SAS attached hdisk is 2A1135000C500337924AB0BST9146852SS03IBMsas. This ID contains WWNN of the SAS controller (00C500337924AB), disk vendor (IBM), connection type (sas), and also disk model ST9146852SS, which is 146,8GB SAS.
  • unique ID of a logical volume is VGID.sequence_number. For example ID of a third logical volume in a specific VG is 00cc572600004c00000001325d0ab9bd.3.
A few examples of lspv -u outputs with comments on UDID:
  • Locally attached SAS disk
    hdisk0  00cc57264df9dc6b  rootvg  active  2A1135000C500238633030BST9146852SS03IBMsas
  • virtual disk connected via virtual scsi, backed by SAS disk.
    hdisk28  00cc572646f271f9  none  3F2A2A1135000C500337924AB0BST9146852SS03IBMsas05VDASD03AIXvscsi
  • virtual disk connected via virtual scsi, backed by logical volume. Logical volume ID can by identified by a period.
    hdisk0  00cc57265d4534bd  rootvg  active  372200cc572600004c00000001325d0ab9bd.205VDASD03AIXvscsi
  • SAN disk attached via physical or virtual FC. The disk comes from a DS8100 disk array identified as 75BBXM1. Volume ID of the disk in DS8100 is 180D.
    hdisk39  00cc5726aaa9e19e  testvg  active  200B75BBXM1180D07210790003IBMfcp
  • virtual disk connected via virtual scsi, backed by SAN disk. The disk comes from a DS8300 disk array identified as 75YY981. Volume ID of the disk in DS8300 is 0501.
    hdisk2  00cc57260b6d4ca6  rootvg  active  3520200B75YY981050107210790003IBMfcp05VDASD03AIXvscsi
I trimmed the output slightly to fit on screen better. In fact lspv -u show one more column on right with a long string of unknown purpose.
Since disk unique id is in ODM, it can help you solve an issue, when you unmap a disk from a system on either VIOS or a storage by mistake and you want to put it back asap; lspv -u helps you to identify the disk, unless you perform rmdev -dl on that disk.
Didn't find your lspv -u output in the examples above? Leave a comment!


Two ways to create mksysb images in AIX

1) create on NIM server command: 

nim -o define -t mksysb -a server=master -a source=<server name> -a mk_image=yes -a location=<location of the store image> <mksysb image name> 

This will create the mksysb image of the client server and define it on the NIM server. 

Example: 
nim -o define -t mksysb -a server=master -a source=edppbuslvd01 -a mk_image=yes -a location=/nim/mksysb/edppbuslvd01_6100-04-03-05112010 edppbuslvd01_6100-04-03-05112010 

server=master: server to store image, in this case is master 
source=edppbuslvd01: the source of the image, which is client 
location: the location of the stored mksysb image 


2) create on client machine and then copy to NIM server and define on NIM server, or NFS mount the filesystem from NIM server on the client server. 

let say you successfully NFS mount nim server filesystem on the client machine as /mnt. 

mksysb -ieX /mnt/edppbuslvd01_6100-04-03-05112010 


-e: exclude the filesystem/dir that defined on /etc/exclude.rootvg 
-i: call the mkszfile command to generate the /image.data file 
The /image.data file contains information on volume groups, logical volumes, file systems, paging space, and physical volumes.
 This information is included in the backup for future use by the installation process. 
-X: set to automatically expand the /tmp if necessary 

After the mksysb image created, you need to define it on NIM server. 

nim -o define -t mksysb -a server=master -a location=<image location> <image name>