An introduction to HP-UX
For a couple of months now, I work daily on HP’s homegrown Unix : HP-UX. Since I had no idea what this OS was about when I was a student, I think some people can be interested in discovering it with this short introduction.
HP-UX is one of the few remainig commercial Unices out there. Today, only 3 play a significant role on the enterprise OS market : IBM AIX, running on Power processors, SUN Solaris, running on SPARC and x86 processors and HP-UX, running today on Intel Itanium-based servers. The latter used to run on HP’s own processors PA-RISC (for Precision Architecture) but after HP consolidated its portfolio on the only Itanium processors, it can only be purchased on IA64 processors.
HP-UX’s last version is HP-UX 11i v3, and this version has been enhanced and extended by three following updates.
File Hierarchy Standard (FHS)
HP-UX is a System V Unix. Let’s take a look at the root directory structure:
- /dev
This directory contains all device files, representing all devices attached to the system. Raw devices can be found under /dev/rdisk, block devices are in /dev/dsk and logical volumes are also placed in /dev
- /etc
As usual on Unix systems, all configuration files are stored in this directory.
All files controlling system startup and shutdown and daemons are located in /etc/rc.config.d. For instance, to configure your network interfaces for each boot and setup routes, you will edit the file /etc/rc.config.d/netconf and insert
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=xx.xx.xx.xx
SUBNET_MASK[0]=xx.xx.xx.xx
BROADCAST_ADDRESS[0]=”"
INTERFACE_STATE[0]=”"
DHCP_ENABLE[0]=0
INTERFACE_MODULES[0]=”"
- /home
The usual home directory
- /sbin
The files located here are needed at boot time. The rc script that controls the the system startup is located in this directory as well as all runlevel dependent links to scripts respectively in /sbin/rc0.d/ , /sbin/rc1.d/ , etc. All available startup scripts are located in /sbin/init.d/
- /stand
The HP-UX kernel is kept in this directory. The kernel file is /stand/vmunix and the configuration file is /stand/system.
- /net
Reserved for remote file system mount points
- /opt
This directory is used to install applications on HP-UX. Each application has its own directory hierarchy. For the Apache Webserver, this will look like the following : /opt/hpws/ (for HP web services, the root directory, where Apache, Tomcat, and others are located) : /opt/hpws/apache/bin for executable binaries, /opt/hpws/apache/etc for the config files, and so on…
- /tmp
The temporary directory where anybody can create or delete files. Unlike Solaris, this directory is not flushed after reboot.
- /usr
Most HP-UX files are located here, especially user-relates commands, libraries, doc & manual pages and contributed software.
/usr/bin : user commands, applications and utilities.
/usr/include : include and header files for programming
/usr/lib : libraries for programming
/usr/sbin : many administration commands are located here
/usr/share/man : man pages
- /var
/var contains log files distributed across different directories:
/var/adm : system administration related programs (for instance /var/adm/sw for software installation/removal, /var/cron for cron log files, etc.)
/var/opt : application-related logs
/var/spool : print services related files
Virtualization
On the virtualization side, there are one feature shipped with any HP-UX instance : the Secure Resource Partitions (SRP) which are somehow similar to the Solaris zones.
You can assign particular resources to these partitions such as CPU shares, entire CPU’s (psets), memory as well as disk bandwith. Moreover, the security features of the SRP allow you to assign disk and network access to a particular partition. On the top of that, the SRP will make sur that your files (sockets, links, whatever…) cannot be accessed from outside the partition, unless a rule has been expressly defined in the config file. The SRP’s also use the capabilities of the role-based access control (RBAC) that allow a user to gain privileges to execute a single operation (e.g. a user can get privileges to mount a disk without having to be root). This allows the admin to define precise roles and increases the accountability of each user.
Beside the Base Operating Environment (BOE), which is shipped with any HP-UX, the user can also choose between the High Availibility OE and the Virtual Server Environment OE (or the Datacenter OE that contains everything).
With the VSE-OE, you have the choice between different virtualization types :
- nPars
nPars (for Node Partitions) are only available on mid-range and high-end cell-based servers. These cells consist of a kind of a plate on which CPUs and memory reside. Npars are just grouped cells that act as a single server.
- vPars
vPars (for Virtual Partitions) are more fine-grained: you can assign here resources on a per CPU basis. They run on HP-UX 11i v1, v2 and v3 only.
- Integrity Virtual Machines
The Integrity Virtual Machines are some kind of VMware-like virtual machines. They run on the top of a HP-UX guest that emulates the hardware and can paravirtualize the I/O drivers to accelerate the I/O throughput. Sysadmins create then virtual switches that can be internal or related to a physical interface to let the IVM communicate with the outside world. For network intensive workloads, you can assign an interface to a dedicated VM over a virtual switch to enhance performance. The last feature brought by the third update of HP-UX 11i v3 is the capability for IVM to migrate from one physical host to another (just like VMotion or Citrix XenMotion do).
Software and patch management
HP-UX’s software and patch management is based on Software Depot (SD-UX). Software packages are divided in different structures:
- Filesets: a collection of files
- Subproducts: group of filesets
- Products: examples are X11, Oracle, etc.
- Bundles: group of products
- Software depot: repository where software packages are made available for download and install on clients
Software depot can be used with an X or text-only interface, or for some tasks with the command line.
You can list the currently installed software on your system by entering the “swlist” command.
To install a new package, find out first on which server server has software depots. Then enter
# swlist -l depot @ hostname
to list all available depots on this server. Since you want to install a single package, enter
# swlist -d @ hostname:/path/to/the/depot
in order to list all applications and their description.
# swinstall -s hostname:/path/to/the/depot packagename
will then install the required software, resolving automatically the software dependencies.
Patches are managed in the same way and are also installed with the swinstall command.
Applications
HP-UX and the Integrity servers are designed for mission critical applications. Running an Apache server is possible, but it is not the kind of applications you will expect to see on such machines. Databases and Java application servers are rather the sweet spots of this OS.
A lot of commercial applications are available (to name a few : Oracle, Websphere, Weblogic,…) but MySQL, Tomcat, Apache and other Free Software are also ported and maintained on HP-UX.
The default shell is the Bourne shell, set in vi mode. Coming from a Linux/Bash world, it took me a little adaptation time.
Network
The network is managed with the tools lanscan (which will give information about the interfaces) and ifconfig (that will help configuring them). As we have seen it, the interfaces can be configured automatically at boot time in the file /etc/rc.config.d/netconf.
The domain names are resolved with the following files: /etc/hosts, /etc/nsswitch.conf
Managing disks / SAN / Filesystems
The disks files are placed in the /dev/disks/ directory, the raw devices in /dev/rdisks/ . Note that you will only have one file to manage for a presented SAN LUN. The multipathing and failover are handled at the kernel level.
The most commonly used file system is onlineJFS, which is in fact a rebranded Veritas VxFS, and offers such features as online shrinking and extending of the filesystem and online refragmenting, which are much more reliable than, for instance, for ext3.
Resources : http://www.amazon.com/HP-Certified-HP-UX-System-Administration/dp/0130183741
Technology and leadership in an international environment