Restoring a Versioned WPAR with NIMI was contacted recently by a customer who was attempting to restore an AIX 5.3 Versioned WPAR (VWPAR) from backup using NIM. The restore worked OK but the data was restored to the wrong volume group!
When the VWPAR was created, the –g option was specified with mkwpar to force the creation of the VWPAR file systems in a separate volume group (named wparvg) rather than the default location of the Global root volume group (rootvg).
# mkwpar -g wparvg -n p8vw2 -B /cg/53gibbo.mksysb -C -O
Running lsvg against wparvg confirmed the file systems were in the right location after creation.
# lsvg -l wparvg wparvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT loglv00 jfs2log 1 1 1 open/syncd N/A fslv02 jfs2 4 4 1 open/syncd /wpars/p8vw2 fslv03 jfs2 2 2 1 open/syncd /wpars/p8vw2/home fslv04 jfs2 12 12 1 open/syncd /wpars/p8vw2/opt fslv05 jfs2 6 6 1 open/syncd /wpars/p8vw2/tmp fslv06 jfs2 56 56 1 open/syncd /wpars/p8vw2/usr fslv07 jfs2 12 12 1 open/syncd /wpars/p8vw2/var
Before handing the VWPAR over for production use, the customer wanted to ensure they could successfully backup and recover the VWPAR using NIM. First they took a backup of the VWPAR using NIM. From the NIM master, they created a “savewpar backup image”, as shown below.
Note: The WPAR was already defined as a NIM client. Refer to section “12.2 Adding a System WPAR to NIM” in the “Exploiting IBM AIX Workload Partitions (SG24-7955-00)” Redbook for information on how to perform this task.
# smit nim_mkres savewpar = a workload partition backup image
Type or select values in entry fields. Press Enter AFTER making all desired changes.
* Resource Name
* Resource Type
* Server of Reso
* Location of Reso
NFS Client Security Meth
NFS Version Acce
Comm
Source for Repl -OR- System Backup Image Creation Options:
CREATE system backup imag
WPAR to back ....
# lsnim -l p8vw2 p8vw2: class = machines type = wpar connect = shell platform = chrp if1 = 10_1_50 p8vw2 0 mgmt_profile1 = gibopvc1 p8vw2 Cstate = ready for a NIM operation prev_state = not running Mstate = currently running cpuid = 00F94F584C00 Cstate_result = success
# lsnim -t savewpar
p8vw
In the Global environment, we then stopped and removed the VWPAR (p8vw2).
# stopwpar -F p8vw2 # rmwpar -F p8vw2
Back on the NIM master, we attempted to restore the VWPAR from the recently created backup image (p8vw2-backup).
# smit nim_wpar_create p8vw2
Type or select values in entry fields. Press Enter AFTER making all desired changes.
* Target Name
Remain NIM client after inst
Specification Reso WPAR Options
WPAR Name
Resource for WPAR Backup Imag
Resource for System Backup Imag
Alternate DEVEXPORTS for inst
Alternate SECATTRS for inst
The restore completed successfully but to our surprise, the VWPAR file systems were in the Global rootvg not wparvg.
# lsvg –l rootvg rootvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT hd5 boot 1 1 1 closed/syncd N/A hd6 paging 8 8 1 open/syncd N/A hd8 jfs2log 1 1 1 open/syncd N/A hd4 jfs2 6 6 1 open/syncd / hd2 jfs2 35 35 1 open/syncd /usr hd9var jfs2 7 7 1 open/syncd /var hd3 jfs2 2 2 1 open/syncd /tmp hd1 jfs2 1 1 1 open/syncd /home hd10opt jfs2 5 5 1 open/syncd /opt hd11admin jfs2 2 2 1 open/syncd /admin lg_dumplv sysdump 16 16 1 closed/syncd N/A
livedump
jfs2
4
4 1
open/syncd /var cglv jfs2 100 100 1 open/syncd /cg fslv02 jfs2 2 2 1 open/syncd /wpars/p8vw2 fslv03 jfs2 1 1 1 open/syncd /wpars/p8vw2/home fslv04 jfs2 6 6 1 open/syncd /wpars/p8vw2/opt fslv05 jfs2 3 3 1 open/syncd /wpars/p8vw2/tmp fslv06 jfs2 28 28 1 open/syncd /wpars/p8vw2/usr fslv07 jfs2 6 6 1 open/syncd /wpars/p8vw2/var
# lsvg -l wparvg wparvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT loglv00 jfs2log 1 1 1 closed/syncd N/A
We attempted the restore again but this time we explicitly included a WPAR “Specification Resource”. We did this to ensure that the restwpar process was using the correct specification file.
# smit nim_wpar_create p8vw2
Type or select values in entry fields. Press Enter AFTER making all desired changes.
* Target Name
Remain NIM client after inst
Specification Reso WPAR Options
WPAR Name
Resource for WPAR Backup Imag
Resource for System Backup Imag
Alternate DEVEXPORTS for inst
Alternate SECATTRS for inst
We created a WPAR Specification NIM resource. The file was created in the Global environment, using the mkwpar command to write out the VWPAR specification details to a text file. This file was then copied to the NIM master to be used to create the NIM resource.
# mkwpar -e p8vw2 -w -o /tmp/cg/p8vw2_cg.cf
# lsnim -l p8vw2-spec p8vw2-spec: class = resources type = wpar_spec Rstate = ready for use prev_state = unavailable for use location = /tmp/cg/p8vw2_cg.cf alloc_count = 1 server = master
# lsnim -t wpar_spec p8vw2-spec resources wpar_spec
The specification file contained the volume group name (wparvg) where each of the VWPAR file systems where located.
# grep vg /tmp/cg/p8vw2_cg.cf rootvgwpar = "no" vg = "wparvg" vg = "wparvg" vg = "wparvg" vg = "wparvg" vg = "wparvg" vg = "wparvg"
# grep -p vg /tmp/cg/p8vw2_cg.cf general: version = "1" name = "p8vw2" hostname = "p8vw2" checkpointable = "no" directory = "/wpars/p8vw2" privateusr = "yes"
uuid = "3e7
devices = "/et architecture = "none" ostype = "1024" xwparipc = "no" auto = "no" rootvgwpar = "no" preserve = "no" routing = "no"
mount: logname = "/dev/loglv00" directory = "/home" vfs = "jfs2" vg = "wparvg" size = "131072"
mount: logname = "/dev/loglv00" mountopts = "rw" directory = "/opt" vfs = "jfs2" vg = "wparvg" size = "786432"
mount: logname = "/dev/loglv00" directory = "/var" vfs = "jfs2" vg = "wparvg" size = "786432"
mount: logname = "/dev/loglv00" directory = "/tmp" vfs = "jfs2" vg = "wparvg" size = "393216"
mount: logname = "/dev/loglv00" directory = "/" vfs = "jfs2" vg = "wparvg" size = "262144"
mount: logname = "/dev/loglv00" mountopts = "rw" directory = "/usr" vfs = "jfs2" vg = "wparvg" size = "3670016"
However, even with the specification file in place, the result was the same and the VWPAR file systems were created in rootvg rather than wparvg.
We eventually discovered that this behaviour was a bug.
IV68299: RESTWPAR OF VWPAR IS CREATED IN ROOTVG
http
Error description
When restoring a backup of a VWPAR that resided in a non-root volume group, the WPAR is created in rootvg, even though the image.data file in the backup indicates the desired volume group.
Local fix
Specify an alternate default volume group using the -M flag of the restvg command. For example: # restwpar -f backup_location -M "-g wparvg" -n wpar_name
Problem summary
When restoring a backup of a VWPAR that resided in a non-root volume group, the WPAR is created in rootvg, even though the image.data file in the backup indicates the desired volume group.
Problem conclusion
Added flag in restwpar to call mkwpar with ignore_lvs=no by default.
Note: Both the Global environment and the NIM master were running AIX 7100-03-04-1441.
We were able to request in ifix from AIX support. Once we installed the ifix, in the Global environment, the restore process via NIM worked as expected and the VWPAR file systems were recovered in wparvg. We did not need to use the WPAR specification NIM resource.
# emgr -l
ID STATE LABEL INSTALL TIME UPDATED BY ABSTRACT
=== ===== ========== ================= ========== ==== 1 S IV68299s4a 04/20/15 01:08:20 RESTWPAR VWPAR CREATED IN ROOTVG
STATE codes: S = STABLE M = MOUNTED U = UNMOUNTED Q = REBOOT REQUIRED B = BROKEN I = INSTALLING R = REMOVING T = TESTED P = PATCHED N = NOT PATCHED SP = STABLE + PATCHED SN = STABLE + NOT PATCHED QP = BOOT IMAGE MODIFIED + PATCHED QN = BOOT IMAGE MODIFIED + NOT PATCHED RQ = REMOVING + REBOOT REQUIRED
# diff /usr 459a460
> IGNO 660a662 > IGNORE_LVS= 664c666
< IMAG ---
> IMAG
# lsvg -l rootvg rootvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT hd5 boot 1 1 1 closed/syncd N/A hd6 paging 8 8 1 open/syncd N/A hd8 jfs2log 1 1 1 open/syncd N/A hd4 jfs2 6 6 1 open/syncd / hd2 jfs2 35 35 1 open/syncd /usr hd9var jfs2 7 7 1 open/syncd /var hd3 jfs2 2 2 1 open/syncd /tmp hd1 jfs2 1 1 1 open/syncd /home hd10opt jfs2 5 5 1 open/syncd /opt hd11admin jfs2 2 2 1 open/syncd /admin lg_dumplv sysdump 16 16 1 closed/syncd N/A
livedump
jfs2
4
4 1
open/syncd /var cglv jfs2 100 100 1 open/syncd /cg
# lsvg -l wparvg wparvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT loglv00 jfs2log 1 1 1 open/syncd N/A fslv02 jfs2 4 4 1 open/syncd /wpars/p8wpar2 fslv03 jfs2 2 2 1 open/syncd /wpars/p8wpar2/home fslv04 jfs2 12 12 1 open/syncd /wpars/p8wpar2/opt fslv05 jfs2 6 6 1 open/syncd /wpars/p8wpar2/tmp fslv06 jfs2 56 56 1 open/syncd /wpars/p8wpar2/usr fslv07 jfs2 12 12 1 open/syncd /wpars/p8wpar2/var
# uname -W 0 # lswpar Name State Type Hostname Directory RootVG WPAR
---- p8vw2 A S p8wpar2 /wpars/p8wpar2 no
# clogin p8vw2
****
*
* Welcome to AIX Version 5.3!
*
* * Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating Syst
*
**** # oslevel -s 5300-12-09-1341 |
Hi Chris,
When
you state 'We were able to request in ifix from AIX support. Once we
installed the ifix, in the Global environment, the restore process via
NIM worked as expected and the VWPAR file systems were recovered in
wparvg. We did not need to use the WPAR specification NIM resource."
The
restore process from nim smit nim_wpar_create actually restores the
versioned wpar client? This can be done from nim to another separate
frame? The ifix replaces the manual restwpar that had to be ran on the
global wpar itself? I ask because I am test restoring a vwpar to a
different frame using different SAN managed by the same NIM server as
the source is. The global was restored via its mksysb from nim. Thank
you!
It would be nice to have the option to restore the WPAR in another VG on the SMIT form. For example one might want to consolidate wpar01, wpar02 and wpar03 on the same host where they have all been in "wparvg" on three hosts. The workaround in the APAR is good enough for me though. Thank you for referring to it.