 | Level: Intermediate Vincent Tassy (tassy@fr.ibm.com), Solution architect, IBM
15 Aug 2003 This article describes how to install and set up Linux as a guest operating system in an iSeries environment.
Logical partitioning overview
The logical partitioning functionality of the iSeries platform lets you virtualize the machine's resources (memory, disk, processors, etc.) so that you can run multiple independent instances of OS/400 (or other operating systems) concurrently on the same hardware.
We can identify two types of partitions in this environment:
- One and only one primary partition. This partition manages the other partitions. To run Linux in an iSeries environment, the primary partition must be running OS/400 V5R1 or higher. Linux is not supported as the sole operating system on the machine.
- Several secondary partitions. Secondary partitions represent all the remaining partitions on the system except the primary partition. They can run other instances of OS/400, eventually with different levels or even radically different operating systems.
Among the secondary partitions, we can distinguish guest partitions. Guest partitions enable guest operating systems (for example, Linux) to run natively on the iSeries hardware. Guest partitions are themselves divided in two categories:
- Hosted partitions for which all I/O operations are managed by an OS/400 partition
- Non-hosted partitions for which all I/O are native and managed by the guest OS
Figure 1. Logical partitions of Linux on iSeries
With the V5R1 release of OS/400 and improvements on the new processors, it is now possible to pool processor resources and allocate fractional amounts of a CPU to a logical partition -- with a minimum of 10% of a CPU and an increment of 1%. This is an interesting possibility for the primary partition -- or some secondary partitions -- as the tasks they are accomplishing may not require the use of a full CPU. Communication is also greatly enhanced in this environment as OS/400 provides 16 1-GB Virtual Ethernet channels between partitions without requiring additional hardware resources.
System requirements
The primary partition that will be running OS/400 requires at least 256 MB main memory, and the Linux guest partition requires at least 64 MB main memory (128 MB or greater is recommended).
A maximum of 31 guest partitions can be defined.
If the machine does not support the shared processor capabilities, the QPRCMLTTSK system value should be set to "0". You can verify this using the following command:
DSPSYSVAL SYSVAL(QPRCMLTTSK)
Creating the guest partition
The first step to take is creating the guest partition that will host our Linux.
- Launch the System Service Tools:
STRSST
Figure 2. System Service Tools
- Choose the 5th option to Work with system partitions.
- Choose the 3rd option to Work with partition configuration.
- Choose the 5th option to Create a new partition.
- Select Guest as the type of partition to create:
Figure 3. Select Operating Environment
- On the next screen, specify the following:
- The name of the partition.
- A numeric identifier for the partition ("0" always refers to the primary partition).
- The number of processors to allocate to the partition. To use shared processors, press F10 and pick 1=Yes to use the shared processor pool. This will enable you to enter fractional amounts of CPU.
- The size of the partition main storage (remember that 64 MB is the minimum for a Linux partition).
Figure 4. Create New Partition
- Specify a Virtual LAN port for the partition (in Figure 5, LAN 0 is activated (1))
Figure 5. Select Communication Options
- On the Work with Partition Configuration panel, press F23 to get more options and then type 13 (Change Host) next to the Linux partition.
- Enter 1 next to the partition that will host the Linux partition resources.
Figure 6. Change Host Partition
- Ensure that the host partition is configured to use the Virtual LAN. Return to the Work with Partition Configuration screen and press the F10 key (Work with Virtual LAN).
Figure 7. Work with Virtual LAN Configuration
 |
Creating a Network Server Description
The Network Server Description gives the iSeries machine a way to start and stop a guest partition and its associated Virtual LAN. It can be paralleled with the boot loaders we find on xSeries machines to launch a Linux partition.
- Launch the Network Server Description creation assistant using the
CRTNWSD command.
- Provide the following information:
- Network server description (for example,
LINUX1)
- Resource name (
*NONE means that you are not referencing physical resources)
- Network server type (
*GUEST)
- Partition (name of the partition where Linux will be installed;
SUSE in this example)
- Code Page (
437 as the default *LNGVER is not supported)
Figure 8. Create Network Server Desc
- Configure the IPL parameters for the Network Server Description:
- Port number (
*NONE)
- Synchronize date and time (
*TYPE)
- IPL Source: Define where the kernel is located:
- *NWSSTG sets the boot source on a virtual disk defined in the NWSD.
It must have a partition formatted as a primary partition of type 0x41 (PReP Boot) bootable. The optimal size should be 8 MB.
- *STMF looks for the boot source in a file located in the Integrated File System (IFS). This include a CD-ROM (used for a CD installation) mounted under the QOPT directory in the IFS.
- A or B means the Linux system boots from slot A or B. To do this, the /proc file system is used with a command as below:
dd if=/usr/src/linux/vmlinux of=/proc/iSeries/mf/A/vmlinux
- *PANEL means that the IPL source is specified in the SST Partition Configuration panel
- IPL stream file: Type in the stream file if the IPL Source is set to *STMF, and *NONE otherwise; for example, for SuSE:
/qopt/cdrom/iSeries/instsys
- IPL parameters: Loader parameters (
root=/dev/ram0 for a SuSE distribution)
Figure 9. Create Network Server Desc, continued
 |
