Newsletters Subscriptions Media Kit About Us Contact Search Home

Stuff
OS/400 Edition
Volume 2, Number 11 -- May 22, 2003

The iSeries: A Flexible and Integrated Environment for Linux


by Erwin Earley

The iSeries provides a flexible and integrated platform for exploring and implementing e-business and infrastructure solutions based on the Linux operating system. It has the capability to virtualize all system resources such that Linux can be implemented with as little as 10 percent of a Power-PC processor, 128 MB of RAM, and disk space carved out of the single-level store of the iSeries system. Come explore the possibilities that this flexible environment provides for embracing open-source solutions.

Getting Linux installed, configured, and running on an iSeries can be broken down into three components: set up of iSeries support, Linux installation, and post-installation exploration. The following paragraphs will define each of these areas with the intent of getting you up and rolling on Linux on the iSeries platform.

Setting Up iSeries Support

Support for Linux on the iSeries platform requires setting up several components, including logical partitioning (LPAR) and a Network Server Descriptor. Additionally, disk drives are provided to Linux through allocation of a native SCSI adapter and its associated disk drives or through allocation of storage from the single-level store of the iSeries system. The following paragraphs provide information on setting up LPAR and a Network Server Descriptor and on defining virtual disk drives for Linux.

Setting Up Logical Partitioning

Defining logical partitioning is the first step on the road to exploring Linux on iSeries. Linux on iSeries makes use of LPAR technology to enable Linux to run alongside other Linux instances, as well as the OS/400 operating system. Depending on system resources, it is possible to implement a maximum of 31 Linux partitions, in addition to the primary OS/400 partition. A number of OS/400 and iSeries system components come together to define a Linux instance on the platform.

Logical partitioning is used to define the hardware resources that will be used by Linux. Both virtual and native resources are allocated to Linux through LPAR. The LPAR definition provides for allocation of processor, memory, and network connectivity. Additionally, hardware resources, such as disk controllers and network interface cards, can be allocated to Linux through the LPAR definition.

Definition of the logical partition requires use of Service Tools. In addition to defining the resources that will be used by Linux, the LPAR definition supports the definition of minimum and maximum resources for processor and memory. This is important, as the initial definition of the LPAR will require an IPL of the iSeries system before it becomes effective. After the IPL, the LPAR definition can be changed within the minimum and maximum settings without a subsequent IPL of the system.

Be careful when defining the minimum and maximum range for memory for the partition. A memory paging table will be built based on the maximum amount of memory that could be allocated to a partition, and this paging table will consume a portion of the actual memory that is allocated to the partition. It is possible to set the maximum range so large and the actual memory allocated so small that you would not have enough memory to actually run Linux. You should set the range to reflect realistic usage possibilities for the partition. Remember to think in terms of the workloads that you will be running on the partition when determining the range.

Definition of the LPAR can be accomplished either through classic 5250 terminal emulation ("green screen") or through a setup wizard provided with iSeries Navigator. There are several advantages in using the wizard. First, it walks the user through all steps required to setup the partition. Second, it allows for movement of processor and memory resources between partitions, meaning that a partition can be setup without first freeing up resources. When setting up partitions with 5250 emulation, the user must first free resources (that is, take resources away from an existing partition) before the new partition can be established.

Let's walk through a typical LPAR definition for Linux. In this example, we will use iSeries Navigator to define a new partition. The new Logical Partition wizard is started from the Configure Logical Partitions screen of iSeries Navigator and, as mentioned earlier, requires a Service Tools user ID and password. When started, an initial welcome screen is displayed (Figure 1).

Figure 1

Figure 1: The New Logical Partition wizard creates a logical partition

Clicking the Next button will prompt for the partition type that is to be created (Figure 2). For our purposes, we want to create a guest partition, so we would select the third radio button and then the Next button.

Figure 2

Figure 2: Choose the type of logical partition you would like to create

The system will automatically generate the next available partition ID number. The partition name is a user-supplied name and should be one that reflects the usage of the partition, or another name that is meaningful within the overall implementation (Figure 3). Once the name has been specified, click the Next button.

Figure 3

Figure 3: Give your new partition a name

This is where it starts to get interesting. The Memory screen is used to allocate memory to the new partition (Figure 4). With the wizard, this is accomplished by moving memory from Unassigned Hardware (memory not currently allocated to any partition) or from an existing partition. The Set Minimum/Maximum button allows you to define the range of memory that could be allocated to the partition. Remember that as long as allocation of memory stays within the defined range, future IPLs of the system will not be required.

