IBM Support

Am I a WPAR? (workload partition) or a regular AIX VM (virtual machine)?

How To


Summary

It can be tricky to work out but there is a simple answer.

Objective

Nigels Banner

Steps

Asked at the Technical University: 
  • How can we tell (in a shell script) that we are running in a WPAR context or on a regular AIX environment?
When AIX is hosting workload partitions it is also called a Global AIX. It took me a good few minutes to find out how to do it and thought I would share it to save you time: Use:
uname -W
0
The "uname -W" command returns:
  • Zero for the Global AIX or a regular AIX
  • The WPAR Number when in a WPAR (that is a non-zero value)
In the following diagram, we show how to use the command in a script.
wparno=`uname -W`
if (( $wparno == "0" ))
then
        echo Global AIX
else
        echo WPAR number $wparno
fi
Easy, once you know how.

Additional Information


Other places to find Nigel Griffiths IBM (retired)

Document Location

Worldwide

[{"Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"","label":""}],"Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions"}]

Document Information

Modified date:
12 June 2023

UID

ibm11165414