Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Wednesday 23 November 2016

How to find out the vhost information of the disk?


How to find out the vhost information of the disk?


Sometimes we are in the situation to find out the VHOST information of particular hdisk. We can easily find out using the below method. 


   ü First we need to find out in what VTD the hdisk is belongs to.
   ü Then using VTD, we can find out the vhost info.


For example, if we want to find out the hdisk5 is part of which vhost? Now the short cut is below.


  ü find out vtd which is belongs to the hdisk 

                   $lsmap -all|grep -p hdisk5

                             VTD                   testmachine-16
                             Status                Available
                             LUN                   0x8700000000000000
                             Backing device        hdisk5
                             Physloc               U7311.D20.067DDBB-P1-C02-T1-L113



   ü Now find out the vhost belongs to the VTD

                 syntax:   lsdev -dev -field parent

                   $lsdev -dev testmachine-16 -field parent

                             parent
                             vhost3


So hdisk5 is part of vhost3


To confirm:

$lsmap -vadapter vhost3
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3          U9133.55A.065040H-V22-C16                    0x00000003
VTD                   testmachine-16
Status                Available
LUN                   0x8700000000000000
Backing device        hdisk5

Physloc               U7311.D20.067DDBB-P1-C02-T1-L113

VTD                   testmachine-15
Status                Available
LUN                   0x9200000000000000
Backing device        hdisk6
Physloc               U7311.D20.067DDBB-P1-C02-T1-L66

How to export and mount the nfs filesystem in aix?


How to export and mount the nfs filesystem in aix?


1. Ground work:
We need the below information in hand and confirm the required deamon status.
            ü  Nfs Server name
            ü  Exported directory
            ü  Nfs Client name
            ü  Nfs local mount point name.
            ü  check showmount -e  --> To confirm the exported directory list.
            ü  showmount -a  --> To confirm the list of nfs client server names.

Server Side Configuration: Start the NFS and portmap daemon

# lslpp –L | grep bos.net*  --> Check the nfs server and client installed.
# startsrc –g nfs  --> start the nfs group deamon
# startsrc -s nfsd   --> start the nfsd deamon
# startsrc -s mountd  --> start the mountd deamon
# lssrc -g nfs  --> check the nfs group deamon in active state
# lssrc -s  nfsd  --> Check the nfsd deamon
# lssrc -s mountd  --> check the mountd deamon

•   Client Side Configuration:      Start the NFS and portmap daemon

# lslpp –L | grep bos.net*  --> Check the nfs server and client installed
# startsrc –g nfs   --> start the nfs group deamon
# startsrc –s portmap  --> start the portmap deamon.
# lssrc -s nfsd  --> check the nfs group deamon in active state
# lssrc -s portmap  --> Check the protmap deamon in active state.
# lssrc -s biod   --> Check the biod deamon in active state.


2. Exporting an NFS filesystem

Using Smitty:
# ls -l /etc/exports  --> Check exports file exits.
# cp -p /etc/exports /etc/exports_bak   --> Take the backup of the exports file.
# smitty mknfsexp  --> Exporting the nfs filesystem.
            Specify appropriate values in the PATHNAME of directory to export
             MODE to export directory, 
            EXPORT directory now, system restart or both fields.
# cat /etc/exports  --> To confirm the exported directory are present on the /etc/exports.

Using Command line:

# cp -p /etc/exports /etc/exports_bak   --> Take the backup of the exports file.
# vi /etc/exports  --> To Create an entry for each directory to be exported, using the full path name of the directory.
# exportfs -a  --> To read the /etc/exports file and exports all the directories listed.
# showmount -e  --> To confirm the exported directory listed.
# showmount -a  --> To confirm the nfs client name and directory list.


3. Mounting the NFS filesystem on the client.

Using Smitty:
# showmount -e   --> To verify the NFS server has exported the directory.
# mkdir /local_directory    --> To create the mounting directory if not already exist.
#  smitty mknfsmnt  --> mount the NFS filesystem.
            PATHNAME of mount point.
            PATHNAME of remote directory.
            HOST where remote directory resides.
            MOUNT now, add entry to /etc/filesystems or both?
            /etc/filesystems entry will mount the directory on system RESTART.
            MODE for this NFS file system.
 #df -gt   --> To confirm the nfs filesystem has been mounted

Using Command line:
# showmount -e   --> To verify the NFS server has exported the directory.
# mkdir /local_directory    --> To create the mounting directory if not already exist.
# mount ServerName:/remote/directory /local/directory 
 #df -gt   --> To confirm the nfs filesystem has been mounted