Once you have entered the amount of memory to move, click the Move button and the memory will be reflected in the new partition. Then click the Next button.

Figure 4

Figure 4: Define memory to be allocated to your new partition

When the Set Minimum/Maximum button is selected, the dialog box shown in Figure 5 is displayed, for specifying the minimum and maximum memory that could be allocated to the partition. As indicated earlier, realistic values should be used that reflect the intended use of the partition. It doesn't make a lot of sense to set the maximum of amount of memory for the partition to 4 GB if it is only going to be acting as a DNS server.

Figure 5

Figure 5: Set minimum and maximum memory for the partition

Now we need to specify the type of processor we want to allocate to the partition (Figure 6). Don't let this confuse you. There is only one type of processor (sSTAR, iSTAR, power4, for example) in the system. This refers to whether we want Linux to have sole use of a processor or whether we are willing to have Linux share the processor with other partitions. Typically, Shared processors is selected (which is not supported on the iSTAR processor).

Figure 6

Figure 6: Define the type of processors you want to use in your partition

The Shared Processor window has the same basic functionality as the Memory window, in that we are going to use it to move processor resources either from unassigned hardware (if available) or from an existing partition into our new partition (Figure 7). (By the way, you can move processor resources from more than one partition into your new partition; this is true of memory as well.) Once the processor resources have been moved, click the Next button.

Figure 7

Figure 7: Move processor resources to the new partition

The Virtual Ethernet window is used to indicate which, if any, of the 16 internal Ethernets you want the partition to have access to (Figure 8). I need to digress for a moment and talk about virtual Ethernet. Virtual Ethernet provides the capability to define LANs that are completely internal to the iSeries system and provide communication among logical partitions (both OS/400 and Linux). These LANs provide 1GB communication paths. While virtual Ethernet provides for communication among partitions, there are a variety of methods for getting external communications to partitions, including Proxy ARP (Address Resolution Protocol) and NAT (Network Address Translation); however, setting up networking for the partition is well outside the scope of this article.

Figure 8

Figure 8: Select the virtual Ethernet connections the partition will use

For purposes of this partition setup, I would recommend that you place both the primary partition and your new Linux partition on the same virtual Ethernet, then refer to IBM Redbook Linux on the IBM eServer iSeries Server: An Implementation Guide for instructions on how to setup NAT.

Once the virtual Ethernet has been selected, you need to specify which OS/400 partition is the host partition (Figure 9). The host, or primary, partition will have ownership of the resources (memory, processor) that will be used by the Linux partition.

Figure 9

Figure 9: Choose which partition should act as the host

That's it! The final screen summarizes the setup of the partition (Figure 10). Note that up until this point nothing on the system has changed. Review the partition settings, and if they are correct click the Finish button.

Figure 10

Figure 10: The partition has been successfully configured

You're done with the first step in setting up Linux on iSeries. Remember that the logical partition will not be available until the iSeries system is IPL'd. In actual practice, if your environment will need to support multiple partitions, you should create all of the partitions before the IPL of the system.

Setting Up the Network Server Descriptor

Once LPAR has been defined, the next step is to define a Network Server Descriptor (NWSD). The NWSD is used to define the environment that Linux will run in. While LPAR defines the resources for Linux, the NWSD defines the boot parameters, kernel location, as well as other characteristics used to start the Linux instance. When performing the initial Linux installation, the NWSD will be set up to point to the installation kernel of the distribution. This kernel can reside on a physical CD, in a stream file in the Integrated File System, or on a virtual CD (on a V5R2 system).

Unlike the LPAR setup, the definition of the Network Server Descriptor must be accomplished through a 5250 terminal session. The Create Network Server Descriptor (CRTNWSD) command is used to define the Network Server Descriptor. The following screens summarize the setup of a Network Server Descriptor.

On the first Create Network Server Desc screen, you specify the name of the Network Server Descriptor (Figure 11). This is the name that will be displayed on the virtual console. Other fields of interest on the first page include Resource name, which should always be *NONE for Linux, and Partition, which indicates the logical partition that the Network Server Description is associated with. Once the fields on the first page are completed, press the Page Down key to display the second screen.

Figure 11

Figure 11: Specify the name that will be displayed on the virtual console

The second screen of the Network Server Descriptor includes network definition information (Figure 12). As you will see later, this information is written to a Linux configuration file for possible use within Linux. As a general rule, the default values are taken for the fields on this screen.

