<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kristijan.org</title>
	<atom:link href="http://www.kristijan.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kristijan.org</link>
	<description>Ramblings of a sysadmin</description>
	<lastBuildDate>Wed, 18 Apr 2012 01:11:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>disk_size.sh &#8211; Quick look at disk details</title>
		<link>http://www.kristijan.org/2012/04/disk_size_quick_look_at_disk_details/</link>
		<comments>http://www.kristijan.org/2012/04/disk_size_quick_look_at_disk_details/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 01:11:05 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[ksh]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[volume group]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=348</guid>
		<description><![CDATA[I&#8217;ve been doing many AIX server migrations lately. Some which involve taking a mksysb and restoring, others which involve presenting LUN&#8217;s from a SVC and then doing a migratepv. The latter can result in a large number of disks presented on the host, so I wrote a quick basic script which gives me  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing many AIX server migrations lately. Some which involve taking a mksysb and restoring, others which involve presenting LUN&#8217;s from a SVC and then doing a migratepv. The latter can result in a large number of disks presented on the host, so I wrote a quick basic script which gives me the details that I need &#8211; hdisk name, size, vg, pvid and serial number.</p>
<p>Maybe someone out there will find it useful.<br />
<span id="more-348"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/ksh</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">getopts</span> <span style="color: #ff0000;">&quot;g&quot;</span> OPTION
  <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #800000;">${OPTION}</span> <span style="color: #000000; font-weight: bold;">in</span>
          g<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">BLOCK_SIZE</span>=<span style="color: #ff0000;">&quot;GB&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">esac</span>
  <span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">-A</span> hdisk <span style="color: #000000; font-weight: bold;">`</span>lspv <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">-A</span> pvid <span style="color: #000000; font-weight: bold;">`</span>lspv <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">-A</span> vg <span style="color: #000000; font-weight: bold;">`</span>lspv <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $3 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">count</span>=<span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BLOCK_SIZE</span>&quot;</span> = <span style="color: #ff0000;">&quot;GB&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
 <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$count</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #800000;">${#hdisk[*]}</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
           <span style="color: #007800;">hdisk_size_mb</span>=<span style="color: #000000; font-weight: bold;">`</span>getconf DISK_SIZE <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${hdisk[$count]}</span><span style="color: #000000; font-weight: bold;">`</span>
           <span style="color: #007800;">hdisk_size_gb</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$hdisk_size_mb</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span><span style="color: #000000; font-weight: bold;">`</span>
           <span style="color: #c20cb9; font-weight: bold;">size</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$count</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #007800;">$hdisk_size_gb</span>
        <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
 <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">else</span>
 <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$count</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #800000;">${#hdisk[*]}</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
           <span style="color: #c20cb9; font-weight: bold;">size</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$count</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #000000; font-weight: bold;">`</span>getconf DISK_SIZE <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${hdisk[$count]}</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
 <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">count</span>=<span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$count</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #800000;">${#hdisk[*]}</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
           serial<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$count</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #000000; font-weight: bold;">`</span>lscfg <span style="color: #660033;">-vl</span> <span style="color: #800000;">${hdisk[$count]}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;Serial Number&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> -F. <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
 <span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
&nbsp;
<span style="color: #007800;">count</span>=<span style="color: #000000;">0</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%-10s %-10s %-15s %-20s %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> Disk Size VG PVID Serial
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%-10s %-10s %-15s %-20s %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #660033;">----</span> <span style="color: #660033;">----</span> <span style="color: #660033;">--</span> <span style="color: #660033;">----</span> <span style="color: #660033;">------</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$count</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #800000;">${#hdisk[*]}</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
           <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%-10s %-10s %-15s %-20s %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #800000;">${hdisk[$count]}</span> <span style="color: #800000;">${size[$count]}</span> <span style="color: #800000;">${vg[$count]}</span> <span style="color: #800000;">${pvid[$count]}</span> <span style="color: #800000;">${serial[$count]}</span>
        <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX #&gt; ./disk_size.sh
Disk       Size       VG              PVID                 Serial
----       ----       --              ----                 ------
hdisk0     286102     None            00c67a84bb96c0ac	   JZW4SL9C
hdisk1     286102     None            00c67a84bbc2fec7     JZVLZJ2C
hdisk2     286102     None            00c67a84d41ba824     JZVLK4BC
hdisk3     286102     None            00c67a84d436cdd3     JZVMUG2C
hdisk4     52224      None            00c67a8433f75e56     75LZ7211200
hdisk5     52224      None            00c67a849f0e70ba     75M17911163
hdisk6     52224      None            none                 75LZ7211201
hdisk7     52224      None            00c67a849f0f2453     75LZ7211202
hdisk8     204800     None            00c67a849ee59661     75LZ7211012
hdisk9     307200     rootvg          00c67a84a67c6b56     600507680180867BB00000000000000B
hdisk10    307200     datavg          00c67a84a67c87b3     600507680180867BB00000000000000C
hdisk11    46080      wpar1           00c67a84a67d4860     600507680180867BB00000000000000D
hdisk12    40960      wpar2           00c67a84a67cb55b     600507680180867BB00000000000000E
hdisk13    51200      wpar3           00c67a84a67cccc9     600507680180867CC00000000000000F
hdisk14    51200      wpar4           00c67a84a67ce357     600507680180867CC000000000000010
hdisk15    51200      wpar5           00c67a84a67cf6ae     600507680180867CC000000000000011</pre></div></div>

<p>You can use the -g switch to make the size output in GB blocks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2012/04/disk_size_quick_look_at_disk_details/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Check those attributes!</title>
		<link>http://www.kristijan.org/2012/04/check-those-attributes/</link>
		<comments>http://www.kristijan.org/2012/04/check-those-attributes/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 02:12:57 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[ksh]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=321</guid>
		<description><![CDATA[This is a script I wrote purely from the frustutation of verifying each and every adapter/device attribute which one sets after an AIX installation. What this script does is loop through the list of user defined attributes, and verifies each and every adapter/device against them. The beauty of the  [...]]]></description>
			<content:encoded><![CDATA[<p>This is a script I wrote purely from the frustutation of verifying each and every adapter/device attribute which one sets after an AIX installation. What this script does is loop through the list of user defined attributes, and verifies each and every adapter/device against them. The beauty of the script is that it&#8217;s very easy to add/modify or remove checks.</p>
<p>For those with any expierence in scripting or coding will understand how array&#8217;s work. The script allows you to define your own array elements to add/modify or remove checks against certain adapters/devices.</p>
<p>Currently, the script checks for the following:</p>
<ol>
Virtual SCSI Adapters (vscsiX)<br />
Virtual FC Adapters (fscsiX)<br />
Hdisk Devices (hdiskX)<br />
VMO Values<br />
Number of paths to a disk (=>2)
</ol>
<p><span id="more-321"></span><br />
Below is the script, and after I&#8217;ll show you how easily additional checks can be added.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/ksh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Name:</span>
<span style="color: #666666; font-style: italic;">#       attrib_check.sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Description:</span>
<span style="color: #666666; font-style: italic;">#       This script performs checks against attributes set</span>
<span style="color: #666666; font-style: italic;">#       post AIX installation.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Usage:</span>
<span style="color: #666666; font-style: italic;">#       # ./attrib_check.sh</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#############</span>
<span style="color: #666666; font-style: italic;"># Variables #</span>
<span style="color: #666666; font-style: italic;">#############</span>
<span style="color: #007800;">BORDER</span>=<span style="color: #ff0000;">&quot;echo ===================================================&quot;</span>
<span style="color: #007800;">OK</span>=<span style="color: #ff0000;">&quot;\033[1;32mOK:\033[m&quot;</span>
<span style="color: #007800;">FAIL</span>=<span style="color: #ff0000;">&quot;\033[1;31mFAIL:\033[m&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">###############################</span>
<span style="color: #666666; font-style: italic;"># Variables - Server Specific #</span>
<span style="color: #666666; font-style: italic;">###############################</span>
<span style="color: #666666; font-style: italic;"># Virtual SCSI attributes</span>
vscsi<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;vscsi_err_recov,fast_fail&quot;</span>
vscsi<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;vscsi_path_to,30&quot;</span>
<span style="color: #666666; font-style: italic;"># Virtual FC attributes</span>
fscsi<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;dyntrk,yes&quot;</span>
fscsi<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;fc_err_recov,fast_fail&quot;</span>
<span style="color: #666666; font-style: italic;"># hdisk attributes</span>
hdisk<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;hcheck_interval,60&quot;</span>
hdisk<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;queue_depth,32&quot;</span>
<span style="color: #666666; font-style: italic;"># VMO</span>
vmo<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;lru_file_repage,0&quot;</span>
vmo<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;strict_maxperm,0&quot;</span>
vmo<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;strict_maxclient,1&quot;</span>
vmo<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;maxperm%,90&quot;</span>
vmo<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;minperm%,5&quot;</span>
vmo<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">5</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;maxclient%,90&quot;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">########</span>
<span style="color: #666666; font-style: italic;"># Main #</span>
<span style="color: #666666; font-style: italic;">########</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Verify disk adapter attributes</span>
<span style="color: #007800;">$BORDER</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=&gt; Verify disk adapter attributes&quot;</span>
<span style="color: #007800;">$BORDER</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Check vscsi adapter attributes</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Virtual SCSI Adapter Attributes&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-------------------------------&quot;</span>
lsdev <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> vscsi <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Server contains vscsi adapters with the following attributes:&quot;</span>
    <span style="color: #000000; font-weight: bold;">for</span> vscsi_adapter <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>lsdev <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> vscsi <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span>
     <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${vscsi_adapter}</span>:&quot;</span>
     <span style="color: #007800;">count</span>=<span style="color: #000000;">0</span>
       <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$count</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #800000;">${#vscsi[*]}</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
          <span style="color: #007800;">VSCSI_VAR1</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${vscsi[$count]}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> , <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>
          <span style="color: #007800;">VSCSI_VAR2</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${vscsi[$count]}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> , <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
          <span style="color: #007800;">VSCSI_CURRENT</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">lsattr</span> <span style="color: #660033;">-l</span> <span style="color: #007800;">$vscsi_adapter</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$VSCSI_VAR1</span> <span style="color: #660033;">-E</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
          <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VSCSI_CURRENT</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VSCSI_VAR2</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$FAIL</span> <span style="color: #007800;">$VSCSI_VAR1</span> must be set to <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$VSCSI_VAR2</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
            <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
          <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$OK</span> <span style="color: #007800;">$VSCSI_VAR1</span> = <span style="color: #007800;">$VSCSI_VAR2</span>&quot;</span>
            <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
          <span style="color: #000000; font-weight: bold;">fi</span>
       <span style="color: #000000; font-weight: bold;">done</span>
    <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">else</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Server does not contain any vscsi adapters&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">## Check fc adapter attributes</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Virtual FC Adapter Attributes&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-----------------------------&quot;</span>
lsdev <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> fscsi <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Server contains fscsi adapters with the following attributes:&quot;</span>
    <span style="color: #000000; font-weight: bold;">for</span> fscsi_adapter <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>lsdev <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> fscsi <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span>
     <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${fscsi_adapter}</span>:&quot;</span>
     <span style="color: #007800;">count</span>=<span style="color: #000000;">0</span>
       <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$count</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #800000;">${#fscsi[*]}</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
          <span style="color: #007800;">FSCSI_VAR1</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${fscsi[$count]}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> , <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>
          <span style="color: #007800;">FSCSI_VAR2</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${fscsi[$count]}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> , <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
          <span style="color: #007800;">FSCSI_CURRENT</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">lsattr</span> <span style="color: #660033;">-l</span> <span style="color: #007800;">$fscsi_adapter</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$FSCSI_VAR1</span> <span style="color: #660033;">-E</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
          <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FSCSI_CURRENT</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FSCSI_VAR2</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$FAIL</span> <span style="color: #007800;">$FSCSI_VAR1</span> must be set to <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$FSCSI_VAR2</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
            <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
          <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$OK</span> <span style="color: #007800;">$FSCSI_VAR1</span> = <span style="color: #007800;">$FSCSI_VAR2</span>&quot;</span>
            <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
          <span style="color: #000000; font-weight: bold;">fi</span>
       <span style="color: #000000; font-weight: bold;">done</span>
    <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">else</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Server does not contain any fscsi adapters&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># Verify hdisks</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #007800;">$BORDER</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=&gt; Verify hdisk attributes&quot;</span>
<span style="color: #007800;">$BORDER</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Check hdisk attributes</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;hdisk attributes&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;----------------&quot;</span>
    <span style="color: #000000; font-weight: bold;">for</span> pv <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>lspv <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> hdisk <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span>
     <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${pv}</span>:&quot;</span>
     <span style="color: #007800;">count</span>=<span style="color: #000000;">0</span>
       <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$count</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #800000;">${#hdisk[*]}</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
          <span style="color: #007800;">HDISK_VAR1</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${hdisk[$count]}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> , <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>
          <span style="color: #007800;">HDISK_VAR2</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${hdisk[$count]}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> , <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
          <span style="color: #007800;">HDISK_CURRENT</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">lsattr</span> <span style="color: #660033;">-l</span> <span style="color: #007800;">$pv</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$HDISK_VAR1</span> <span style="color: #660033;">-E</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
          <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HDISK_CURRENT</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HDISK_VAR2</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$FAIL</span> <span style="color: #007800;">$HDISK_VAR1</span> must be set to <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$HDISK_VAR2</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
            <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
          <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$OK</span> <span style="color: #007800;">$HDISK_VAR1</span> = <span style="color: #007800;">$HDISK_VAR2</span>&quot;</span>
            <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
          <span style="color: #000000; font-weight: bold;">fi</span>
       <span style="color: #000000; font-weight: bold;">done</span>
    <span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">## Check number of path's to disk</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Disk paths&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;----------&quot;</span>
<span style="color: #000000; font-weight: bold;">for</span> hdisk <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>lspv <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> hdisk <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span>
      <span style="color: #007800;">PATHS</span>=<span style="color: #000000; font-weight: bold;">`</span>lspath <span style="color: #660033;">-l</span> <span style="color: #007800;">$hdisk</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s,^ *,,'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$PATHS</span> <span style="color: #660033;">-lt</span> <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${hdisk}</span>:&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$FAIL</span> There is only <span style="color: #007800;">$PATHS</span> path to the disk&quot;</span>
      <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${hdisk}</span>:&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$OK</span> Paths to disk = <span style="color: #007800;">$PATHS</span>&quot;</span>
      <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># Check VMO settings</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #007800;">$BORDER</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=&gt; Check VMO settings&quot;</span>
<span style="color: #007800;">$BORDER</span>
&nbsp;
<span style="color: #007800;">count</span>=<span style="color: #000000;">0</span>
  <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$count</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #800000;">${#vmo[*]}</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
   <span style="color: #007800;">VMO_VAR1</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${vmo[$count]}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> , <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>
   <span style="color: #007800;">VMO_VAR2</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${vmo[$count]}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> , <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
   <span style="color: #007800;">VMO_CURRENT</span>=<span style="color: #000000; font-weight: bold;">`</span>vmo <span style="color: #660033;">-x</span> <span style="color: #007800;">$VMO_VAR1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> , <span style="color: #ff0000;">'{ print $4 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VMO_CURRENT</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VMO_VAR2</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$FAIL</span> <span style="color: #007800;">$VMO_VAR1</span> must be set to <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$VMO_VAR2</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
    <span style="color: #000000; font-weight: bold;">else</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$OK</span> <span style="color: #007800;">$VMO_VAR1</span> = <span style="color: #007800;">$VMO_VAR2</span>&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #ff0000;">&quot;count + 1&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></div></div>

<p>So, let&#8217;s add another check.<br />
For example, by default, the follow hdisk attributes are checked.</p>
<ol>
hcheck_interval = 60<br />
queue_depth = 32
</ol>
<p>If you wanted to add an aditional check, say the hcheck_mode attribute, all you need to do is add another element into the array.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">hdisk[0]=&quot;hcheck_interval,60&quot;
hdisk[1]=&quot;queue_depth,32&quot;
hdisk[2]=&quot;hcheck_mode,nonactive&quot;</pre></div></div>

<p>Line #3 shows the additional check. Just make sure you increase the array element id by one.</p>
<p>It&#8217;s pretty trivial to add other checks, say for ioo or no. You&#8217;ll just need to look at the current code blocks and add further ones. Or just leave a comment on this page and I can add them for you.</p>
<p>The following image shows the script running against a host where all attibutes validate.<br />
<a href="http://www.kristijan.org/images/attrib_check_working.png" title="attrib_check.sh OK"><img src="http://www.kristijan.org/images/attrib_check_working-150x150.png" align="center" border="0"></a></p>
<p>The following image shows the script running against a host where some failures were detected.<br />
<a href="http://www.kristijan.org/images/attrib_check_failed.png" title="attrib_check.sh FAILED"><img src="http://www.kristijan.org/images/attrib_check_failed-150x150.png" align="center" border="0"></a></p>
<p>I guess this script could even be modified to actually make the changes to those adapters/devices for you. Quite easily in fact&#8230;so if anyone is interested in something like that, let me know and I&#8217;ll throw something together.</p>
<p>As always, use/abuse/mock and enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2012/04/check-those-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically reduce image.data to a single PV</title>
		<link>http://www.kristijan.org/2012/04/automatically-reduce-image-data-to-a-single-pv/</link>
		<comments>http://www.kristijan.org/2012/04/automatically-reduce-image-data-to-a-single-pv/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 05:26:32 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[PowerVM]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[image.data]]></category>
		<category><![CDATA[ksh]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[volume group]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=313</guid>
		<description><![CDATA[I&#8217;ve been working with a client who is going through the process of migrating from physical Power 5 servers to a virtualized Power 7 environment with PowerVM. Often referred to as P2V migrations around the IBM office   Due to the I/O limitations in the P5 servers, our only method of migration was  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with a client who is going through the process of migrating from physical Power 5 servers to a virtualized Power 7 environment with PowerVM. Often referred to as P2V migrations around the IBM office <img src='http://www.kristijan.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Due to the I/O limitations in the P5 servers, our only method of migration was to take mksysb/savevg&#8217;s of the current servers, create NIM resources out of them, and then restore onto the P7 LPAR&#8217;s.</p>
<p>The Power 5 rootvg consisted of two internal disks in a LVM mirror, with the other volume groups backed by either internal disk, or locally attached storage. The Power 7 which we were migrating to had it&#8217;s storage provided by a shiny DS8800. Given the boot from SAN solution we had, we no longer required two disks to form the rootvg, as all the mirroring and redundancy was being handled by the SVC&#8217;s.<br />
<span id="more-313"></span><br />
To successfuly restore the Power 5 mksysb onto the new Power 7 LPAR, we needed to provide an alternate image.data file during installation which has been modified to break the mirror and reduce the volume group down to a single physical disk. You can do this manually, and I would have if there was a small number of hosts to migrate, but I was dealing with a rather large enviornment.</p>
<p>The below script does the following :</p>
<p>1. Modifies the source_disk_data stanza to a single entry.<br />
2. Modifies the VG_SOURCE_DISK_LIST stanza to the disk set by the -d paramater.<br />
3. Modifies the LV_SOURCE_DISK_LIST stanza to the disk set by the -d paramater.<br />
4. Modifies the COPIES stanza to 1.<br />
5. Modifies the PP stanza to match the LP&#8217;s value.</p>
<p>The script takes two values, the resulting hdisk on the other node (In my case, hdisk0 for rootvg, and hdisk1 for datavg), and the location of the image.data or vg.data file.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX #&gt; ./modify_data.sh
Usage: ./modify_data.sh -d &lt;hdisk&gt; -f &lt;file&gt;
        -d      Destination hdisk on P7 LPAR
        -f      image.data or vg.data file to modify
        -h      Script usage</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/ksh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Name:</span>
<span style="color: #666666; font-style: italic;">#	modify_data.sh</span>
<span style="color: #666666; font-style: italic;"># Description:</span>
<span style="color: #666666; font-style: italic;">#       This script is for use during migrations where mksysb/savevg </span>
<span style="color: #666666; font-style: italic;">#       consists of multiple physical volumes and is being restored</span>
<span style="color: #666666; font-style: italic;">#       to a single volume. </span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#       This script modifies the image.data or vg.data file to allow</span>
<span style="color: #666666; font-style: italic;">#       the restore to a single volume.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Usage:</span>
<span style="color: #666666; font-style: italic;">#       # ./modify_data.sh -d &lt;hdisk&gt; -f &lt;file&gt;</span>
<span style="color: #666666; font-style: italic;">#               -d      Destination hdisk on P7 LPAR</span>
<span style="color: #666666; font-style: italic;">#               -f      image.data or vg.data file to modify</span>
<span style="color: #666666; font-style: italic;">#               -h      Script usage</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#*********************************************************#</span>
<span style="color: #666666; font-style: italic;"># Functions, Variables, Checks  and Command line options *#</span>
<span style="color: #666666; font-style: italic;">#*********************************************************#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Variables</span>
<span style="color: #007800;">DATE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">PWD</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">pwd</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Usage function</span>
_usage<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 -d &lt;hdisk&gt; -f &lt;file&gt;&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;        -d      Destination hdisk on P7 LPAR&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;        -f      image.data or vg.data file to modify&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;        -h      Script usage&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Example:&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;       $0 -d hdisk0 -f image.data&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># Display usage if no command line arguments</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  _usage
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># Read command line options</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">getopts</span> <span style="color: #ff0000;">&quot;d:f:h&quot;</span> OPTION
  <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #800000;">${OPTION}</span> <span style="color: #000000; font-weight: bold;">in</span>
          d<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">HDISK</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${OPTARG}</span>&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
          f<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">FILE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${OPTARG}</span>&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
          h<span style="color: #000000; font-weight: bold;">|*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> _usage<span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">esac</span>
  <span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># Check if file exists</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$FILE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;File <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">${FILE}</span><span style="color: #000099; font-weight: bold;">\&quot;</span> does not exist&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">2</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">#*********#</span>
<span style="color: #666666; font-style: italic;"># * Main *#</span>
<span style="color: #666666; font-style: italic;">#*********#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Make a copy of the current file</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$FILE</span> <span style="color: #800000;">${PWD}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.<span style="color: #800000;">${DATE}</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Modify source_disk_data stanza</span>
<span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'
/source_disk_data:/{c=8}!(c&amp;&amp;c--)
'</span> <span style="color: #800000;">${FILE}</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp1
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'
/source_disk_data;/ a\
\
source_disk_data:\
        PVID= 000107b0e68c43ec\
        PHYSICAL_LOCATION= U787F.001.DQM0XW6-P1-C4-T1-L3-L0\
        CONNECTION= scsi0//3,0\
        LOCATION= 00-08-00-3,0\
        SIZE_MB= 70006\
        HDISKNAME= '</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">$HDISK</span>&quot;</span><span style="color: #ff0000;">'
'</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp1 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp2
&nbsp;
<span style="color: #666666; font-style: italic;"># Modify VG_SOURCE_DISK_LIST, LV_SOURCE_DISK_LIST and</span>
<span style="color: #666666; font-style: italic;"># COPIES stanza</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'
/VG_SOURCE_DISK_LIST/ c\
        VG_SOURCE_DISK_LIST= '</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">$HDISK</span>&quot;</span><span style="color: #ff0000;">'
'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'
/LV_SOURCE_DISK_LIST/ c\
        LV_SOURCE_DISK_LIST= '</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">$HDISK</span>&quot;</span><span style="color: #ff0000;">'
'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'
/COPIES/ c\
        COPIES= 1
'</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp2 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp3
&nbsp;
<span style="color: #666666; font-style: italic;"># Modify PP stanza</span>
<span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'
BEGIN { FS=&quot;=&quot;; modified=0}
&nbsp;
/COPIES/,/BB_POLICY/ {
&nbsp;
   if ($1 ~ /LPs$/) { saved = $2; }
&nbsp;
   if($1 ~ /PP$/) { var = saved; }
   else { var=$2; }
&nbsp;
   print $1&quot;=&quot;var;
   modified = 1
}
{
  if (modified == 0) { print; }
&nbsp;
  else { modified = 0; }
}
'</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp3 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp4
&nbsp;
<span style="color: #666666; font-style: italic;"># Copy modified file to $PWD</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp4 <span style="color: #800000;">${PWD}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.1PV
&nbsp;
<span style="color: #666666; font-style: italic;"># Cleanup temp files</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp1
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp2
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp3
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${FILE}</span>.tmp4
&nbsp;
<span style="color: #666666; font-style: italic;"># Output</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Backup of <span style="color: #007800;">${FILE}</span> is located at <span style="color: #007800;">${PWD}</span>/<span style="color: #007800;">${FILE}</span>.<span style="color: #007800;">${DATE}</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Modified file is located at <span style="color: #007800;">${PWD}</span>/<span style="color: #007800;">${FILE}</span>.1PV&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

<p>As you can see, the script is very ugly and messy, but it does the job. I&#8217;ve successfully used this to do a number of migrations. Feel free to use, abuse or modify it. If you do modify it though, please let me know, and I can incorporate the changes into mine <img src='http://www.kristijan.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2012/04/automatically-reduce-image-data-to-a-single-pv/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NFS cross-mounts in PowerHA/HACMP</title>
		<link>http://www.kristijan.org/2011/07/nfs-cross-mounts-in-powerhahacmp/</link>
		<comments>http://www.kristijan.org/2011/07/nfs-cross-mounts-in-powerhahacmp/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 08:38:57 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[HACMP]]></category>
		<category><![CDATA[PowerHA]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[cross mount]]></category>
		<category><![CDATA[hacmp]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[powerha]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=238</guid>
		<description><![CDATA[Combining NFS with PowerHA we can achieve a HANFS (Highly Available Network File System). The basic concept behind this solution is that one node in the cluster mounts the resource locally, and offers that as an exported resource via a serviceable IP. Another node in the cluster is then configured  [...]]]></description>
			<content:encoded><![CDATA[<p>Combining NFS with PowerHA we can achieve a HANFS (Highly Available Network File System). The basic concept behind this solution is that one node in the cluster mounts the resource locally, and offers that as an exported resource via a serviceable IP. Another node in the cluster is then configured to take on the resource in the event of failure.</p>
<p>If you&#8217;re following this, I&#8217;m taking the assumption that your cluster is already configured, you have a working IP network and have set up a shared volume group between the cluster nodes that will be handling the HANFS failover. Before we get started though, there are a few things which need to be installed/verified.<br />
<span id="more-238"></span><br />
<strong><font size="4">Prerequisites</font></strong><br />
The cluster.es.nfs.rte fileset needs to be installed so that PowerHA can work with HANFS.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># lslpp -l cluster.es.nfs.rte
  Fileset                      Level  State      Description
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  cluster.es.nfs.rte         5.5.0.1  COMMITTED  ES NFS Support
&nbsp;
Path: /etc/objrepos
  cluster.es.nfs.rte         5.5.0.1  COMMITTED  ES NFS Support</pre></div></div>

<p>Also, since we&#8217;re dealing with NFS, we need to make sure we have the portmapper daemon running.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># lssrc -s portmap
Subsystem         Group            PID          Status
 portmap          portmap          213160       active</pre></div></div>

<p>To have the portmapper daemon start during system boot, you&#8217;ll need to modify /etc/rc.tcpip and uncomment the start line below.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Start up Portmapper
start /usr/sbin/portmap &quot;$src_running&quot;</pre></div></div>

<p><strong><font size="4">Scenario</font></strong><br />
Below is a table of what the HANFS layout looks like (click image to expand).</p>
<p><a href="http://www.kristijan.org/images/layout.png" rel="lightbox[layout]" title="HANFS Resource Group layout"><img src="http://www.kristijan.org/images/layout_small.png" align="center" border="0"></a></p>
<p>We have a Resource Group (RG_nfs) which contains an Application Server (app_nfsv4) and a Service IP Label (serviceip-nfs). There is a Shared Volume Group (haNFSvg) which contains some Shared Logical Volumes &amp; Filesystems. The thing to take note here, is that we are only exporting two of the three filesystems that you see in the table. The /nfs_stable filesystem will be the NFSv4 stable storage path location. The below is taken from the IBM website[1]. I recommend you read it for further information on NFSv4 stable storage and PowerHA.</p>
<blockquote><p>&#8220;Stable Storage is a file system space that is used to save the state information by the NFSv4 server. This is very crucial for maintaining NFSv4 client&#8217;s state information to facilitate smooth and transparent fallover/fallback/move of the Resource group from one node to other.&#8221;</p></blockquote>
<p><strong><font size="4">Configuration</font></strong><br />
With the above information in hand, we&#8217;re ready to start configuring HANFS.</p>
<p><strong>Step 1 (All Nodes) Set the NFS domain</strong><br />
The NFSv4 domain needs to be set on all cluster nodes which will be responsible for taking on the RG_nfs resource group in the event of a failure.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># chnfsdom	          &lt;- This will show the current NFS domain
# chnfsdom [new_domain]	  &lt;- To set a new NFS domain</pre></div></div>

<p><strong>Step 2 (All Nodes) Create mount points</strong><br />
The mount points need to be created on all cluster nodes which will be responsible for taking on the RG_nfs resource group in the event of a failure.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mkdir -p /home/kristian
# mkdir -p /data</pre></div></div>

<p>Take note that we&#8217;re only creating the mount points here, and not the logical volumes or filesystems.</p>
<p><strong>Step 3 &#8211; Create logical volumes and filesystems</strong><br />
Now we create the following logical volumes:</p>
<ul>
<li>hanfs_kris_lv</li>
<li>hanfs_data_lv</li>
<li>hanfs_nfsstable_lv</li>
</ul>
<p>Create the logical volumes using the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; System Management (C-SPOC)
		-&gt; HACMP Logical Volume Management
			-&gt; Shared Logical Volumes
				-&gt; Add a Shared Logical Volume</pre></div></div>

<p>Create the filesystems using the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; System Management (C-SPOC)
		-&gt; HACMP Logical Volume Management
			-&gt; Shared File Systems
				-&gt; Enhanced Journaled File Systems
					-&gt; Add an Enhanced Journaled File System on a Previously Defined Logical Volume</pre></div></div>

<p>We should now see the 2 filesystems which we are exporting and the stable storage filesystem apart of the shared volume group</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># lsvg -l haNFSvg
haNFSvg:
LV NAME              TYPE       LPs     PPs     PVs  LV STATE      	MOUNT POINT
hanfs_kris_lv        jfs2       107     107     1    open/syncd		/hanfs_home_kristian
hanfs_data_lv        jfs2       32      32      1    open/syncd  	/hanfs_data
hanfs_nfsstable_lv   jfs2       75      75      1    open/syncd  	/nfs_stable</pre></div></div>

<p><strong>Step 4 &#8211; Configure the Application Server</strong><br />
Luckily for us, IBM have made this step rather easy and have provided start, stop and monitor scripts. The location of these scripts are below.</p>
<ul>
<li> /usr/es/sbin/cluster/apps/clas_nfsv4/start</li>
<li> /usr/es/sbin/cluster/apps/clas_nfsv4/stop</li>
<li> /usr/es/sbin/cluster/apps/clam_nfsv4/monitor</li>
</ul>
<p>Create an Application Server using the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; Extended Configuration
		-&gt; Extended Resource Configuration
			-&gt; HACMP Extended Resources Configuration
				-&gt; Configure HACMP Applications Servers
					-&gt; Add an Application Server</pre></div></div>

<p>To configure Application Server monitoring, use the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; Extended Configuration
		-&gt; Extended Resource Configuration
			-&gt; HACMP Extended Resources Configuration
				-&gt; Configure HACMP Application Monitoring
					-&gt; Configure Custom Application Monitors
						-&gt; Add a Custom Application Monitor</pre></div></div>

<p><strong>Step 5 &#8211; Configure the Resource Group for HANFS</strong><br />
The next step is to configure the RG_nfs resource group with the values needed for HANFS.</p>
<p>Modify the resource group using the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; Extended Configuration
		-&gt; Extended Resource Configuration
			-&gt; HACMP Extended Resource Group Configuration
				-&gt; Change/Show Resources and Attributes for a Resource Group</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Service IP Labels/Addresses				[serviceip-nfs]
Application Servers					[app_nfsv4]
&nbsp;
Filesystems (empty is ALL for VGs specified)		[/hanfs_home_kristian /hanfs_data /nfs_stable]
Filesystems Consistency Check				fsck
Filesystems Recovery Method				sequential
Filesystems mounted before IP configured		true
Filesystems/Directories to Export (NFSv2/3)		[]
&nbsp;
Filesystems/Directories to Export (NFSv4)		[/hanfs_home_kristian /hanfs_data]
Stable Storage Path (NFSv4)				[/nfs_stable]
Filesystems/Directories to NFS Mount			[/home/kristian;/hanfs_home_kristian /data;/hanfs_data]</pre></div></div>

<p>Most vaules are self explainatory. We set &#8220;Filesystems mounted before IP configured&#8221; to true so we prevent access from clients before the filesystems are ready. We also specify mount points in the following format [mount point];[exported filesystem]</p>
<p><strong>Step 6 &#8211; HANFS exports file</strong><br />
Just like NFS has /etc/exports, HANFS has /usr/es/sbin/cluster/etc/exports. If you need to specify NFS options, you MUST use /usr/es/sbin/cluster/etc/exports and not /etc/exports. For help creating the exports file, you can use &#8220;smit mknfsexp&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">* Pathname of directory to export			[]
  Anonymous UID						[-2]
  Public filesystem?					no
* Export directory now, system restart or both		both
  Pathname of alternate exports file			[/usr/es/sbin/cluster/etc/exports]
  ...
  ...</pre></div></div>

<p><strong>Step 7 &#8211; Synchronize the cluster</strong><br />
We now need to synchronize our changes to the other cluster nodes</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; Extended Configuration
		-&gt; Extended Verification and Synchronization</pre></div></div>

<p><strong>Step 8 &#8211; Bring the Resource Group online</strong><br />
We now bring the resource group online. It&#8217;s a good idea at this stage to tail the hacmp.out file to see any errors.</p>
<p>To bring the resource group online.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt;  System Management (C-SPOC)
		-&gt; HACMP Resource Group and Application Management
			-&gt; Bring a Resource Group Online</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># tail -f /var/hacmp/log/hacmp.out
...
+RG_nfs:cl_activate_nfs(.110):/home/kristian;/hanfs_home_kristian[nfs_mount+102] : Attempt 0/5 to NFS-mount at Jul 26 11:01:21.000
+RG_nfs:cl_activate_nfs(.110):/home/kristian;/hanfs_home_kristian[nfs_mount+103] mount -o vers=4,hard,intr serviceip-nfs:/hanfs_home_kristian /home/kristian</pre></div></div>

<p>You should now see the filesystems mounted.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mount
  node       	mounted        		   mounted over    		 vfs       date        options
--------      --------------  	          ---------------  		------ ------------ ---------------
...
		/dev/hanfs_kris_lv 	   /hanfs_home_kristian 	jfs2   Jul 26 14:36 rw,log=INLINE
		/dev/hanfs_data_lv 	   /hanfs_data      		jfs2   Jul 26 14:36 rw,log=INLINE
		/dev/hanfs_nfsstable_lv    /nfs_stable       		jfs2   Jul 26 14:36 rw,log=INLINE
serviceip-nfs 	/hanfs_home_kristian	   /home/kristian    		nfs4   Jul 26 14:36 vers=4,hard,intr
serviceip-nfs 	/hanfs_data 		   /data 			nfs4   Jul 26 14:36 vers=4,hard,intr</pre></div></div>

<p>What you&#8217;re seeing above is the output from the mount command ran from the cluster node which currently has the RG_nfs resource group ONLINE. You&#8217;ll notice that it has the shared logical volumes and filesystems mounted, then a local NFS export from itself to mount /home/kristian and /data. On the other cluster nodes, you will only see the NFS mounts.</p>
<p>There you have it, NFS cross-mounts with PowerHA.</p>
<p>[1] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.hacmp.plangd/ha_plan_nfs_stable_storage.htm">http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.hacmp.plangd/ha_plan_nfs_stable_storage.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/07/nfs-cross-mounts-in-powerhahacmp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OSX Lion and AFP shares</title>
		<link>http://www.kristijan.org/2011/07/mac-osx-lion-afp-shares/</link>
		<comments>http://www.kristijan.org/2011/07/mac-osx-lion-afp-shares/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 06:56:50 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[afp]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=230</guid>
		<description><![CDATA[Like most Apple Mac users this week, I updated from 10.6 Snow Leopard to 10.7 Lion of Apples operating system. Everything seemed to go fine, I noticed a few little quirks, but the one that gave me the biggest &#8220;Oh no, can I go back!?&#8221; was when I tried mounting my AFP share on my FreeNAS  [...]]]></description>
			<content:encoded><![CDATA[<p>Like most Apple Mac users this week, I updated from 10.6 Snow Leopard to 10.7 Lion of Apples operating system. Everything seemed to go fine, I noticed a few little quirks, but the one that gave me the biggest &#8220;Oh no, can I go back!?&#8221; was when I tried mounting my AFP share on my FreeNAS server.<br />
<span id="more-230"></span></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iMac:~ kristijan$ mount_afp -i afp://kristijan@nas/Media ./Media/
Password: 
mount_afp: AFPMountURL returned error -5002, errno is -5002</pre></div></div>

<p>For those that use the &#8220;Connect to server&#8230;&#8221; option from Finder would have come across the following pop up error message: &#8220;The version of the server you are trying to connect to is not supported. Please contact your system administrator to resolve the problem.&#8221;</p>
<p>So after some searching around, I found out that OSX Lion no longer supports AFP (and SMB/CIFS) servers which use the DHCAST128 authentication method. Apple flagged this is a security risk, and outright disabled it in Lion. Now I could have just scrapped AFP all together and started using NFS shares, but AFP just works a hell of a lot better with OSX clients.</p>
<p>Some more searching found this page[1], and a solution to my problem. Full credits to this solution go to Alexander Wilde.</p>
<p>Follow the below to enable DHCAST128 under Mac OSX Lion</p>
<p>Launch Terminal.app (/Applications/Utilities/Terminal.app) and run the following two commands.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iMac:~ kristijan$ sudo chmod o+w /Library/Preferences
Password:
iMac:~ kristijan$ defaults write /Library/Preferences/com.apple.AppleShareClient afp_host_prefs_version -int 1</pre></div></div>

<p>Now restart your computer.</p>
<p>Launch Terminal.app or Finder and attempt to mount the AFP share again. This will fail, but what it will do is recreate the full preferences file.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iMac:~ kristijan$ mount_afp -i afp://kristijan@nas/Media ./Media/
Password: 
mount_afp: AFPMountURL returned error -5002, errno is -5002</pre></div></div>

<p>Now run the following two commands.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iMac:~ kristijan$ sudo defaults write /Library/Preferences/com.apple.AppleShareClient afp_disabled_uams -array &quot;Cleartxt Passwrd&quot; &quot;MS2.0&quot; &quot;2-Way Randnum exchange&quot;
Password:
iMac:~ kristijan$ sudo chmod o-w /Library/Preferences</pre></div></div>

<p>Restart your computer and mount the AFP share again, it should now work.</p>
<p>[1] &#8211; <a href="http://www.alexanderwilde.com/2011/04/os-x-lion-connection-error-with-afp-and-workaround">http://www.alexanderwilde.com/2011/04/os-x-lion-connection-error-with-afp-and-workaround</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/07/mac-osx-lion-afp-shares/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>VIO: Virtual Media Library</title>
		<link>http://www.kristijan.org/2011/06/vio-virtual-media-library/</link>
		<comments>http://www.kristijan.org/2011/06/vio-virtual-media-library/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 07:30:32 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[PowerVM]]></category>
		<category><![CDATA[VIO]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[loopmount]]></category>
		<category><![CDATA[vio]]></category>
		<category><![CDATA[virtual media library]]></category>
		<category><![CDATA[vml]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=206</guid>
		<description><![CDATA[The first LPAR that I normally build post VIOS installation is a NIM LPAR. Once you have your NIM server setup, building the rest of your LPAR&#8217;s becomes a much simpler task. However, what do you do when there isn&#8217;t an existing NIM environment, or you don&#8217;t have access to the physical servers to  [...]]]></description>
			<content:encoded><![CDATA[<p>The first LPAR that I normally build post VIOS installation is a NIM LPAR. Once you have your NIM server setup, building the rest of your LPAR&#8217;s becomes a much simpler task. However, what do you do when there isn&#8217;t an existing NIM environment, or you don&#8217;t have access to the physical servers to insert a disc to perform the AIX install? This is where the Virtual Media Library comes to the rescue. The Virtual Media Library is a feature of the Virtual I/O Server which allows you to present an ISO image to underlying LPAR&#8217;s. The best thing about the Virtual Media Library is that it&#8217;s very quick and simple to set up.<br />
<span id="more-206"></span><br />
From here on out, I&#8217;ll be referring to the Virtual Media Library as VML.</p>
<p>Getting right into it, we first want to define the VML. Now you can create a new volume group for the VML, or simply use rootvg. If you do decide to use rootvg, just be sure to exclude the filesystem when you do your VIO mksysb backups. The other paramater that we need to specify is the size of the VML. Make it big enough to cater for all your ISO volumes that you wish to present to underlying LPAR&#8217;s. In the example below, I&#8217;ve gone with 10G.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ mkrep -sp rootvg -size 10G
Virtual Media Repository Created
Repository created within &quot;VMLibrary&quot; logical volume</pre></div></div>

<p>We&#8217;ve now created an empty VML repository which backs onto the /var/vio/VMLibrary filesystem. You can view the VML repository by running the lsrep command.</p>
<p>Now it&#8217;s time to upload your ISO images over to the VIOS. At this stage, I&#8217;ll bring up a root shell in the VIOS and change the root password. This will allow me to SCP across the ISO images into the /var/vio/VMLibrary folder.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ oem_setup_env
# passwd</pre></div></div>

<p>Upload your ISO images into /var/vio/VMLibrary</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># ls -l /var/vio/VMLibrary/AIX-6100-06-01-Disk1.iso
-r--------    1 root     system   4236148736 Apr 06 18:07 /var/vio/VMLibrary/AIX-6100-06-01-Disk1.iso</pre></div></div>

<p>Check the VML repository to see the new image available for use.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ lsrep
Size(mb) Free(mb) Parent Pool         Parent Size      Parent Free
   10198     6158 rootvg                   279552           236288
&nbsp;
Name                                    File Size Optical         Access
AIX-6100-06-01-Disk1.iso                     4040 None            ro</pre></div></div>

<p>Great, so we now have some media in the VML library ready to be used. What we need to do from here is create a File Backed Optical Device for the particular LPAR you want cd0 to appear on.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ mkvdev -fbo -vadapter vhost1
vtopt0 Available</pre></div></div>

<p>Now let&#8217;s load the image from the VML into vtopt0.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ loadopt -vtd vtopt0 -disk AIX-6100-06-01-Disk1.iso
$ lsmap -vadapter vhost1
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost1          U9133.55A.066EB4H-V1-C34                     0x00000000
&nbsp;
VTD                   vtopt0
Status                Available
LUN                   0x8200000000000000
Backing device        /var/vio/VMLibrary/AIX-6100-06-01-Disk1.iso
Physloc
Mirrored              N/A</pre></div></div>

<p>Now you can boot the LPAR off CD/DVD and perform the AIX install.</p>
<p>Two other useful commands to know:</p>
<p>To unload the image.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ unloadopt -vtd vtopt0</pre></div></div>

<p>If you&#8217;re prompted for another disk (for example, disc 2 during the AIX install).</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ loadopt -f -vtd vtopt0 -disk AIX-6100-06-01-Disk2.iso</pre></div></div>

<p>There you have it, a quick and simple way of getting AIX installed onto a LPAR if you don&#8217;t have any other method of installation. Another thing to take note of, is that you can load any ISO image into the VML, it doesn&#8217;t have to be an AIX installation image. Quite useful for when you have to install any bit of software and all you have is the ISO image.</p>
<p>On that note though, the loopmount command was added in AIX 6.1 TL4. This allows you to mount ISO images directly from AIX without using the VML.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># loopmount -i image.iso -o &quot;-V cdrfs -o ro&quot; -m /mountpoint</pre></div></div>

<p>Good luck, enjoy, and any questions can be popped into the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/06/vio-virtual-media-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading your AIX environment using multibos</title>
		<link>http://www.kristijan.org/2011/03/upgrading-your-aix-environment-using-multibos/</link>
		<comments>http://www.kristijan.org/2011/03/upgrading-your-aix-environment-using-multibos/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 00:52:56 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[volume group]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=197</guid>
		<description><![CDATA[If you haven&#8217;t clued on by now, AIX is my operating system of choice. I&#8217;m sure there are many arguments for and against, but looking at it from a systems administrator view point, it&#8217;s second to none. Anyway, that&#8217;s a story for another time. What I&#8217;m writing about today is patching your AIX  [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t clued on by now, AIX is my operating system of choice. I&#8217;m sure there are many arguments for and against, but looking at it from a systems administrator view point, it&#8217;s second to none. Anyway, that&#8217;s a story for another time. What I&#8217;m writing about today is patching your AIX installations using multibos. Now before I get started, I&#8217;ll stress two points:</p>
<p>1) Chris Gibson has already written two great (and far more in depth) articles on multibos, which I recommend reading before going any further (Links: <a href="http://www.ibmsystemsmag.com/aix/trends/aix/AIX-Updates-With-Multibos/">here</a> and <a href="http://www.ibmsystemsmag.com/aix/administrator/systemsmanagement/Working-With-multibos/">here</a>).<br />
2) This blog of mine serves two purposes; To share some of the things I come about during my sysadmin activities and secondly also a dumping ground for documents I write for myself. This post is the latter, as multibos isn&#8217;t something that I use daily (maybe a few times a year), and really, who&#8217;s going to remember all those syntax switches <img src='http://www.kristijan.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Now, assuming you&#8217;ve read both articles, I don&#8217;t need to go into the benefits of multibos and I&#8217;ll dive straight into the how. I&#8217;ll be working on upgrading an AIX instance running 6100-05-01-1016 to the latest ML which at the time of writing is 6100-06-04-1112<br />
<span id="more-197"></span><br />
<strong>PREREQUISITES</strong><br />
First things first, we need to make sure the current environment is ready to be copied. The two main things that I look for are:</p>
<p><strong>1.</strong> Make sure the current environment doesn&#8217;t have any missing filesets.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; oslevel -s
6100-05-01-1016
root@AIX / &gt; instfix -i | grep ML
    All filesets for 6100-00_AIX_ML were found.
    All filesets for 6100-01_AIX_ML were found.
    All filesets for 6100-02_AIX_ML were found.
    All filesets for 6100-03_AIX_ML were found.
    All filesets for 6100-04_AIX_ML were found.
    All filesets for 6100-05_AIX_ML were found.</pre></div></div>

<p>**Note: If a particular ML doesn&#8217;t return positive (e.g. 6100-05_AIX_ML), use <strong>instfix -ciqk 6100-05_AIX_ML | grep &#8220;:-:&#8221;</strong> to see the fileset causing issues and rectify it.</p>
<p><strong>2.</strong> Make sure all filesets have been committed. Now I&#8217;m not entirely sure if this is a requirement, but I prefer to work with an as clean environment as possible.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; lslpp -l | grep -i applied</pre></div></div>

<p>**Note: If you have software which is in an applied state, commit it.</p>
<p>Now that we&#8217;re happy with the state of the environment, you need to verify that there is enough room in rootvg to make copies of the following logical volumes [/ (hd4), /usr (hd2), /var (hd9var), /opt (hd10opt) and the boot logical volume (hd5)].</p>
<p>Once we&#8217;ve satisfied the above requirement, we can get started with the multibos work. I&#8217;m not going to dissect each command, so I suggest reading the multibos man pages to know what each switch does. The only one that I&#8217;ll explain is -p, which does a preview of the multibos command executed.</p>
<p><strong>MULTIBOS</strong><br />
<strong>1.</strong> Remove any previous standby multibos environments. The below command will return a FAILURE status if you don&#8217;t have a standby multibos environment. If you&#8217;re using multibos for the first time, this will be the case.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -RX
Initializing multibos methods ...
Initializing log /etc/multibos/logs/op.alog ...
Gathering system information ...
multibos: 0565-077 Unable to locate standby BOS.
&nbsp;
Log file is /etc/multibos/logs/op.alog
Return Status: FAILURE</pre></div></div>

<p><strong>2.</strong> Create the standby BOS. New logical volumes and filesystems will be created prefixed and with bos_. This can take a while to complete.</p>
<p>This will preview the creation of the multibos environment and list all the logical volumes that will be copied.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -sXp
...
...
Log file is /etc/multibos/logs/op.alog
Return Status = SUCCESS</pre></div></div>

<p>You can also view the log file using the alog command.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; alog -of /etc/multibos/logs/op.alog</pre></div></div>

<p>If everything completed successfully, run the command again without the preview.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -sX</pre></div></div>

<p>Once complete, you&#8217;ll notice that the new logical volumes will be prefixed with bos_</p>
<p><strong>3.</strong> Once complete, you can drop into a multibos shell and check oslevel, it should be the same as the host OS.</p>
<p>The below command will mount all the filesystems required and drop you in a MULTIBOS> prompt</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -S
...
...
MULTIBOS&gt; oslevel -s
6100-05-01-1016</pre></div></div>

<p>To umount all the filesystems and break out of the multibos environment.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">MULTIBOS&gt; exit</pre></div></div>

<p><strong>4.</strong> Apply the TL/ML to the multibos environment.</p>
<p>The below command will tell multibos to apply the updates from the specified location (which is the location that your new ML resides).</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -Xac -l /home/kristijan/6100-06-04</pre></div></div>

<p>Drop into the multibos shell again and check that the ML has been successfully applied.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -S
MULTIBOS&gt; oslevel -s
6100-06-04-1112
MULTIBOS&gt; instfix -i | grep ML
    	All filesets for 6100-00_AIX_ML were found.
    	All filesets for 6.1.0.0_AIX_ML were found.
    	All filesets for 6100-01_AIX_ML were found.
    	All filesets for 6100-02_AIX_ML were found.
    	All filesets for 6100-03_AIX_ML were found.
    	All filesets for 6100-04_AIX_ML were found.
    	All filesets for 6100-05_AIX_ML were found.
    	All filesets for 6100-06_AIX_ML were found.
MULTIBOS&gt; exit</pre></div></div>

<p><strong>5.</strong> Verify that the bootlist now contains blv=bos_hd5. bos_hd5 is the location of the new boot logical volume. It will be at the top of the list when you run the bootlist command.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; bootlist -m normal -o
hdisk0 blv=bos_hd5 pathid=0
hdisk0 blv=hd5 pathid=0</pre></div></div>

<p>You can now reboot into the new environment and verify that all went to plan.</p>
<p><strong>6.</strong> If you need to back out of the change for any reason, just change the bootlist order back to blv=hd5 and reboot. Now, while this doesn&#8217;t bother me, it may bother others. You&#8217;ll notice after the reboot that your environment is now using the bos_ logical volumes. The only way to get your environment back to how it was using the original logical volume names is to create another multibos environment, and reboot into it. Since your current boot environment is using the bos_ logical volumes, it will create it using the original logical volume names (i.e. without the bos_). For those that want to do that, redo step 2 and reboot. However, I suggest not doing this for a week or so to be sure you&#8217;re happy with the new changes, as creating a new multibos environment will remove the backup environment with the previous ML.</p>
<p>As always, post comments/questions below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/03/upgrading-your-aix-environment-using-multibos/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSM Commands (dsh, dping, dcp and dshbak) for AIX</title>
		<link>http://www.kristijan.org/2011/02/csm-commands-dsh-dping-dcp-and-dshbak-for-aix/</link>
		<comments>http://www.kristijan.org/2011/02/csm-commands-dsh-dping-dcp-and-dshbak-for-aix/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 03:28:45 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[dcp]]></category>
		<category><![CDATA[dping]]></category>
		<category><![CDATA[dsh]]></category>
		<category><![CDATA[dshbak]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=187</guid>
		<description><![CDATA[Cluster Systems Management (CSM) software provides a bunch of tools to manage from a single point of control your AIX environment. There are a number of commands available[1] but the main four which I find quite useful are dsh, dping, dcp and dshbak. In this post, I&#8217;ll go over each command and some  [...]]]></description>
			<content:encoded><![CDATA[<p>Cluster Systems Management (CSM) software provides a bunch of tools to manage from a single point of control your AIX environment. There are a number of commands available[1] but the main four which I find quite useful are dsh, dping, dcp and dshbak. In this post, I&#8217;ll go over each command and some of its uses.<br />
<span id="more-187"></span><br />
Before we begin, we need to select a server which is going to be the point of control. While this can be any AIX server on the network, it&#8217;s mainly common to have your NIM server as the point of control. In the case of dsh and dcp, we&#8217;re going to be using SSH, so keys[2] need to be setup between your point of control server and the rest of your environment.</p>
<p><strong>DSH/DSHBAK</strong><br />
Distributed Shell (dsh) allows you to concurrently run commands on remote nodes. It requires very little setup, but it&#8217;s one of those hidden AIX commands that few administrators know about. As you may have already guessed, dsh comes with the CSM client filesets. Specifically, it comes from the csm.dsh fileset which creates a symbolic link &#8211; /usr/bin/dsh -> /opt/csm/bin/dsh</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; lslpp -w /usr/bin/dsh
  File                                        Fileset               Type
  ----------------------------------------------------------------------------
  /usr/bin/dsh                                csm.dsh               Symlink</pre></div></div>

<p>There are a few environmental variables that we need to setup first.</p>
<p><em>DSH_NODE_RSH=/usr/bin/ssh</em> &#8211; By default, dsh uses rsh to execute remote commands. If you don&#8217;t know why using rsh is a bad idea, hand in your sysadmin card now. We need to tell dsh to execute all remote commands via ssh.<br />
<em>DCP_NODE_RCP=/usr/bin/scp</em> &#8211; As above, dcp uses rcp to send files remotely, so lets change that to use scp<br />
<em>DSH_NODE_OPTS=-q</em> &#8211; This passes the -q option to ssh to suppress the banner message from showing. This just makes the output much easier to read when working with a number of nodes.<br />
<em>DSH_NODE_LIST=/.dsh/model</em> &#8211; You can feed a list of nodes to dsh a number of ways, but I find using text files the best way to manage it.</p>
<p>Most places have a typical dev/mod/prod setup which can consist of a number of servers within each environment. I have four node text files in my /.dsh directory.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-rw-rw-r--    1 root     system          577 Jan 11 10:19 all
-rw-r--r--    1 root     system           71 Feb 12 13:06 dev
-rw-r--r--    1 root     system           75 Oct 28 10:38 mod
-rw-r--r--    1 root     system          106 Jan 25 13:00 prod</pre></div></div>

<p>This way I can run commands on all the nodes in a specific environment, or across all nodes. The easiest way to switch between lists is by using aliases.</p>
<p>In my .kshrc file</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">alias dshmod='export DSH_NODE_LIST=/.dsh/mod'
alias dshprod='export DSH_NODE_LIST=/.dsh/prod'
alias dshdev='export DSH_NODE_LIST=/.dsh/dev'
alias dshall='export DSH_NODE_LIST=/.dsh/all'</pre></div></div>

<p>The contents of the node text files is each node on a single line.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; cat /.dsh/mod
SERVER1
SERVER2
SERVER3</pre></div></div>

<p>That&#8217;s it for the configuration. You can run dsh -q to show the current configured variables. Look at the man page for dsh to see further configurable options and the IBM website[3].</p>
<p>Let&#8217;s see if it works.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dshmod
root@AIX / &gt; dsh date
SERVER1: Mon Feb 28 12:59:34 EETDT 2011
SERVER2: Mon Feb 28 12:53:58 EETDT 2011
SERVER3: Mon Feb 28 12:56:51 EETDT 2011</pre></div></div>

<p>If you only wanted to run the command on a select number of hosts, you can use the -w switch.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dsh -w SERVER1,SERVER3 &quot;date&quot;
SERVER1: Mon Feb 28 13:01:20 EETDT 2011
SERVER3: Mon Feb 28 12:55:43 EETDT 2011</pre></div></div>

<p>We can make that output look a bit neater by piping through the dshbak command.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dsh -w SERVER1,SERVER3 &quot;date&quot; | dshbak
HOST: SERVER1
-------------
Mon Feb 28 13:17:17 EETDT 2011
&nbsp;
HOST: SERVER3
-------------
Mon Feb 28 13:11:41 EETDT 2011</pre></div></div>

<p><strong>DCP</strong><br />
Just like the dsh command, dcp allows you to send files concurrently to multiple hosts. dcp requires the same environmental setup as dsh. Seeing as that&#8217;s already setup, we can use it straight away.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; lmktemp test 1M
test
root@AIX / &gt; dcp test /
root@AIX / &gt; dsh ls -l /test
SERVER1: -rw-r--r--   1 root     system      1048576 Feb 28 13:32 /test
SERVER2: -rw-r--r--   1 root     system      1048576 Feb 28 13:32 /test
SERVER3: -rw-r--r--   1 root     system      1048576 Feb 28 13:32 /test</pre></div></div>

<p>What I did above is created a 1M file called test, used dcp to send it to my hosts, then verified the file was on each node using dsh. You can find more about dcp from the man pages and the IBM website[4].</p>
<p><strong>DPING</strong><br />
The dping command allows you to ping nodes in parallel (with the option of serially). Now, it doesn&#8217;t read the DSH_NODE_LIST variable like dsh/dcp, but you can pass the -f option and tell it to.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dping -f /.dsh/mod
SERVER1: ping (alive)
SERVER2: ping (alive)
SERVER3: ping (alive)
SERVER4: noping (unreachable)</pre></div></div>

<p>If you only want to ping a select few hosts, then you can use the -n switch.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dping -n SERVER1,SERVER3
SERVER1: ping (alive)
SERVER3: ping (alive)</pre></div></div>

<p>You can find more on dping by reading the man pages and on the IBM website[5]. Like dsh, you can also pipe the output of dping through dshbak.</p>
<p>If you have any questions on the above, use the comment section below.</p>
<p>[1] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_csmcomm.html">http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_csmcomm.html</a><br />
[2] &#8211; <a href="http://www.ece.uci.edu/~chou/ssh-key.html">http://www.ece.uci.edu/~chou/ssh-key.html</a><br />
[3] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dsh.html">http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dsh.html</a><br />
[4] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dcp.html">http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dcp.html</a><br />
[5] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dping.html">http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dping.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/02/csm-commands-dsh-dping-dcp-and-dshbak-for-aix/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Quickly show memory usage under AIX</title>
		<link>http://www.kristijan.org/2011/01/quickly-show-memory-usage-under-aix/</link>
		<comments>http://www.kristijan.org/2011/01/quickly-show-memory-usage-under-aix/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 23:36:40 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[ksh]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=183</guid>
		<description><![CDATA[Very quick and basic shell script to show total/free/used memory on a host running AIX.

kristijan@AIX &#62; ./meminfo
&#160;
Memory Information
==================
total memory = 1884 MB
free memory  = 94 MB
used memory  = 1790 MB


Script uses standard AIX command line utilities to work out all the values.  [...]]]></description>
			<content:encoded><![CDATA[<p>Very quick and basic shell script to show total/free/used memory on a host running AIX.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">kristijan@AIX &gt; ./meminfo
&nbsp;
Memory Information
==================
total memory = 1884 MB
free memory  = 94 MB
used memory  = 1790 MB</pre></div></div>

<p><span id="more-183"></span></p>
<p>Script uses standard AIX command line utilities to work out all the values. I haven&#8217;t tested it across all versions of AIX (I wrote this on AIX 6.1), but I believe it should work fine. Let me know in the comments if it doesn&#8217;t.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/ksh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Quick view of memory usage under AIX</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #007800;">USED</span>=<span style="color: #000000; font-weight: bold;">`</span>svmon <span style="color: #660033;">-G</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-2</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $3 }'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">USED</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$USED</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">256</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">TOTAL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">lsattr</span> <span style="color: #660033;">-El</span> sys0 <span style="color: #660033;">-a</span> realmem <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">TOTAL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$TOTAL</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1000</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">FREE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$TOTAL</span> - <span style="color: #007800;">$USED</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Memory Information&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;==================&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;total memory = <span style="color: #007800;">$TOTAL</span> MB&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;free memory  = <span style="color: #007800;">$FREE</span> MB&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;used memory  = <span style="color: #007800;">$USED</span> MB&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/01/quickly-show-memory-usage-under-aix/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mounting external USB NTFS drive to FreeNAS</title>
		<link>http://www.kristijan.org/2010/12/mounting-external-usb-ntfs-drive-to-freenas/</link>
		<comments>http://www.kristijan.org/2010/12/mounting-external-usb-ntfs-drive-to-freenas/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 09:15:59 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[NAS]]></category>
		<category><![CDATA[external drive]]></category>
		<category><![CDATA[freenas]]></category>
		<category><![CDATA[nas]]></category>
		<category><![CDATA[ntfs]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=175</guid>
		<description><![CDATA[This is a quick post on how to mount an external USB NTFS formatted hard drive (or memory stick) to FreeNAS. All that&#8217;s needed is to load the fuse driver, but it had me stumped for a bit until I found it in a forum post.
First things first, let&#8217;s plug in our drive and find out the device ID FreeNAS  [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick post on how to mount an external USB NTFS formatted hard drive (or memory stick) to FreeNAS. All that&#8217;s needed is to load the fuse driver, but it had me stumped for a bit until I found it in a forum post.</p>
<p>First things first, let&#8217;s plug in our drive and find out the device ID FreeNAS assigns it.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># dmesg
...
umass1: &lt;ASMedia AS2105, class 0/0, rev 2.10/1.00, addr 3&gt; on uhub4
da1 at umass-sim1 bus 1 target 0 lun 0
da1: &lt;ST950042 0AS 0002&gt; Fixed Direct Access SCSI-0 device 
da1: 40.000MB/s transfers
da1: 476940MB (976773168 512 byte sectors: 255H 63S/T 60801C)</pre></div></div>

<p><span id="more-175"></span><br />
Now we create a mount point for the drive and try mount it like we normally would.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mkdir /mnt/usb
# mount -t ntfs /dev/da1s1 /mnt/usb/</pre></div></div>

<p>You&#8217;ll receive the following error:<br />
<strong>fuse: failed to open fuse device: No such file or directory</strong></p>
<p>Now lets load the fuse driver and try again.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># kldload fuse
# mount -t ntfs /dev/da1s1 /mnt/usb/
# ls -l /mnt/usb
total 4589868
drwxrwxrwx  1 root  wheel        4096 Sep 25 17:48 $RECYCLE.BIN
drwxrwxrwx  1 root  wheel           0 Nov 27 14:25 .Trashes
-rwxrwxrwx  1 root  wheel        4096 Nov 22 18:15 ._.Trashes
...</pre></div></div>

<p>SUCCESS!</p>
<p>It&#8217;s probably easier to load the driver on boot instead of loading it manually like I have above. I haven&#8217;t tried it, but it should work if you call it from loader.conf. I can reboot my NAS at the moment, but if someone wants to give it a shot and post to the comments, that would be great. You can follow instructions on how to edit loader.conf in a previous post [1] of mine.</p>
<p>[1] &#8211; <a href="http://www.kristijan.org/2010/11/freenas-realtek-network-card/">http://www.kristijan.org/2010/11/freenas-realtek-network-card/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2010/12/mounting-external-usb-ntfs-drive-to-freenas/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

