VIOS Update and other tips

 by Jaqui Lynch is an architect for Forsythe Technology Inc. She can be reached at lynchj@forsythe.com.
VIOS is a critical component of any POWER virtualized environment. Best practices dictate it be kept current and backed up. This article focuses on backups and upgrades, while part two will provide tips and tricks as well as using file-backed optical (FBO).

Backing up the VIOS

To ensure structures for the volume groups (VGs) and virtual definitions are backed up, run a savevgstruct and viosbr prior to backing up a VIOS. Using savevgstruct writes a backup of the structure of the named VG to the /home/ios/vgbackups directory. This is automatically called for all active non-rootvg VGs or storage pools on a VIOS when backupios is run, however, run one anyway to be safe. A sample backup script might contain:
su - padmin -c "ioscli savevgstruct datavg" 
su - padmin -c "ioscli savevgstruct rootclients_vg" 
su - padmin -c "ioscli viosbr –backup –file /tmp/viosabr.backup”
Mount the NFS repository for the backups (/nfsmnt)
su – padmin –c “ioscli backupios –file /nfsmnt/vio2-jun2813.mksysb  -mksysb”
The viosbr command can also be used to view or restore the structures as explained further by the IBM information center.
The previous script backs up the VIOS to a bootable mksysb file. To use the backup with NIM, replace the backupios above with:
mkdir /nfsmnt/nimbkups
backupios -file /nfsmnt/nimbkups
This creates a nim_resources.tar file that can be used for restores as described here.

Integrating VIOS Installs With NIM

A VIOS can be installed using NIM, however, specific steps need to be taken when setting up the VIOS NIM environment:
  1. Add the VIOS partition as a NIM client.
  2. Copy the VIOS mksysb image from the CD to your NIM master.
  3. VIOS 2.2 media now contain three images—the third is on DVD 2—so copy all three images individually to a directory and then use cat to combine them:
    cat /export/mksysb/vios2.2/mksysb_image 
    /export/mksysb/vios2.2/mksysb_image2 
    /export/mksysb/vios2.2/mksysb_image3   
    >/export/mksysb/nim_vios2.2mksysb
    
  4. Now, define the mksysb resource to NIM master.
  5. Define the SPOT on NIM master with the source being the combined mksysb file. (The SPOT cannot be created from an lpp_source.)
  6. Copy the bosinst.data from the DVD and create a viosbosinst resource.
You can now use bos_inst to perform a mksysb install once the partition profile is defined, as explained here.

Updating VIOS

A good strategy for updates starts with updating the Hardware Management Console (HMC), then the firmware, the VIOS and the LPARs. But first, check to ensure the various combinations along the way are compatible and supported.
  1. Download the updates and cross-check compatibility by using FLRT.
  2. Read the VIOS upgrade README file. This is critical and will prevent many problems as it includes the steps required prior to installation.
  3. Check that there are no problems currently with stale physical partitions (PPs), missing disks, etc.
  4. Ensure all paths are redundant so when the VIOS is rebooted the LPARs stay up.
  5. Use HMC Scanner or mksysplan to document the environment:
    • lsvg rootvg checks for stale PPs and physical volumes.
    • lsvg -pv rootvg looks for missing disks.
    • lspath checks for missing paths.
    • netstat –cdlistats determines if link status is up on all used interfaces.
    • errpt checks for errors.
  6. Run the savescript (A) and before backing up the VIOS.
  7. Mount the NFS mountpoint or use the DVD and assign to the VIOS:
  8. Use updateios –commit to commit any uncommitted updates.
The following installs all the fixes in the directory listed by -dev updateios -dev /nfsmount/vios2221 -install -accept. When using system support programs, the upgrade may hang at the end with:
installp:  * * *  A T T E N T I O N ! ! ! 
        Software changes processed …….. effective.
Use ctrl-C to exit this. After the upgrade is complete:
ioslevel
oem_setup_env
oslevel -s
instfix -i | grep ML
    All filesets for 6100-07_AIX_ML were found.
    All filesets for 6.1.0.0_AIX_ML were found.
    Not all filesets for 6100-08_AIX_ML were found.
If some file sets aren’t found, then some didn’t go on and get updated. Typically, this will be some of the language sets or the alt disk install images. These can be found with:
# oslevel -sq
Known Service Packs
-------------------
6100-08-02-1316
6100-08-01-1245

# oslevel -s -l 6100-08-02-1316
Fileset                                 Actual Level       Service Pack Level
-----------------------------------------------------------------------------
bos.alt_disk_install.boot_images        6.1.8.0            6.1.8.15       
bos.loc.utf.ES_ES                       6.1.7.15           6.1.8.15  
These can either be updated or removed to get everything consistent. To update them, copy the necessary updates of the file sets into their own directory and use updateios pointing to that directory or use–remove flag to remove the file sets if they aren’t critical. Now set the bootlist after running bosboot:
bosboot -a -d hdisk0
bosboot -a -d hdisk1
bootlist –m normal hdisk0 hdisk1

Reboot and Backup

Now, it’s time to reboot. Once both VIO servers are complete—and if all is well—run another backup. To save VIO information, see Code Sample 1 and look for part two for more tips and tricks, and how to use FBO.