Creating a Network Server Storage Space
Network Server Storage spaces are stream files from the IFS that appear as local hard drives in the network server environment.
- Launch the Network Server Storage Space creation assistant using the
CRTNWSSTG command.
- Provide the following information :
- Network server storage space: Give a name to the space
- Size: No more than 64 GB per storage space
- From storage space:
*NONE
- Format:
*OPEN because it allows the operating system to format the drive
- Auxiliary storage pool ID:
1
- Text description :
*BLANK
Figure 10. Create NWS Storage Space
Linking a Network Storage Space to a Network Server
In order for the Network Server to actually be able to access the Network Storage Space, they must be linked together.
- Launch the Network Server Storage Link creation assistant using the ADDNWSSTGL command.
- Provide the following information:
- Network server storage space: The name of the space
- Network server description: The name of the NWSD
- Dynamic storage link:
*YES
- Network server type:
*NWSD
- Drive sequence number:
*CALC
- Access:
*UPDATE
Figure 11. Add Server Storage Link
Installing Linux
In this section, we will launch the Linux distribution installer. Our example will show the process for a SuSE V8 distribution, but setting up any other distribution would be very similar. Once the installer is up and running, the actual installation process is as easy as a regular installation on an Intel machine; much documentation on this task is on the Internet. We will focus on the specifics of the iSeries install, including booting the installer and partitioning the storage.
Let's first change the parameters of the Network Server Description so that it boots from the CDROM containing the Linux distribution installer.
- Launch the Network Server Description modification assistant by entering the
CHGNWSD command.
- Change the IPL source to
*STMF.
- For the stream file, enter the full path to the Linux PPC kernel (most likely provided on the CDROM). For example, for a SuSE version 8 installation, that path would be
/QOPT/KERNELS/ISERIES64.
- Make sure the IPL parameters are set to
*NONE (unless you need to pass some boot options to the Linux kernel).
- Vary on (activate) your Network Server Description that will host the Linux installation. The distribution's installer will be launched.
To do this, you can use the WRKCFGSTS *NWS command and then use the options 1 and 2 to Vary on/Vary off the partition.
Figure 12. Work with Configuration Status
Once the installer is started, you need to connect to the virtual console that is displaying the install program. Do this by connecting using a telnet client to port 2301 of the machine. (We recommend that you use a good telnet client such as the free PuTTY (see Resources below for a link) since the default Windows telnet client may not handle some functions correctly.) You will see a window listing all available partitions:
Figure 13. OS/400 Guest Partition Console
- Enter the number of the partition you want to connect to and press the Enter key. (Note that you will be prompted for your Service Tools UserID and password at this point.) When the partition becomes active, you will see your favorite distribution's installer.
Figure 14. SuSE Linux installer (YaST2)
- Now follow the step-by-step instructions on the screen as the installer walks you through the installation process. You can also refer to you distribution's documentation to get information on some specific details of this procedure.
Pay attention during the partitioning of the disk. If you don't let the installer partition the disk for you, make sure to at least create the following partitions:
- A primary and bootable partition of at least 8 MB as the first partition of the disk. This partition will have the type 0x41 (PPC PReP Boot). That will be the place from which the Linux kernel will be loaded on reboot.
- A SWAP partition (type 0x82). The size of this partition should generally be twice the size of memory that has been allocated to the partition.
- A root (/) partition to hold the operating system.
Figure 15. SuSE Linux installer (YaST2), continued
When you have answered all the installer's questions, it will start dumping software packages onto the freshly formatted partitions:
Figure 16. SuSE Linux installer (YaST2), continued
- Once the installation is complete, you should Vary Off the Linux partition and reconfigure the Network Server Description so that the partition will start from the disk and not the install CDROM on next boot:
- Launch the Network Server Description modification assistant by entering the
CHGNWSD command.
- Change the IPL source to
*NWSSTG.
- For the stream file, enter
*NONE.
- Set the IPL parameters to
root=/dev/hda3 provided your / partition was the third partition you created on the Linux disk.
Congratulations! You now have a Linux operating system ready to run in an iSeries Guest partition.
Resources
About the author  | 
|  | Vincent Tassy joined IBM La Gaude, France, in October 2000. He works as a technical consultant for Independent Software Vendors and Web Integrators, providing education, technical support, and expertise on J2EE technologies and the IBM WebSphere family, as well as high availability and performance topics. Though he has been working with Java for several years now, he still enjoys developing in C/C++ and contributes to a few open source projects. He has worked with Linux since 1997 and has been certified as a Linux Certified Professional and Certified RedHat Administrator. He is also certified on Versions 4 and 5 of WebSphere Application Server and associated development tools. You can contact Vincent at tassy@fr.ibm.com. |
Rate this page
|  |