Figure 12

Figure 12: Provide network definition information

Pressing Page Down again will display the third and last page of the Network Server Descriptor definition (Figure 13).

Figure 13

Figure 13: Complete the network definition information

The value of the IPL Source field indicates from where the system should boot. The following table summarizes the possible values for this field:


*NWSSTG Indicates that the kernel that Linux will boot from is located in the prepboot partition of the Linux disk. Note: Storing the kernel with the Linux disk provides for a flexible backup and restore capability that allows the disk representing Linux to be saved as an OS/400 object and restored on a different system.
*STMF Indicates that the kernel is located in the Integrated File System of OS/400. When this value is used, the IPL Stream file value needs to indicate the fully qualified path of the kernel in the IFS.
A Indicates that the kernel is located in the first "slot" of the Network Server Descriptor. Use of slots allows for multiple kernels to be stored with the Network Server Descriptor.
B Indicates that the kernel is located in the second "slot" of the Network Server Descriptor.

The IPL parameters field is used to indicate what, if any, values are to be sent to the kernel when Linux is started. Typically, this field is used to indicate the location of the root file system in Linux.

Allocation of Virtual Storage

The iSeries provides the ability to use IFS storage to emulate disk drives. Known as Network Storage (NWSSTG), these virtual drives appear as real disk drives to the Linux operating system; however, as an IFS object, they take advantage of the performance and the reliability of single-level store on the iSeries. The size of network storage areas can be from 1 megabyte to 64 gigabytes, with a maximum of 20 virtual storage areas per Linux partition. Depending on the version of OS/400 you are running, it is possible to share virtual disks between Linux partitions (for read-only access) and to have a virtual disk associated with multiple Linux partitions for update (although only one partition can have the disk accessed for update at any given time). Additionally, it is possible to associate (or link) a disk with a Linux partition while Linux is running and have Linux use the additional disk space. This provides a "hot-swap"-like capability for Linux disk storage.

When setting up network storage spaces for a new Linux partition, it is necessary to create the storage space and then link the storage space to the associated Network Server Descriptor.

The Add Network Storage Space (ADDNWSSTG) command is used to create the new storage space. When completed, the command would resemble that in Figure 14.

Figure 14

Figure 14: Create new storage space

Once the virtual disk has been created, it needs to be linked to the Network Server Descriptor. This is accomplished with the Add Network Storage Link (ADDNWSSTGL) command. When completed, the command would resemble that in Figure 15.

Figure 15

Figure 15: Link the virtual disk to the Network Server Descriptor

Installing Linux on iSeries

Installing Linux on iSeries is no different from installing Linux on any other platform. Like other platforms, you will need to have access to a Linux console to perform the installation. Typically, a console consists of a keyboard, a monitor, and a mouse connected to the physical platform where Linux is being installed. To emulate this capability, the iSeries supports the capability to connect (via standard TCP/IP protocol) to a port that has been customized to provide access to a virtual console.

Access to the virtual console requires that a Dedicated Service Tools (DST) user ID be available that has access to the enabled virtual console. There is a virtual console for each guest partition on the iSeries system. To access the virtual console, use a Telnet client (such as Telnet in Windows, PuTTY, or Telnet in Linux) and provide the IP address of the iSeries system, as well as the virtual console port (2301), as in the following example:

telnet 1.1.1.241 2301

At this point, a menu will be provided with entries for each of the guest partitions defined on the system:

OS/400 Guest Partition Console
 1:  REDHAT
 2:  SUSE
 3:  TURBOLINUX
 4:  DEMO
 5:  SAMPLE
Enter the console partition number

Type the number of the guest (Linux) partition that you would like to access and press the Enter key. Once selected, a prompt will be displayed requesting a valid OS/400 service tools user ID. (This is the DST user ID mentioned earlier.)

REDHAT: Enter OS/400 service tools userid

Enter the DST user ID and press the Enter key. At this point, a prompt will be displayed for the password of the supplied DST user ID.

REDHAT: Enter OS/400 service tools password:

Enter the password and press the Enter key. If a valid DST user ID and password has been provided, a message will be displayed indicating that the console has been successful connected:

REDHAT: Console connecting. . .