4. Roll back 

Unexporting the NFS filesystem on the NFS server

Using Smitty:

Login to the NFS server and follw the below procedure.
# cp -p /etc/exports  --> To copy the exports directory.
# smitty rmnfsexp  --> To unexport the nfs directory.

Using command line:
# vi /etc/exports --> To Find the entry for the directory you wish to unexport, and the delete that line.
# cat /etc/exports   --> To check the directory now is removed and unexported.
If NFS is current running, 
#exportfs -u where dirname is the full path name of the directory you just deleted from the /etc/exports file.


Removing the NFS mount on the NFS client server.

Using Smitty:
#smitty rmnfsmnt
# cat /etc/filesystems  --> To confirm the entry has been deleted properly.

Using command line:
#umount    --> To unmount the directory.
# cp -p /etc/filesystems /etc/filesystems_bak   --> To take the backup of the /etc/filesytems file.
# vi /etc/filesystems  --> Find the entry for the directory you just unmounted, and then delete it.
# cat /etc/filesystems  --> To confirm the entry for the directory you just unmounted properly.


Note: If you happy about the above article, please leave your comments / Reactions.

How to find out the FC card is dual port or single port in aix?


How to find out the FC card is dual port or single port in aix?


We might come across many times that whether our Fiber channel card is single or dual port. 

For example, if you want to see your fcs2 is single port or dual port in aix, then use the below command to confirm.


#lsslot -c pci |grep -i fcs2

U1.5-P1-I1 PCI 64 bit, 66MHz, 3.3 volt slot fcs2 fcs3

The above output clearly shows that fcs2 is a dual port fiber channel. That is fcs2 and fcs3.

How to create lpar step by step in aix?


How to create lpar step by step in aix?


Go to HMC -> Select Managed system -> Select the check option near the Managed system

select Configuration ->   Create Logical partition -> AIX/LINUX

and provide the below info on each page and click next.


Create Partition:    
Provide the partition Id and Partition name


Partition profile:   
Provide profile name


Processors:          
Select SHARED or DEDICATED


Processing settings:
 Provide Min-Des-Max processing units and virtual processor value


Memory settings:     
Minimum,Desired,Maximum Memory value


I/O:                 
Provide IO adapter, FC adapter/CDrom/Network adapter


Virtual adapter:     
Create virutal scsi/ Virtual ethernet adapter


Optional setting: 
Boot mode-Normal


Profile Summary:     
It will list the summary of the lpar created

Activate the newly created lpar.

How to create EtherChannel in aix?


How to create EtherChannel or Link Aggregation in aix?


Two Ethernet adapters to be aggregated together to form a single Ethernet device.
For example, ent0 and ent1 can be aggregated into an EtherChannel adapter called ent3. And interface en3 would then be configured with an IP address.

1. Ground work:

lsdev -Cc adapter             --> To check the adapter details 
lsdev -Cc adapter|grep -i etherchannel            --> To check already the server has any existing etherchannel


2. Implementation

(In the below example,  the physical interfaces ent1 & ent2 are configured for etherchannel)

 #smitty etherchannel
  EtherChannel / Link Aggregation Adapters         ent1                   +
  Enable Alternate Address                                           no                     +
  Alternate Address                                                       []                      +
  Enable Gigabit Ethernet Jumbo Frames                  no                     +
  Mode                                                                            standard               +
  Hash Mode                                                                  default                +
  Backup Adapter                                                          ent2                   +
  Internet Address to Ping                                                                            []
  Number of Retries                                                       []                      +#
  Retry Timeout (sec)                                                     []                      +#

Now the etherchannel ent3 has been created.  then put IP address to the etherchannel ent3
#smit  -->  Communications Applications and Services > TCP/IP > Minimum Configuration & Startup   
Now select the ent3 as a network interface and also provide mandatory info like hostname, netmask and then start now. 
                     
3. Validation

lsdev –Cc adapter|grep –i etherchannel   --> To confirm ent3 is a etherchannel
entstat -d enX |grep Active   --> To check the primary adapter is active
lsdev -Cc adapter             --> To check the adapter details 


4. Roll back

lsdev –Cc adapter|grep –i etherchannel   --> To check the etherchannel
#smitty etherchannel -> Remove An EtherChannel / Link Aggregation’
Reconfigure IP on the adapters


5. Downtime

NO downtime required for this task



Note:
If one adapter fails, network traffic is automatically sent on the next available adapter without disruption to existing user connections. The adapter is automatically failed back to service on the EtherChannel or Link Aggregation when it recovers.