Friday, June 20, 2014

How to find out the hacmp cluster version in aix?

How to find out the hacmp cluster version in aix?


Using the below command we can find out the hacmp cluster version easily in the new version of hacmp. (it will give you a clear output  like oslevel command  ). For the older version, we can check with "lslpp" command

        

              halevel -s



output:  6.1 SP 2


Monday, June 16, 2014

How to change the word in the file in aix?

How to change the word in the file in aix?


Using the below commands we can change the particular word in the file. 

Note: we can replace the word and save into the other file. NOT on the target file itself. if we try to replace the word on the same file itself, the file will be nullified automatically.


      sed "s/ <target_word> / <replacing_word> /g" newfile > newfile-backup


In the above commands, we can replace the word from test_old to test_new on the newfile.

Ex: 

cat newfile

test_1
test_2
test_3
test_old
test_5
test_6
test_old

sed "s/test_old/test_new/g" newfile > newfile_backup

cat newfile

test_1
test_2
test_3
test_new
test_5
test_6
test_new


On the above newfile, test_old has been replaced by test_new. (So whereever the word "test_old" is there in the file, it has been replaced by the new word "test_new")




How to solve the 11 digit character issue while taking alt_disk clone in aix?

How to solve the 11 digit character issue while taking alt_disk clone in aix?


Sometimes we are facing the 11 digit character issue when we taking alt_disk (because the lv name's character is more than 11 digit). yes, we cant take alt_disk clone if the lv name is more than 11 character.

For example: If we have a LV name as testpurpose_lv (toally it has 14 character) If we are trying to take the alt_disk then surely it will end up with the 11 digit character issue. Hence we cant take the alt_disk.

Please find the solutions below:


* Generate image.data using mkszfile.


* Copy image.data to /tmp/image.data_old


* Edit /tmp/image.data_old (vi /tmp/image.data_old), go to LV stanza and change the LV name to the smaller one. i.e reduce the number of character in lv name.

 "testpurpose_lv"  to  "testlv"  (Note that the new lv name (testlv) character is below 11 digit)


* Run alt_disk_copy with "i" 

              alt_disk_install -i /tmp/image.data_old -C -B <hdisk_name>


Actually what happen: When alt disk reads the LV name in image.data, it will create the alt_disk LV with the new name as in the modified image.data file. i.e /tmp/image.data.old



Thursday, June 12, 2014

How to find out the vhost information easily in vio server in aix?

How to find out the vhost information easily in aix?

Using the below command we can find out the vhost information very easily. We can get all the vhost name information associated with our target lpar very easily. For that we need have the LPAR ID in hexa decimal.


* Find the lpar id and convert into hexa decimal.

     For ex: if your LPAR ID is 15, then the hexadecimal value is "f"  

Using the below command we can convert decimal no to hexa-decimal.

    printf "%x\n" 15           output is: "f"



* Execute the below command on the VIO server to find out the vhost info.

     lsmap -all | grep vhost | grep 0x0000000f


Note: totally 6 zeros are needs to put after the "x" on the command and last two digit ("0f") is for hexa decimal number.

Advantages of this command is, if you have 6 virtual disks on the lpar from the vios, then we  will get all the 6 virtual disks associated with the vhosts name on the VIOS..



How to find out the VHOST informaiton using VTD names?

How to find out the VHOST informaiton using VTD names?


Many ways are there to find out the vhost information. Sometimes we know the VTD name but dont know about the VHOST information. The below commands used to find out the VHOST information using the VTD name. 

      lsdev -dev <VTD_NAME> -field parent 


(execute the command in the aix prompt)

         /usr/ios/cli/ioscli lsdev -dev <VTD_NAME> -field parent |egrep -v parent