Code Sample 1
su - padmin -c "ioscli ioslevel" 
su - padmin -c "ioscli lsdev -type disk" 
su - padmin -c "ioscli lsdev -type adapter" 
su - padmin -c "ioscli lsdev -vpd"
su - padmin -c "ioscli lsdev -slots" 
su - padmin -c "ioscli lsmap -all" 
su - padmin -c "ioscli lsmap -all -npiv" 
su - padmin -c "ioscli lsdev -virtual"
su - padmin -c "ioscli lsdev -virtual" 
su - padmin -c "ioscli cfgnamesrv -ls "
su - padmin -c "ioscli entstat -all ent9 "
su - padmin -c "ioscli hostmap -ls" 
su - padmin -c "ioscli lsuser" 
su - padmin -c "ioscli netstat -routinfo" 
su - padmin -c "ioscli optimizenet -list" 
su - padmin -c "ioscli viosecure -firewall view" 
su - padmin -c "ioscli viosecure -view -nonint" 
oslevel -s 

getlvodm -C > disktmp.txt
while read label line
do
  echo "Hdisk is $label" 
  su - padmin -c "ioscli lsdev -dev $label -attr" 
done <"disktmp.txt"

Useful Commands and Tips

In production, a best practice is to run dual VIO servers. This allows for maximum redundancy for networking and storage while still having the flexibility to perform upgrades without an outage. Dual VIO servers allow the use of Link Aggregation Control Protocol (LACP) or other aggregation on the shared Ethernet adapter (SEA) without network interface backup (NIB). As long as each VIOS is connected to a separate network switch, full redundancy is provided with SEA failover. And the full bandwidth of the network adapters on the primary VIOS is now available for use.
SEA failover performance can be improved by setting portfast trunk on the switch ports and by activating dead gateway detection with a ping time of two seconds. (To learn more, see the PowerVM User Group session 5 on PowerVM Best Practices.)
SEA failover performance can be improved by setting portfast trunk on the switch ports and by activating dead gateway detection with a ping time of two seconds. (To learn more, see the PowerVM User Group session 5 on PowerVM Best Practices.)
When configuring the fibre channel (FC) adapters, num_cmd_elems and max_xfer_size might have to be tuned for each. For N-Port ID Virtualization (NPIV), the VIOS must be set to at least as high a value as any client LPARs. Keep in mind that the padmin account is able to gain root privileges, so ensure that the password is well protected. With root privileges the user has access to anything root can see. There’s no need to become root to run the topas utility—simply type in topas_nmon –f or topas_nmon -? (the -? provides a list of options).
If asked to gather data for IBM, it will be necessary to set a debug mode to gather the data. The steps involved in capturing debug output from padmin for IBM are described here.
As padmin, it’s possible to get a command history (using the fc -l command) as well as the contents of the global command log (lsgcl) so the actions taken can be reviewed.
$ fc -l
725     lsrep
726     backupios -file /usr/local/backups/b750viobkp
727     exit
728     lsmap -vadapter vhost0
729     fc –l

$ lsgcl | grep "Aug  9 2013"
Aug  9 2013, 08:25:35 root     ioslevel 
Aug  9 2013, 08:59:22 padmin   license  -swma
Aug  9 2013, 09:00:29 padmin   lsmap  -vadapter vhost0
Aug  9 2013, 09:01:29 padmin   lsgcl 
For advice on a VIOS configuration, consider running the VIOS Advisor, which is now part of the latest VIOS but can also be downloaded here.
Finally, there’s an undocumented way to redirect output when running commands on a VIOS as padmin. The trick is to use tee:
lsmap –all –npiv  | tee npivdata.txt

FBO

FBO is a great way to provide DVD access to LPARs without having to move the CD around. My VIOS normally boots from internal disk with two disks mirrored to each other in rootvg. I add a third disk and put it into its own volume group (VG), which I use as a repository. Whenever I get DVDs with software, I rip them to an ISO image that is then uploaded to the repository. Additionally, a mksysb image can be loaded and an LPAR can be booted from it.
So using hdisk2 as my third disk I create a VG:
mkvg –y datavg hdisk2
mkrep –sp datavg –size 10G
This can be increased later and creates:
/dev/VMLibrary     10.00      5.85   42%        7     1% /var/vio/VMLibrary
We can now load images into the repository from an ISO we have on NFS:
mkvopt -name rhelboot64  -file /usr/local/nfsmnt/rhel-64bit-basedvd.iso
This takes the ISO and copies it as follows:
$ ls -l /var/vio/VMLibrary
-rw-------    1 root     staff     237981696 Jul 25 13:14 rhelboot64
To list the repository:
$ lsrep
Size(mb) Free(mb) Parent Pool         Parent Size      Parent Free
   10199     5989 datavg                   279552           157696
Name                                                  File Size Optical         Access 
rhelboot64                                                  227 None            rw     
In order to use the repository, the virtual host has to be assigned a virtual SCSI FBO adapter; do so with:
mkvdev -fbo -vadapter vhost0
vtopt0 available
Multiple vtopt devices for a client can be created, if desired:
loadopt -vtd vtopt0 -disk rhelboot64 
This example would mount rhelboot64 as if it were a local CD. To unmount it, use:
unloadopt -vtd vtopt0
Also, rmvopt removes an image; rmrep removes a repository; and lsvopt lists the state of the vtopts:
$ lsvopt
VTD             Media                                                 Size(mb)
vtopt0          No Media                                                   n/a

Consistency and Discipline

Maintaining a VIOS isn’t a difficult job. It just requires some consistency and a disciplined approach. The use of dual VIO servers makes maintenance far simpler because it allows for updating one VIOS at a time without taking an outage. A well-maintained VIOS will make a huge difference to the stability and success of the virtualized environment it supports. These tips should help ensure the VIOS is well maintained.

Comentarios