A couple of tips to make note of regarding the virtual console. First, if you connect the virtual console to a partition that is already varied on (running) and want to see messages that have been displayed to the console before your connection, you can press Control-X twice. That key sequence will dump the contents of the virtual console spool (or cache). Second, more than one Telnet session can be started for the same virtual console. Each session connected to the virtual console will see the same output (and input, for that matter) and at times can be a great teaching aid when trying to show a remote administrator how to do something with Linux. And, finally, unlike other Telnet sessions into Linux, the virtual console session is a static connection, in that it doesn't log out (or terminate) when the Telnet session is cancelled. So the next time you connect to the console, you will be exactly where you left off.

Once the virtual console has been started, the Network Server Descriptor needs to be varied on. The Work with Configuration Status (WRKCFGSTS) command is used to work with the status of the Network Server Descriptors. Entering the command WRKCFGSTS *NWS will display a status screen similar to that in Figure 16.

Figure 16

Figure 16: WRKCFGSTS is used to work with the status of the Network Server Descriptors

At this point you can tab to the opt field of the appropriate network server descriptor and enter a 1 to vary the descriptor on. Assuming that the LPAR and NWSD definitions are correctly setup and that the installation media is available to the system, the installation will start and the installation screens will be displayed on the virtual console.

As mentioned earlier, Linux installation on iSeries is no different from Linux installations on other platforms. For more information on specific installation steps, refer to the installation documentation for the various distributions, as well as the Linux on the IBM eServer iSeries Server: An Implementation Guide.

Exploring Linux on iSeries

Once you have Linux installed in the partition, you are ready to start your exploration. As with the installation, you can access the Linux console through port 2301. This access will be available even if networking has not been configured for the Linux partition.

There are several interesting aspects of running Linux on the iSeries platform that we should take a look at. After logging into the Linux partition, enter the following command:

cat /proc/cpuinfo

This command will generate output that reflects the processor that Linux is currently executing on. The output will look similar to that in Figure 17.

Figure 17

Figure 17: Linux processor information is provided

What is interesting to note is that certain processors/models of iSeries Linux will actually see two processors for every processor that has been allocated to Linux. This is due to the processor multithreading feature of that system.

Here's another command to try:

cat /proc/iSeries/config

The command will output configuration information from the Network Server Descriptor (Figure 18).

Figure 18

Figure 18: iSeries configuration information available in Linux

As you can see, some of the information included is the optional network definition information from the NWSD. This information is made available so that users could develop shell scripts that would use the information contained in the configuration file to setup or modify the network settings of Linux.

The iSeries: A Flexible Environment for Linux

The iSeries platform provides an extremely flexible environment to run the Linux operating system. The ability to virtualize resources and dynamically move resources among partitions allows users to manage workloads, rather than disparate systems. As with all open-source initiatives, Linux is constantly evolving and changing to meet users' needs. The Linux community would be interested to hear your experiences with Linux on the iSeries platform. There are a number of mailing lists that can be explored at http://lists.linuxppc.org for sharing your experiences.


Erwin Earley is a software engineer at IBM and has worked at the Rochester, Minnesota, development lab since 1996. At the iSeries Technology Center, Erwin provides education and enablement services for Linux on iSeries. Erwin has worked in the IT industry for 24 years and has experience with several Unix variants, as well as Linux and OS/400. Erwin also provides Linux education classes at a local university. E-mail: earleye@us.ibm.com


Sponsored By
RJS SOFTWARE SYSTEMS

Implement Document Imaging on your iSeries-AS/400 in 30 minutes or less

Image Server/400 is a Web browser-based document image management system for the iSeries.

Documents can be quickly scanned and stored in IFS folders, and then located and retrieved for viewing via any Web browser. Integrate with other iSeries-AS/400 applications.

Call us at 888-RJS-SOFT or download a FREE fully functional demo from our Web site at www.rjssoftware.com


THIS ISSUE
SPONSORED BY:

Profound Logic Software
Damon Technologies
RJS Software Systems
ASNA


BACK ISSUES

TABLE OF
CONTENTS
A Few More Pointers on Pointers

ADO/JDBC Performance Using Parameters

The iSeries: A Flexible and Integrated Environment for Linux

Back to Basics: Self-Extending Subfiles


Editors
Shannon O'Donnell
Kevin Vandever

Managing Editor
Shannon Pastore

Contributing Editors:
Howard Arner
Raymond Everhart
Joe Hertvik
Ted Holt
David Morris

Publisher and
Advertising Director:

Jenny Thomas

Advertising Sales Representative
Kim Reed

Contact the Editors
Do you have a gripe, inside dope or an opinion?
Email the editors:
editors@itjungle.com


Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.