Friday, January 26, 2018

WPAR status in AIX?

WPAR status in AIX?



The status of the wpar can be checked by #lswpar command on the GE.


Defined (D)

The workload partition has been defined by the mkwpar command and is ready for use. But is not active.  Start workload partitions in this state with the startwpar command..


Loaded (L)

The workload partition has been configured in kernel, but processes have not yet been started.


Active (A)

The workload partition is running normally.


Frozen (F)

A checkpoint operatin is initiated, and the processes of the wpar are quiesced, awaiting the storing phase.


Paused (P)

A checkpoint or restart operation has been performed and the wpar processes are ready to tbe resumed or killed.


Broken (B)

An Administrative operation failed, leaving this workload partition is an unusable state.


Transitional (T)

An administrative operation is in progress, the wpar is in process of being created, started, stopped, configured and so on.
 


What is rootvg WPAR and what is System WPAR?

What is rootvg WPAR and what is System WPAR?


Rootvg WPAR: 

A system WPAR which is configured with its own root volume group on one or more dedicated storage devices is called a rootvg WPAR.


System WPAR: 

A system WPAR which is not a rootvg WPAR does not have its own root volume group, but has file systems created in logical volumes created out of the root volume group of the global system.


Advantages of WPAR in aix?

Advantages of WPAR in aix?


    1)   Reduced AIX System administration
    2)   Application encapsulation, monitoring and control
    3)   Rapid environment creation of a new application
    4)   Separated system admin/ Security at application level.
    5)   Live application mobility
    6)   Reduced memory use (Minimum wpar=65MB)
    7)   Rapidly create a new AIX environment in minutes



What is Global Environment in WPAR?

What is Global Environment in WPAR?


Global Environment:  

The Global Environment has an all-encompassing view of processes, Filesystems, Devices, and other User level objects and system level objects within an AIX operating system.

The Global Environment is the same as the traditional AIX login environment. This Environment allows you to view and interact with processes, filesystems, and other system components that are assigned to an active WPAR on the system.

You can create new WPARs only in the Global Environment. Many Administrative tasks can be performed only from the Global Environment.

WPAR:

Consolidation of isolated workloads with a single AIX instance.


VWPAR:

A versioned workload partition (VWPAR) provides a different version runtime environment than the global system.

i.e Global Environment is 7.1 and inside WPAR is in 5.3, this environment is called VWPAR.


What is WPAR?

What is WPAR?


Workload Partition (WPAR) is a software-base virtualization feature of AIX 6 that will provide new capabilities to reduce the number of AIX operating system images that need to be maintained when consolidating multiple workloads on a single server.


WPARs will provide a way for clients to run multiple applications inside the same instance of an AIX operating system while providing security and administrative isolation between applications.



We will discuss the GE (Global environment) and WPAR (Workload partitions) and, VWPAR (Versioned WPAR) in further.






Here we go!!! WPAR !!!

After long time, Here i am gonna update WPAR documents which i am recently working on it. 

As usual, I am gonna give you the concepts and explanation in simple format. Hope it will help.

-Lee



Thursday, October 19, 2017

Crontab in aix, concepts and commands in aix?

Crontab in aix, concepts and commands in aix?



v  Deamon - cron
v  Started by - /etc/inittab
v  startup entry - cron:2:respawn:/usr/sbin/cron (or)  cron:2:respawn:/etc/cron
v  file - crontab
v  file location - /var/spool/cron/crontabs/crontab
v  log - /var/adm/cron/log  (error messages about crontab is recorded here)
v  How to list - crontab -l
v  How to edit - crontab -e
v  How to remove - crontab -r
v  Allow - /var/adm/cron/log/cron.allow  (If the file exists, user id must be in the file before it can run cron jobs)
v  Deny - /var/adm/cron/log/cron.deny (If the user is not denied the user may submit the cron jobs)
v  process -  ps -eaf|grep -i cron


v  A crontab entry consists of six fields:

* * * * * Command

The minute (0 through 59)
The hour (0 through 23)
The day of the month (1 through 31)
The month of the year (1 through 12)
The day of the week (0 through 6 for Sunday through Saturday)
The command to run


Sunday, October 15, 2017

Disk is in Removed state in aix, How to fix it?

Disk is in Removed state in aix, How to fix it?


I have faced the below issue.


"lspv" output shows that the disk is in available state however

"lsvg -p datavg" output shows that the disk is in "Removed" state in the lpar.  (disk is virutal disk)


# lspv
hdisk0   0000000012345678 rootvg   active
hdisk1   10000BC987654321 datavg   active
hdisk2   10000CD999654321 datavg   active

# lsvg -p vgname

datavg:
PV_NAME           PV STATE               TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk1                   active                          646         486                 130..00..98..129..129
hdisk2                   removed                     646         486                 130..00..98..129..129  

#


Executed the below commands to fix the issue.

# varyonvg datavg   (It didn't helpful as it saying unable to sync the logical volumes)

# chpv -va hdisk1    ( This brought the disk into available state)

# syncvg -v datavg   (Confirmed that all the logical volumes and FS are in open/sync state)



Tuesday, October 3, 2017

How to restore a single file in aix?

How to restore a single file in aix?



If we want to restore a file named healthcheck.ksh from mksysb use the below.


Checking the healthcheck.ksh file existing in the mksysb image.
         
          restore -T -q -l -f /backup/uktest.mksysb | grep healthcheck.ksh


It will list out the detailed output and at the end it will display the file which we need to recover

-rwxr-xr-x- 10   staff  May 30  11:54  267 ./home/unixsa/healthcheck.ksh


Restore the particular file healthcheck.ksh using,

          restore -x -q -f /backup/uktest.mksysb ./home/unixsa/healthcheck.ksh

Please note that (.) is important before the file name


cd ./home/unixsa
ls -la healthcheck.ksh
-rwxr-xr-x- 10   staff  May 30  11:54  267 ./home/unixsa/healthcheck.ksh


======================================================================

Another method:
---------------------

#lsmksysb -lf /backup/uktest.mksysb
# restorevgfiles -f /backup/uktest.mksysb ./home/unixsa/healthcheck.ksh

New volume on uktest.mksysb
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Tue May 30 11:54:18 GMT+01:00 2017
Files are backed up by name.
The user is root.
x            267 ./home/unixsa/healthcheck.ksh
The total size is 267 bytes.
The number of restored files is 1.


# ls -la */*
-rw-r--r--    1 root     system            6 Feb 17 11:16 ./home/unixsa/healthcheck.ksh



Monday, June 12, 2017

How to perform OS migration from 6.1 to 7.1 using CD in aix?

How to perform OS migration from 6.1 to 7.1 using CD in aix?


Please find the below steps for migration installation:

 # lsvg -p rootvg  Ã  Check for mirrored Eg: hdisk0 and hdisk1

 # umirrorvg rootvg   Ã  Breaking the mirrorr

 # chpv -c hdisk1  Ã   Clearing the boot image on hdisk1

 # alt_disk_copy -d hdisk1    à Cloning of rootvg on hdisk1

 # bosboot -ad /dev/hdisk1    Ã  Creating a boot image on hdisk1

 # ipl_varyon -i    Ã  Check the disk bootable or not

 # cfgmgr   Ã  Detect the 6.1 Migration CD

 # lsdev | grep cd0

 # ipl_varyon -i   Ã  Check the cd  and the disk bootable or not

 # bootlist -m  -normal -o cd0 hdisk1 hdisk0   Ã  Changing the boot list to boot from 6.1 OS  CD */

 # shutdown -Fr    Ã  Fast Re-boot

Migration:
========

** Once the Server Boots it would show the below message,**

1 = SMS menu                          5 = Default bootlist
8 = Open Firmware                  6 = Stored bootlist

** Ignore the above message and installation proceeds to the next page,

Starting Software
Please wait

** Next Screen,
Please define the System Console
Type a 1 and press Enter to use this terminal as the system console

** Type 1 and press enter,

1. Type 1 and press Enter to have English during install
>>>choice[1]

** Again Type 1 and press enter,
Welcome to Base Operating System Installation and Maintenance
Type the number of your choice and press Enter. Choice is indicated by >>>
>>>1. Start Install now with Default Settings
   2. Change/show Installation Settings and Install
   3. Start Maintenance Mode for System Recovery
   4. Configure Network Disks (iSCSI)
   88 Help?
   99 Previous Menu
   Choice[1]: 2

**Type 2 and press enter to change the installation settings,

Installation and Settings
Either type 0 and press Enter to install with current settings
or type the number of the setting you want to change and press Enter
1. System Settings:
   Method of Installation ......................Migration
   Disk where you want to Install ..............hdisk0   
2. Primary Language Environment settings (AFTER Install):
   Cultural Conventions ........................English (United States)
   Language ....................................English (United States)
   Keyboard ....................................English (United States)
   Keyboard Type ...............................Default
3. Security Model...............................Default
4. More Options (Software install options)
>>> 0 Install with the current settings listed above
88 Help?
99 Previous Menu
>>> Choice[0]:

** Change the method of installation to "Migration"
Ensure that the "Disk where you want to Install" is set to the correct disk : hdisk0
Change the "Cultural Conventions", "Language" and "Keyboard" to your prefered location

** Type 4 and press enter for "More Options (Software install options)"

Install Options
1. Enable System Backup to install any system....Yes
2. Import User Volume Groups.....................Yes
3. Remove Java 1.1.8 Software....................No
>>> 0 Install with the current settings listed above
88 Help?
99 Previous Menu
>>> Choice[0]:

** Check the values for the fields are as listed above and then press enter to accept the default value of 0 "Install with the current settings listed above
Migration Installation Summary
Disks: hdisk0
Cultural Convention: en_GB
Language: en_US
Keyboard: en_GB
Import User Volume Groups: Yes
Enable System Backup to install any system: Yes
Remove Java 1.1.8 Software: No
>>> 1 Continue with Install
88 Help?
99 Previous Menu
>>> Choice[1]:

** Check the fields if all the values as correct then press enter to accept the default value 1 "Continue with Install"

Migration menu preparation
Please wait
Approximate                            Elapsed time
% task complete                                   (in minutes)

** Next Screen,

Migration Confirmation
Either type 0 and press Enter to continue the installation
or type the number of your choice and press Enter
1. List the saved Base System Configuration files which will not be merged into the system
   These files are saved in /tmp/bos
2. List the filesets which will be removed and not replaced
3. List directories which will have all current contents removed
4. Reboot without migrating
Acceptance of license agreements is required before using system.
You will be prompted to accept after the system reboots
>>> 0 Continue with the migration

WARNING: Selected files, directories and filesets (installable options)
from the Base System will be removed.
Choose 2 or 3 for more information
88 Help?
99 Previous Menu
>>> Choice[0]:

Have a look at each menu option then type 0 and press enter to "Continue with the migration"

Saving system configuration files in /tmp/bos
Removing obsolete filesets, directories and files
Installing Base Operating System
Please wait
Approximate                            Elapsed time
% task complete                                   (in minutes)


** The installation should continue and finish and present a login screen and check the oslevel.
# oslevel -s

**Change the bootlist. 
#bootlist -m normal hdisk0