Professional Documents
Culture Documents
System z
Workshop
Part 1
Presented by
IBM
1
Virtualization and Linux on System z Workshop
User Agreement
This agreement ("Agreement") governs your use of the remotely accessed IBM system and the course
materials. By using the system or accessing the system (“Materials”) you agree to the terms of this
Agreement.
Under this Agreement, you may use the Materials only for the class attended and other use authorized
by IBM. Any other use (including distribution, reproduction, resale, publication or transmission) is not
permitted.
The Materials are provided on an "AS IS" basis. In addition, IBM makes no warranties or conditions,
either express or implied, including without limitation, warranties of title, non-infringement and the
implied warranties of merchantability and fitness for a particular purpose, concerning the Materials, or
any information accessed using the Materials.
The z/OS operating system and associated middleware Program(s) that were packaged with, or
preloaded onto, the IBM computer system are the property of the IBM Corporation. You receive no
express or implied patent or other license from IBM. IBM will not be liable for any damages resulting
from use of the Materials, including without limitation, lost profits, lost savings, or any incidental,
special or indirect damages or other economic consequential damages, even if IBM has been advised of
the possibility of such damages. Some jurisdictions do not allow the exclusion or limitation of
incidental or consequential damages, so the above limitation or exclusion may not apply to you.
This agreement does not grant you a license, either expressed or implied, to any IBM intellectual
property, including patents copyrights or trademarks. Unless IBM specifies otherwise, you may not
copy, modify, adapt, reproduce, translate, distribute, reverse engineer, decompile or disassemble any
aspect of the Materials. Neither IBM nor its Suppliers are responsible for: 1) the accuracy,
completeness, timeliness, reliability, content or availability of the Materials or any information
retrieved; 2) loss or damage to your records or data; or 3) your use of or results achieved from the
Materials or any information retrieved.
This Agreement is the complete and exclusive agreement regarding the Materials. IBM may, at any
time, 1) revoke your access to the Materials, or 2) modify, change or withdraw the Materials, in whole
or in part.
This Agreement is governed by the laws of the State of New York.
Notices
This information was developed for products and Materials offered in the U.S.A.
IBM may not offer the products, Materials, or features discussed in this document in other countries. Consult your local
IBM representative for information on the products and Materials currently available in your area. Any reference to an IBM
product, program, or Materials is not intended to state or imply that only that IBM product, program, or Materials may be
used. Any functionally equivalent product, program, or Materials that does not infringe any IBM intellectual property right
may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product,
program, or Materials.
IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of
this document does not give you any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A.
2
Virtualization and Linux on System z Workshop
The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent
with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES
THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express
or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made to the
information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements
and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve
as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product
and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any
obligation to you.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of
performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM
products should be addressed to the suppliers of those products.
This information contains examples of data and reports used in daily business operations. To illustrate them as completely
as possible, the examples include the names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrates programming techniques on
various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to
IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application
programming interface for the operating platform for which the sample programs are written. These examples have not been
thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, Materials ability, or function of
these programs. You may copy, modify, and distribute these sample programs in any form without payment to IBM for the
purposes of developing, using, marketing, or distributing application programs conforming to IBM's application
programming interfaces.
3
Virtualization and Linux on System z Workshop
Table of Contents
Our Workshop Environment...................................................................................................................... 7
Hardware............................................................................................................................................... 7
Workshop partition................................................................................................................................7
Team virtual machine............................................................................................................................8
Manuals................................................................................................................................................. 8
Unit 1: System z Virtualization.................................................................................................................9
1.1 IPL z/VM.........................................................................................................................................9
Unit 2: The Control Program (CP) ..........................................................................................................13
2.1 Introduction................................................................................................................................... 13
2.2 Logon to MAINT ........................................................................................................................ 15
2.3 HELP............................................................................................................................................. 16
2.4 QUERY......................................................................................................................................... 16
2.5 VARY ...........................................................................................................................................19
2.6 ATTACH ......................................................................................................................................20
2.7 INDICATE ................................................................................................................................... 20
2.8 CPFMTXA ................................................................................................................................... 21
Unit 3: The Conversational Monitor System (CMS)............................................................................... 25
3.1 Introduction................................................................................................................................... 25
3.2 HELP............................................................................................................................................. 26
3.3 QUERY ........................................................................................................................................ 27
3.4 ACCESS .......................................................................................................................................27
3.5 COPYFILE....................................................................................................................................28
3.6 CP.................................................................................................................................................. 28
3.7 FILELIST...................................................................................................................................... 29
3.8 XEDIT........................................................................................................................................... 31
Unit 4: System Configuration ................................................................................................................. 33
4.1 Overview of the SYSTEM CONFIG file...................................................................................... 33
4.2 System parameter disks................................................................................................................. 33
4.3 Update the SYSTEM CONFIG file...............................................................................................33
4.4 CPSYNTAX .................................................................................................................................36
4.5 Restart z/VM and verify changes ................................................................................................ 37
Unit 5: Create Virtual Server................................................................................................................... 39
5.1 Overview of the User Directory.................................................................................................... 39
4
Virtualization and Linux on System z Workshop
5
Virtualization and Linux on System z Workshop
6
Virtualization and Linux on System z Workshop
LPAR n
Workshop partition
L T
M T T T
I E
A C E E
N A
I P A A
N M
N I M M
F 1
T P 1 2
S 5
Processors: 6 (shared)
LPAR VM52
7
Virtualization and Linux on System z Workshop
300 301
20xx
SCSI
190
IPL 190 = boot CMS
CMS
(Logon default)
Memory: 768 MB
Team1
Manuals
The z/VM manuals are available online. You may access them through your browser on your laptop.
Access them through the following URL(s) and select the zVM BookShelf:
http://129.40.35.3/vmmanuals
If you need the manuals when you return home, they are available for download in PDF format from
the following URL: http://www.vm.ibm.com/library.
8
Virtualization and Linux on System z Workshop
4. Logon messages appear in your VM console. You should see a console status at the bottom
right corner of VM READ which indicates the console is waiting for a command.
Press the Enter key
You should see the console status change to RUNNING. Your team ID is defined to IPL the
conversational monitoring system (CMS). IPL stands for “initial program load”. IPL’ing is the same as
booting. When you hit the enter key just now, the system executes a profile and completes the IPL
process. You will learn more about profiles later on.
9
Virtualization and Linux on System z Workshop
7. Notice the terminal’s console mode (conmode) is set to 3215. This is CMS’s default terminal console
mode. In order to boot z/VM, you need to change the conmode value to 3270.
The output shows that the console address is 0009. We now have enough information to boot our z/VM:
the volume address to boot (IPL) is 200 and the console address (specified via the LOADPARM option)
10
Virtualization and Linux on System z Workshop
11
Virtualization and Linux on System z Workshop
Enter “go”
13. You have successfully IPL'ed z/VM when you receive the following messages:
12
Virtualization and Linux on System z Workshop
2.1.2 Storage
Mainframe storage is analogous to memory in a personal computer. CP commands refer to memory as storage,
so do not confuse the term “storage” with disk or tape storage.
Each virtual machine has its own virtual storage. CP manages the residency of virtual machine’s pages in real
storage through paging. Pages that have not been referenced can be moved out of real storage into either
expanded storage or onto a paging device. When a virtual machine requires a page no longer in real storage, a
page fault occurs and CP brings the missing page back into real storage.
CP has facilities that allow portions of real storage to be shared by many virtual machines. Such portions are
called shared segments. This sharing economizes on real storage and requires less paging, thereby improving
performance. For example, the CMS nucleus is shared in real storage by all virtual machines that loaded CMS
by name; that is, every CMS virtual machine maps a 1 MB segment of virtual storage to the same 1 MB of real
storage.
13
Virtualization and Linux on System z Workshop
14
Virtualization and Linux on System z Workshop
15
Virtualization and Linux on System z Workshop
2.3 HELP
You use CP commands to communicate with the control program. CP commands control the devices attached to
a virtual machine and their characteristics.
1. To see a list of the CP commands:
===> help
Place cursor on “CP”
Press the ENTER key
What you see here is a subset of the CP commands available in z/VM.
2. To display help text for the DISCONNECT command:
Place cursor on “DISConn”
Press the ENTER key
The bottom of the screen lists the PF Keys for additional options that are available for the
selected command.
3. When you are done browsing, exit the help utility.
Press the F3 key (Quit) repeatedly until you return to “RUNNING” state
You may have to do this repeatedly depending on how deep you have gone into the HELP
function.
4. Another way to go directly to the menu of CP commands is with the following help command:
===> help cp menu
5. Exit the help menu and return to the READY prompt:
Press the F3 key repeatedly until you return to “RUNNING” state
2.4 QUERY
Let’s learn a little about your virtual machine environment with the QUERY command.
1. To display a list of commands your virtual machine (MAINT, in this case) is authorized to
issue:
16
Virtualization and Linux on System z Workshop
2. Display a list of all real processors, and indicate the way in which each processor is being used.
===> query processors
The output indicates that your z/VM has 2 real processors. Processor address 00 is the master
processor and processor address 01 is non-dedicated.
3. Display the size of real storage.
===> query storage
The output indicates that your z/VM system has 512 MB of real storage.
4. Display the size of storage accessible to your virtual machine (MAINT)
===> query virtual storage (q v stor)
17
Virtualization and Linux on System z Workshop
A list of devices known to this virtual machine is displayed. Check the table below for
descriptions of each device and what are are used for.
200 Boot volume or “res” pack, sometimes called the SYSRES, or system’s residence volume.
The volume that you just “IPL” (IPL 200 CLEAR).
201, 202, and 203 Other CP owned volumes. For now consider CP owned volumes as system volumes,
containing things like page space (swap for those of you who prefer distributed
terminology), spool space, temporary file space, etc... You will learn more about this later.
190, 19E CMS disks used to support your team ID on the first level z/VM, PBCVM51.
The output returns all free OSA devices. A free OSA device is one that is not currently in use
by a user or the system.
7. Display the number of cylinders or pages that are allocated, in use, and available for DASD
volumes attached to the system which are owned by 'CP' . These are typically system related
DASDs.
===> q alloc
18
Virtualization and Linux on System z Workshop
In a later exercise, you will learn how to format a DASD volume. Basically, a volume must be
allocated and used in the following ways:
TDISK tdisk is short for temporary disk. z/VM gives you the ability to define temporary work or utility
disks.
PAGE Page space on the mainframe is similar to swapping in the distributed environment. Windows has
swap files. Linux has swap devices or swap files. z/VM has page space.
SPOOL Spool space is where print, reader, and punch files are held.
DRCT Directory space is the space that holds information about your users such as their passwords and
virtual machine definitions.
2.5 VARY
With a mainframe you have the ability to turn devices on and make them available for use, or you can turn them
off, and remove them from the available pool of resources. This is called varying devices online and varying
devices off-line.
In a previous exercise, you used the 'Q DASD ALL' command to display the status of real DASDs. Since
devices 190 and 19E are not needed by your second level virtual machine, let's vary them offline.
===> vary off 190 19E
Display the status of these devices to verify that they are offline
19
Virtualization and Linux on System z Workshop
2.6 ATTACH
In a previous exercise, you used the 'Q OSA FREE' command to display all the available Open Systems Adapter
addresses. You can 'attach' a free device to a virtual machine and make it available for use. One way to attach a
real device is to use the 'ATTACH' command.
You will be using OSA devices 800-802 in this workshop later to provide networking for the Linux guest you
will build. Let's attach these devices to the MAINT virtual machine now.
===> attach 800-802 maint
Display the status of these devices:
===> q 800-802
Notice that they are no longer free! They show as attached to MAINT. The command to return these devices to
the free resource pool for other virtual machines to use is 'DETACH'.
2.7 INDICATE
CP also has commands to help you monitor what’s happening with your system; IND or INDICATE,
is one such command. Let's try a few:
===> ind load
This simple command tells you many things. You might notice right away your system is sleeping!!!
● Average utilization is 000%
● No I/O activities
● No paging
● Etc.
Another useful command is 'IND USER' . You can use this command to find out how a specific virtual machine
is doing. If the I/O count fields are progressing you know the machine is working on something. Hopefully its
something productive. You might want to try some IND USER commands when your Linux guest is running
later on. (See output above)
===> ind user maint
20
Virtualization and Linux on System z Workshop
Try others....
===> ind paging
===> ind i/o
2.8 CPFMTXA
When you add a new disk to a PC you may format, partition, and build filesystems. When you add disk
to a z/VM system, you must format it and tell z/VM how you would like the disk to be used, ie. Page,
spool, perm etc.
CPFMTXA is a utility for formatting and allocating page, spool, temporary disk, and directory space on DASD
volumes. These special volumes are listed in the 'CP_OWNED_VOLUMES' list of the 'SYSTEM CONFIG'
file. Z/VM uses volumes in this list whenever it needs to allocate page, spool, temporary and directory space.
In addition, CPFMTXA can be used to format, label , and allocate DASD volumes for user minidisk space. This
kind of allocation is called PERM space.
Now let's practice using the CPFMTXA utility.
21
Virtualization and Linux on System z Workshop
===> 0 end
Next you are asked for a new volume label. Enter:
===> zvmpg1
We are next warned that CPFMTXA is about to erase all data on the volume; are you sure you
want to continue? Enter:
===> yes
CPFMTXA now invokes ICKDSF to begin formatting the volume. This would be a good time
to get a cup of coffee! When the formatting is done, CPFMTXA presents the following:
CPFMTXA is reporting the current allocation map of the new volume ZVMPG1. Note that by
default CPFMTXA allocated all cylinders as PERM space. PERM space is where virtual
machine minidisks are allocated. For now, let's accept the default and exit the utility. Enter:
===> end
22
Virtualization and Linux on System z Workshop
===> cpfmtxa
In this case you want to allocate cylinders. Enter:
===> allocate
Enter the virtual device number of ZVMPG1 to be processed:
===> 300
Next enter the volume label. This is a check to make sure you are working on the volume you are
supposed to. This verification is meant to protect against accidental overwriting. Enter:
===> ______________
Enter allocation data. Start by making cylinders 0-2500 PAGE space. Enter:
===> page 0 2500
This specifies starting with cylinder 0 and ending with cylinder 2500 we want PAGE space. This
allocates 2501 cylinders as page space. Note: You do not get acknowledgment back until you type
“end” later.
Make the next 200 cylinders spool space. Enter:
===> spol 2501 2700
Make the rest (637 cylinders) temporary disk. Enter:
===> tdsk 2701 3337
We now tell CPFMTXA you are done altering the allocation map by entering:
===> end
23
Virtualization and Linux on System z Workshop
A new allocation map is presented. Verify that the allocations are correct.
You are now done with device 300. Detach it from the system. Enter:
===> detach 300
24
Virtualization and Linux on System z Workshop
3.1 Introduction
Just as you can interact with Linux or UNIX® through a bash or Korn shell, you can interact with
z/VM through CMS. Like a shell, you can use CMS to edit files, run EXECs (script-like executable
files) or programs, modify the virtual machine environment, or modify z/VM itself. CMS is to z/VM as
a shell is to Linux or UNIX.
25
Virtualization and Linux on System z Workshop
3.2 HELP
1. To see a list of the CMS commands:
===> help
Place cursor on “CMS” and press the ENTER key
What you see here is a subset of the CMS commands available in z/VM.
2. Display help text for the QUERY command. You may have to scroll down (F8) to find it.
Place cursor on “Query” and press the ENTER key
The bottom of the screen lists the PF Keys for additional options that are available for the
selected command. To see related information for this command:
Press the F11 key
3. When you are done browsing, exit the help utility.
Press the F3 key repeatedly until you return to “RUNNING” state
4. Another way to go directly to the menu of CMS commands is with the following help
command:
===> help cms menu
5. Exit the help facility and return to the READY prompt:
Press the F3 key repeatedly until you return to “RUNNING” state
26
Virtualization and Linux on System z Workshop
3.3 QUERY
The CMS QUERY command is used to display information about your virtual machine. You can get
information about
● The operation of your virtual machine.
● The status of your files and file pool directories.
● Information about how your virtual machine is set up.
1. Use the QUERY ACCESSED command to display the status of your accessed disks. Note that
the 191 disk is accessed as “A”.
===> q accessed
Mode Stat Files Vdev Label/Directory
A R/W 35 191 MNT191
B R/W 132 5E5 MNT5E5
C R/W 55 2CC MNT2CC
D R/W 247 51D MNT51D
S R/O 687 190 MNT190
Y/S R/O 1010 19E MNT19E
2. Use the QUERY IMPCP command to find out the implied CP function setting for your virtual
machine.
===> q impcp
For the MAINT virtual machine, the IMPCP function is set to
________________________________
You will learn more about this function in a moment.
3.4 ACCESS
The ACCESS command is used to:
● Identify a minidisk to CMS.
● Make a list of the files on the specified minidisk or directory available to your virtual machine.
● Establish a file mode letter for the files on a minidisk or in a directory.
1. Use the ACCESS command to access the 191 minidisk as “Z”.
===> access 191 z
What happened to the A-disk? _________________________________________________
What implications does this change have? _______________________________________
2. Re-access the 191 minidisk as “A”. What is the command?
===> _________________________________________________________
27
Virtualization and Linux on System z Workshop
3.5 COPYFILE
The COPYFILE command is used to copy and modify files on CMS minidisks. You can:
● Combine two or more files into a single file.
● Copy multiple input files into multiple output files.
● Change file characteristics (such as file mode number and record format) and/or modify file
contents.
1. Copy the file PROFILE EXEC A to a new file called PROFILE EXECSAVE A.
3.6 CP
There are several ways to issue CP commands in CMS depending on the setting of the implied CP
(IMPCP) option:
● If IMPCP is set to ON, CMS will try to interpret an “unknown” command as a CP command.
● If IMPCP is set to off, you must precede any CP commands with “CP”
Or you can precede any CP command with “#CP” to directly send the command to the control
program.
1. Find your current IMPCP option setting:
===> q impcp
It should say 'ON'. This is the default. It means if CMS does not recognize a command, it will
send to CP for processing.
2. Try a CP command (while you are in CMS):
===> q dasd
Sure enough, the command works and you see a list of DASDs currently attached to your
virtual machine.
3. Next set the IMPCP option to off:
===> set impcp off
4. Try the same CP command:
===> q dasd
28
Virtualization and Linux on System z Workshop
This time, the command failed. With the IMPCP function turned off, CMS did not redirect the
unknown command to CP for processing.
5. You are currently running in the CMS environment. To enter CP mode, type:
===> CP
The console status in the lower right hand corner of the screen now indicates “CP READ” .
6. Try the same CP command:
===> q dasd
7. To return to CMS, type:
===> begin (or 'b' for short)
The status in the lower right hand corner of the console returns to “RUNNING” .
8. Another way to issue CP command is to prefix it with '#CP'. Try this:
===> #cp q dasd
9. Reset the IMPCP option back to ON:
===> set impcp on
3.7 FILELIST
The FILELIST command is used to display a list of information about CMS files residing on accessed disks. In
the FILELIST environment, information is displayed under the control of XEDIT. You can use XEDIT
subcommands to manipulate the list itself. You can also issue CMS commands against the files directly from the
displayed list.
1. Display a list of files on your A-disk.
===> filel * * a
29
Virtualization and Linux on System z Workshop
Update the FILELIST display. The $VMFP2P $MSGLOG file should be gone.
Press the F2 key
3. Rename the PROFILE EXECSAVE file to PROFILE EXEBKUP.
Press the TAB key to advance the cursor to the CMD column of the PROFILE
EXECSAVE file
Type “COPY / = EXECBKUP =” and press the ENTER key
30
Virtualization and Linux on System z Workshop
The command can be read as ”rename the current file (/) to a file with the same file name of
PROFILE (=), a file type of EXECBKUP and the same file mode of A (=)”.
Update the FILELIST display and you should see the new copy of the profile.
Press the F2 key
4. Exit FILELIST.
Press the F3 key
3.8 XEDIT
Let's create a simple REXX EXEC file with an edit session by using the XEDIT command.
1. Start an XEDIT session and create a new file HELLO EXEC A.
===> xedit hello exec
2. Enter Input mode:
===> i
3. Input the following text. Refer to the XEDIT quick reference guide if you need help.
/* A sample REXX exec */
say 'Welcome to the zSeries Linux Workshop'
31
Virtualization and Linux on System z Workshop
6. An REXX EXEC is similar to a Unix/Linux script. Let's run the exec and see what happens:
===> hello
7. Now update the HELLO EXEC file:
===> x hello exec
9. Execute the file again. You have successfully created a executable file to execute commands
and output messages!
===> hello
Next, modify the PROFILE EXEC file so that you will gain access to a shared utility disk
which contains useful scripts for the workshop.
1. Edit the “PROFILE EXEC” file.
===> x profile exec
2. Add the following statements (in upper case) to the end of the file
'CP ATTACH 702 *'
'ACCESS 702 E'
11. Execute the profile to pick up the changes. You should see a message tell you that the device
702 is attached.
===> profile
32
Virtualization and Linux on System z Workshop
33
Virtualization and Linux on System z Workshop
34
Virtualization and Linux on System z Workshop
===> /user_volume
Add a User_Volume_List statement for volume ZVMPK1. (Be sure not to use /* */ because it will be treated
as a comment)
User_Volume_List ZVMPK1
===> /status
Find the line containing the text “Online_at_IPL.”
===> /online
Add an Offline_at_IPL statement for devices 190 and 19E following the “Online_at_IPL” statement.
35
Virtualization and Linux on System z Workshop
Save all the changes you have made so far and exit the SYSTEM CONFIG file.
===> file
4.4 CPSYNTAX
Since the SYSTEM CONFIG file contains very important data, extreme care must be taken to ensure its contents
are correct. The system may not start correctly if this files contains errors. Fixing the errors can be cumbersome.
z/VM provides a utility, CPSYNTAX, in MAINT's 193 minidisk to check the syntax of the SYSTEM CONFIG
file.
1. Access MAINT's 193 minidisk as the X-disk.
===> access 193 x
2. Run the CPSYNTAX command.
===> cpsyntax system config
3. If you receive error messages, modify the SYSTEM CONFIG file and rerun CPSYNTAX.
4. Restore CP’s access to the primary parm disk
Execute the script “FREECF1” to relinquish write access and restore CP's read access to the parm disk.
36
Virtualization and Linux on System z Workshop
37
Virtualization and Linux on System z Workshop
Your system identifier should be ZVM<n> where n is your team id. The system identifier is
also displayed at the lower right hand corner of your console.
4. Check the user volume list
Use the QUERY DASD command to display a list of the DASDs that are attached to the
system.
===> query dasd
DASD 0200 CP OWNED 520RES 74
DASD 0201 CP OWNED 520W01 89
DASD 0202 CP OWNED 520W02 1
DASD 0203 CP OWNED 52PGSP 1
DASD 0300 CP OWNED ZVMPG1 0
DASD 0301 CP SYSTEM ZVMPK1 0
You should see the ZVMPK1 user volume attached to the system.
5. Check features
Use the QUERY RETRIEVE command to display the setting of the retrieve key buffer limits.
===> q ret
99 buffers available. Maximum of 255 buffers may be selected.
A maximum of 99 commands can now be stored and retrieved from the retrieve key buffer.
The retrieve keys (PF11 and PF12) are defined in the PROFILE EXEC file.
6. Check offline devices
Once again, use the QUERY DASD command to display any offline devices.
===> query dasd offline
An offline DASD was not found.
38
Virtualization and Linux on System z Workshop
39
Virtualization and Linux on System z Workshop
POSIXGROUP mail 6
POSIXGROUP security 7
POSIXGROUP nobody 4294967294
The above directory control statement defines a virtual machine called TEAM1, whose password is 'adrian'.
When TEAM1 logs on it is allocated 768 Megabytes of virtual storage. It is allowed a maximum of 2048
40
Virtualization and Linux on System z Workshop
41
Virtualization and Linux on System z Workshop
Line Explanation
PROFILE LINDFLT Define the profile named LINDFLT
IPL CMS When the user ID is logged on, IPL CMS
MACH ESA 4 The machine architecture is ESA with a maximum of 4 CPUs.
CPU 00 BASE CPU 00 is the base
CPU 01 The user has access to 2 CPUs ( 00 and 01)
SPOOL 000C 2540 READER * Definition of a virtual reader
SPOOL 000D 2540 PUNCH A Definition of a virtual punch
SPOOL 000E 1403 A Definition of a virtual printer
CONSOLE 009 3215 T Definition of a console
LINK MAINT 0190 0190 RR Link to MAINT's 190 minidisk with read access
LINK MAINT 019D 019D RR Link to MAINT's 19D minidisk with read access
LINK MAINT 019E 019E RR Link to MAINT's 19E minidisk with read access
LINK TCPMAINT 592 592 RR Link to TCPMAINT's 592 minidisk with read access. This is where the ftp
utility is located.
42
Virtualization and Linux on System z Workshop
===> file
5.4 DISKMAP
When defining minidisks to virtual machines by editing the user directory as you are doing here, there is another
step you should perform to ensure you are not defining overlapping minidisks. The DISKMAP utility
summarizes the MDISK statements in the user directory and produces a report called DISKMAP USER
A Gaps between minidisks and overlapping minidisks are flagged in this report.
1. Run the DISKMAP utility .
===> diskmap user
2. Edit the output file and look at the DISKMAP report. Turn the prefix area off so you can see 80
columns:
===> x user diskmap
===> pre off
3. Check the report to make sure that for the ZVMPK1 volume:
○ There are no gaps
○ There are no overlaps
○ Minidisks 100-103 are allocated correctly to LINUX1
43
Virtualization and Linux on System z Workshop
===> /$alloc$
Add an entry so cylinder 0 of the ZVMPK1 volume does not show up as a gap (the virtual address A04
is also a dummy value – it will never be used).
MDISK A04 3390 000 001 ZVMPK1 R
Save the changes and exit the file:
===> file
Run the DISKMAP utility again to verify that cyclinder 0 does not show up as a gap any more.
===> diskmap user
===> x user diskmap
===> qq
------------------------------------------------------------------------
------------------------------------------------------------------------
5.6 DIRCTXA
What you have been editing, USER DIRECT, is the source file. The DIRECTXA utility is used to build the
actual directory and installed it to the directory space on 520RES (123).
1. Run the DIRECTXA utility to build the user directory and put it on-line.
===> directxa user
2. Correct any errors and rerun the DIRECTXA utility if necessary.
3. Log off the MAINT user.
===> logoff
44
Virtualization and Linux on System z Workshop
45
Virtualization and Linux on System z Workshop
46
Virtualization and Linux on System z Workshop
TCP/IP servers, applications, and users; these files contain information that is (or may be) referenced
by all users. ETC GATEWAYS contains routing information for distant networks and hosts.
userid DTCPARMS May be used for servers that do not require configuration by the TCP/IP administrator, such
as a test server. This file will most likely be found on a server’s file mode A.
nodeid DTCPARMS This is useful for shared-DASD configurations. The node ID used is the node ID returned by
the CMS IDENTIFY command. This file should be kept on the TCPMAINT 198 disk.
SYSTEM DTCPARMS Most server configurations should be kept in this file on the TCPMAINT 198 disk.
IBM DTCPARMS Server classes provided by IBM, as well as the default server configurations, are in this file.
This file is on TCPMAINT 591 and should never be modified because it will be replaced
when service is applied or when a new release is installed. Any modifications you make
should be placed in SYSTEM DTCPARMS.
47
Virtualization and Linux on System z Workshop
6.2 IPWIZARD
You can initially configure TCP/IP via the IPWIZARD command which is generally used just once.
After IPWIZARD creates the initial configuration files, they are typically maintained manually.
1. Log on as MAINT.
Log on to MAINT
2. The IPWIZARD command is on the MAINT 193 disk. Issue the ACCESS command so you
will pick up IPWIZARD from that minidisk.
==> acc 193 g
3. Invoke the IPWIZARD.
==> ipwizard
4. At the '*** z/VM TCP/IP Configuration Wizard ***' panel. Fill in the following data:
Host Name: zvm<n>
Doamin Name: pbm.ihost.com
Gateway IP: 129.40.35.3
DNS Address: 129.40.35.3
48
Virtualization and Linux on System z Workshop
49
Virtualization and Linux on System z Workshop
50
Virtualization and Linux on System z Workshop
51
Virtualization and Linux on System z Workshop
12. At this point, your z/VM system should be on the network. Go to a DOS prompt (or Linux
session) and try to ping your z/VM system.
# ping 129.40.35.<n>0
3. Now, copy the file PROFILE XEDIT from that disk to your A disk.
===> copy profile xedit z = = a
52
Virtualization and Linux on System z Workshop
4. This will result in TCPMAINT's XEDIT sessions having the same look and feel as MAINT's.
5. List the CMS disks that are accessed via the QUERY DISK command. Note that the
TCPMAINT 198 disk is accessed as your D disk:
===> q disk
LABEL VDEV M STAT CYL TYPE BLKSZ FILES BLKS USED-(%) BLKS LEFT BLK TOTAL
TCM191 191 A R/W 7 3390 4096 1 8-01 1252 1260
TCM198 198 D R/W 9 3390 4096 2 9-01 1611 1620
TCM591 591 E R/W 61 3390 4096 219 7988-73 2992 10980
TCM592 592 F R/W 70 3390 4096 917 9381-74 3219 12600
MNT190 190 S R/O 100 3390 4096 689 14622-81 3378 18000
MNT19E 19E Y/S R/O 250 3390 4096 1011 26739-59 18261 45000
6. This is an important disk for TCP/IP configuration files. List all the files on this disk. What is
the command?
===> _______________________________________________
TCPMAINT FILELIST A0 V 169 Trunc=169 Size=2 Line=1 Col=1 Alt=0
Cmd Filename Filetype Fm Format Lrecl Records Blocks Date Time
x PROFILE TCPIP D1 V 73 65 1 4/11/07 13:57:16
SYSTEM DTCPARMS D1 V 71 7 1 4/11/07 13:57:16
53
Virtualization and Linux on System z Workshop
This file is how the OSA devices 800, 801 and 802 are attached to the TCPIP service machine.
54
Virtualization and Linux on System z Workshop
55
Virtualization and Linux on System z Workshop
56
Virtualization and Linux on System z Workshop
===> file
7. Check the syntax by using the CPSYNTAX command.
===> access 193 x
===> cpsyntax system config
8. Execute the script to release write access to the primary parm disk.
===> freecf1
57
Virtualization and Linux on System z Workshop
1. Link to AUTOLOG1's 191 minidisk. Use mode MW to access the disk in “shared” WRITE mode.
===> link autolog1 191 291 mw
2. Access the 291 minidisk as Z.
===> access 291 z
3. Edit AUTOLOG1’s PROFILE EXEC:
===> x profile exec z
4. Replace the contents of the PROFILE EXEC file with the following lines:
/***************************/
/* Autolog1 Profile Exec */
/***************************/
'CP AUTOLOG TCPIP TCPIP'
'CP XAUTOLOG DTCVSW1'
'CP XAUTOLOG DTCVSW2'
'CP SET VSWITCH VSW1 GRANT LINUX1'
'CP SET VSWITCH VSW1 GRANT LINUX2'
'CP LOGOFF'
The original AUTOLOG1's PROFILE EXEC contained AUTOLOG commands for VMSERVS,
58
Virtualization and Linux on System z Workshop
VMSERVU, and VMSERVR. These ID's provide z/VM's shared filed services. You are not using the
shared file system so they can be removed.
Statement Description
'CP AUTOLOG TCPIP TCPIP' Starts z/VM's TCPIP stack. In most instances, you want to start TCPIP
at every IPL (for security reasons, some shops do not put z/VM on the
network).
'CP XAUTOLOG DTCVSWn' Start the two VSWITCH controllers.
'CP SET VSWITCH VSW1 GRANT LINUXn' Grants LINUX1 and LINUX2 access to VSWITCH VSW1 (yes,
LINUX2 does not exist yet, but it will later).
'CP LOGOFF' The virtual machine is logged off so it doesn't continue to use memory.
59
Virtualization and Linux on System z Workshop
3. Verify the syntax with the CPSYNTAX command. When the system is re-IPL'ed next time, the
product will be enabled.
==> cpsyntax system config
4. You can also enable the product dynamically using the SET PRODUCT command:
===> set product prodid 5vmptk30 state enabled
60
Virtualization and Linux on System z Workshop
===> /port
3. Add a line for PORT 81. Setting the Performance Toolkit to use port 81 will cause a browser
pointed to your z/VM system to show the Toolkit output.
PORT
; 20 TCP FTPSERVE NOAUTOLOG ; FTP Server
; 21 TCP FTPSERVE ; FTP Server
23 TCP INTCLIEN ; TELNET Server
; 25 TCP SMTP ; SMTP Server
; 53 TCP NAMESRV ; Domain Name Server
; 53 UDP NAMESRV ; Domain Name Server
; 67 UDP DHCPD ; DHCP Server
; 69 UDP TFTPD ; TFTPD (Trivial FTP) Server
81 TCP PERFSVM ; z/VM Performance Toolkit
; 111 TCP PORTMAP ; Portmap Serverr
5. TCPIP needs to be recycled in order for our changes to take effect. One way to do this is to
force off and automatically log on the TCPIP user ID. This assumes that you are accessing your
Linux system through the first level TEAM<n> user ID. If you are accessing your system via its
IP address, forcing TCPIP will kill your 3270 session:
===> force tcpip
===> xautolog tcpip
6. Check if everything was successful by issuing the NETSTAT CLIENTS command. You want
to see that the service PERFSVM is a client (listening). It should be the last entry in the list:
===> netstat clients
...
Client: PERFSVM Authorization: {none}
Notes Handled: none
Last Touched: 0:07:17
Vmcf error count: 0
...
61
Virtualization and Linux on System z Workshop
Logoff of TCPMAINT
Logon to PERFSVM
2. After you have logged on and pressed Enter, the guest will execute an EXEC that puts you in
the Performance Toolkit environment. Exit from this environment to return to RUNNING
state.
Enter the PF3 key twice
3. Before you start, it is recommended to copy the PROFILE XEDIT from MAINT's 191 disk so
that XEDIT environment will have a common feel.
===> vmlink maint 191
ENTER READ PASSWORD: READ
===> copy profile xedit z = = a
FCONX $PROFILE
1. The main configuration file is FCONX $PROFILE. Edit that file and search for the string VMCF.
===> x fconx $profile a
===> /vmcf
2. This should take you to the “activates VMCF data retrieval interface” section. This sets the Performance
Toolkit to collect Linux performance data.
Modify as shown below:
* Following command activates VMCF data retrieval interface
FC MONCOLL VMCF ON
* Following command activates Internet interface
FC MONCOLL WEBSERV ON TCPIP TCPIP 81 IDTEST CP
* Following command activates Internet interface with SSL
*C MONCOLL WEBSERV ON SSL TCPIP TCPIP 81 IDTEST RACF
* Following command activates TCP/IP interface for data retrieval
* from LINUX RMF DDS interface
FC MONCOLL LINUXUSR ON TCPIP TCPIP
...
62
Virtualization and Linux on System z Workshop
FCONRMT AUTHORIZ
The remote data retrieval authorization file. It specifies the systems to be monitored.
1. Create the FCONRMT AUTHORIZ file:
===> x fconrmt authoriz
2. Add the following 2 lines - replace ZVM<n> with your system name:
ZVM<n> PERFSVM S&FSERV
ZVM<n> MAINT DATA CMD EXCPMSG
FCONRMT SYSTEMS
1. Create the FCONRMT SYSTEMS file:
===> x fconrmt systems
2. Add the following line - replace ZVM<n> with your system name:
ZVM<n> PERFSVM ESA N FCXRES00
FCONX LINUXUSR
The Linux System Definition File. It defines the Linux systems to be monitored:
1. Create the fCONX LINUXUSR file:
===> x fconx linuxusr
2. Add the following 2 lines: TCP/IP addresses of your two Linux systems:
LINUX1 129.40.35.<xxx>:8803
LINUX2 129.40.35.<yyy>:8803
PROFILE EXEC
This file contains the types of data to be collected.
1. Edit the PROFILE EXEC file:
===> x profile exec
2. Search for the string enabled:
63
Virtualization and Linux on System z Workshop
===> /enabled
3. Uncomment the five MONITOR SAMPLE and the two MONITOR EVENT statements by
removing the /* */ around each line :
/*** Once you have PERFKIT enabled and running uncomment the ***/
/*** following comments ***/
'CP MONITOR SAMPLE ENABLE PROCESSOR'
'CP MONITOR SAMPLE ENABLE STORAGE'
'CP MONITOR SAMPLE ENABLE USER ALL'
'CP MONITOR SAMPLE ENABLE I/O ALL'
'CP MONITOR SAMPLE ENABLE APPLDATA ALL'
'CP MONITOR EVENT ENABLE STORAGE'
'CP MONITOR EVENT ENABLE I/O ALL'
Exit
===> file
2. Disconnect from PERFSVM now. The Performance Toolkit is running as a service virtual
machine.
===> #cp disc
64
Virtualization and Linux on System z Workshop
2. Logon as MAINT.
VM UserID: maint
Password: maint
Click Submit
You should see the Central Monitory System Load Overview screen.
3. Select the system to monitor. Under the Node-ID column:
Click on your system name
You should see the Initial Performance Data Selection Menu screen similar to the following:
4. Note the screen number 29, Linux systems is a hot link. If you drill down into it, the CPU,
memory and network links will be dead. Later you will enable Linux virtual servers to provide
this performance data.
Linux screens selection
65
Virtualization and Linux on System z Workshop
S Display Description
. LINUX RMF PM system selection menu
. LXCPU Summary CPU activity display
. LXMEM Summary memory util. & activity display
. LXNETWRK Summary network activity display
Congratulations, you have configured a Web interface to the z/VM Performance Toolkit.
66
Virtualization and Linux on System z Workshop
The PROFILE EXEC that you just copied is a REXX EXEC that is analogous to a .bash_profile startup
script. It first creates two VDISK swap spaces in memory of sizes 256MB and 512MB. If the user ID is
logged on in a disconnected mode (usually via XAUTOLOG), Linux will be IPLed from minidisk 100.
Otherwise the user is prompted.
===> type profile exec
Following are the contents:
/* PROFILE EXEC for Linux virtual servers - If user is disconnected
IPL Linux at 100, otherwise prompt user to IPL from 100 */
'CP SET RUN ON'
'CP SET PF11 RETRIEVE FORWARD'
'CP SET PF12 RETRIEVE'
'SWAPGEN 101 524288' /* create a 256M VDISK disk swap space */
'SWAPGEN 102 1048576' /* create a 512M VDISK disk swap space */
'PIPE CP QUERY' userid() '| var user'
parse value user with id . dsc .
if (dsc = 'DSC') then /* user is disconnected */
'CP IPL 100'
else /* user is interactive -> prompt */
67
Virtualization and Linux on System z Workshop
do
say 'Do you want to IPL Linux from DASD 100? y/n'
parse upper pull answer .
if (answer = 'Y') then /* IPL Linux at 100 */
'CP IPL 100'
else /* CMS is wanted */
'ACC 592 C'
end
You will be running this EXEC soon.
68
Virtualization and Linux on System z Workshop
yes
COPYING 0X0100
END OF COPY
6. When you see the “END OF COPY” message, exit the DDR utility:
Press the Enter key
There are three files where the IP address and host name have to be modified.
● /etc/sysconfig/network-scripts/ifcfg-eth0 - IP address
● /etc/sysconfig/network - Host name
69
Virtualization and Linux on System z Workshop
/etc/sysconfig/network-scrips/ifcfg-eth0
1. Note the current IP address in the file /etc/sysconfig/network-scrips/ifcfg-eth0
# cd /etc/sysconfig/network-scripts
# cat ifcfg-eth0
# IBM QETH
DEVICE=eth0
BOOTPROTO=static
IPADDR=129.40.35.141
MTU=1500
NETMASK=255.255.255.0
NETTYPE=qeth
ONBOOT=yes
PORTNAME=DONTCARE
SUBCHANNELS=0.0.0700,0.0.0701,0.0.0702
MTU=1500
2. Use sed -i to change the IP address from from <n>1 to <n>2 corresponding to your team
number:
# sed -i ifcfg-eth0 -e 's/141/<n>1/g'
3. Verify the file has been modified correctly:
# cat ifcfg-eth0
/etc/sysconfig/network
1. Modify the /etc/sysconfig/network file:
# cd /etc/sysconfig
# cat network
Note that the host name in /etc/sysconfig/network is for Team 14.
2. Change the host name to correspond to your team number.
# sed -i network -e 's/zvm14/zvm<n>/g'
3. Verify the file has been modified correctly:
# cat network
/etc/hosts
1. Modify the /etc/hosts file. Change the host name to correspond to your team number.
70
Virtualization and Linux on System z Workshop
# cat /etc/hosts
# sed -i /etc/hosts -e 's/zvm14/zvm<n>/g'
2. Verify the file has been modified correctly:
# cat /etc/hosts
3. Use the lsdasd command to list the disk devices that you have. Compare this with the file
system table:
# lsdasd
0.0.0100(ECKD)at(94:0) is dasda:active at blocksize 4096, 297000 blocks, 1160 MB
0.0.0101(FBA )at(94:4) is dasdb:active at blocksize 512, 524288 blocks, 256 MB
0.0.0102(FBA )at(94:8) is dasdc:active at blocksize 512, 1048576 blocks, 512 MB
# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
You should notice that /dev/dasdb (101) and /dev/dasdc (102) are not being used. Remember
these devices are virtual disks in memory that were created by the SWAPGEN EXEC which
was called by the PROFILE EXEC when you logged onto your system. One important attribute
71
Virtualization and Linux on System z Workshop
of these disks is that the memory is not used until it is referenced. So if the system never swaps,
almost no memory is used (perhaps only 8KB per VDISK).
4. Note that there are no swap spaces:
# swapon -s
5. Make a backup copy of the /etc/fstab file then add two swap spaces to it.
# cd /etc
# cp fstab fstab.orig
# vi fstab
LABEL=/ / ext3 defaults 1 1
/dev/dasdb1 swap swap defaults 0 0
/dev/dasdc1 swap swap defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
6. Use the swapon -a command to turn on all swap spaces. The file /etc/fstab will be read. This
has the side effect of testing the changes you made to the file. Verify that you now have two
swap spaces:
# swapon -a
# swapon -s
Filename Type Size Used
Priority
/dev/dasdb1 partition 259956 0 -1
/dev/dasdc1 partition 519924 0 -2
7. Shutdown the system because you will be defining more networking resources to z/VM.
# shutdown -h now
72
Virtualization and Linux on System z Workshop
This shows that you have created a Hipersocket-style Guest LAN at z/VM IPL time.
73
Virtualization and Linux on System z Workshop
device 800. The same way all Linux user ID's get a virtual NIC to the VSWITCH starting at
virtual address 700, they will get a virtual NIC to the Guest LAN starting at virtual address 800:
===> x user direct
PROFILE lindflt
IPL CMS
MACH esa 4
cpu 00 base
cpu 01
SPOOL 000C 2540 READER *
SPOOL 000D 2540 PUNCH A
SPOOL 000E 1403 A
CONSOLE 009 3215 T
nicdef 700 type qdio lan system vsw1
special 800 hiper 3 system glan1
LINK MAINT 0190 0190 RR
LINK MAINT 019D 019D RR
LINK MAINT 019E 019E RR
LINK tcpmaint 592 592 rr
2. Bring your changes online. What is the command?
===>__________________________________________________
74
Virtualization and Linux on System z Workshop
Log in as root
4. Change directory to /sys/bus/ccwgroup/drivers/qeth. You should see the one device that is
being driven by the qeth/qdio driver.
# cd /sys/bus/ccwgroup/drivers/qeth
# ls
0.0.0700 group notifier_register
5. What is device 0.0.0700?______________________________________________________
6. Our new device is a triplet starting at 800. To notify the qdio/qeth driver of this device, you
must echo the virtual device addresses to the special file named group. You should see a new
directory 0.0.0800 get created for this triplet:
# echo 0.0.0800,0.0.0801,0.0.0802 > group
# ls
0.0.0700 0.0.0800 group notifier_register
7. Change into this directory. There are many files relating to the data structures of the driver. Two
important ones are named portname, online and if_name. In the past, a port name identifier
was also necessary to connect a NIC to an OSA device. This requirement has been relaxed.
Confirm that no portname is required:
# cd 0.0.0800
# cat portname
no portname required
8. Another important file is named online. By default the new device is not online. Bring it online
by echoing a 1 to the file:
# cat online
0
75
Virtualization and Linux on System z Workshop
76
Virtualization and Linux on System z Workshop
BOOTPROTO=static
IPADDR=10.0.0.1
MTU=1500
NETMASK=255.255.255.0
NETTYPE=qeth
ONBOOT=yes
PORTNAME=DONTCARE
SUBCHANNELS=0.0.0800,0.0.0801,0.0.0802
MTU=1500
...
Congratulations, you have defined a Guest LAN to z/VM and tested that it is created at IPL-
time. You created a NIC for LINUX1 and all other user IDs using the PROFILE LINDFLT.
You have dynamically defined a new interface on Linux and configured your system to create
the device at boot-time.
6. Next it is time to learn how to clone this system. It is always recommended to clone a quiesced or shut
down system, so shut your system down now then log off of it.
# shutdown -h now
77
Virtualization and Linux on System z Workshop
78
Virtualization and Linux on System z Workshop
79
Virtualization and Linux on System z Workshop
80
Virtualization and Linux on System z Workshop
# vi /etc/sysconfig/network-scripts/ifcfg-hsi0
Set the IP address to 10.0.0.2
# vi /etc/sysconfig/network
Set the host name to zvm<n>lin2
# vi /etc/hosts
Set the host name to zvm<n>lin2
81
Virtualization and Linux on System z Workshop
From LINUX2:
# ping -c1 129.40.35.<n>1
# ping -c1 10.0.0.<1>
[root@zvmxlin2 ~]# ping -c1 129.40.35.121
PING 129.40.35.121 (129.40.35.121) 56(84) bytes of data.
64 bytes from 129.40.35.121: icmp_seq=1 ttl=64 time=2.16 ms
If any of the tests fail, go back and try to fix the problem.
Congratulations, you have created a Linux image with two different types of networking interfaces,
cloned that system, modified the clone and have the two systems communicating.
82
Virtualization and Linux on System z Workshop
Which is your primary controller ______________ and what are the OSA devices
_____________
Which is your backup controller ______________ and what are the OSA devices
_____________
3. Open an SSH session to LINUX1 and log on as root.
Log in to LINUX1 as root
4. Start a ping to LINUX2's primary TCP/IP address and let it run.
===> ping 129.40.35.<n>2
83
Virtualization and Linux on System z Workshop
Go back to the LINUX1 SSH session. You should see the ping output continue without
hesitation. The backup has now taken over as the primarily to service network requests. In the
mean time, z/VM is in the process of recovering the failed controller. You can leave the ping
going for the next test.
2. Display the status of the virtual switch again. You should see that z/VM failed over to the
secondary OSA device and that what was the primary is now the backup.
Note: The backup controller will take a few minutes to come online. In the meantime you may
see query command returns a state of error for the failed controller. Repeat the command in 1
minutes until the backup controller is in backup state.
===> q vswitch
VSWITCH SYSTEM VSW1 Type: VSWITCH Connected: 2 Maxconn: INFINITE
PERSISTENT RESTRICTED NONROUTER Accounting: OFF
VLAN Unaware
State: Ready
IPTimeout: 5 QueueStorage: 8
RDEV: 0900 Controller: DTCVSW2 VDEV: 0900 BACKUP
RDEV: 0A00 Controller: DTCVSW1 VDEV: 0A00
2. From MAINT, use the FORCE command to log the primary controller off.
===> force <primary controller>
You should see that the remaining controller is now acting as the primary and backup
controller, since the other one is logged off.
4. Back on LINUX1, the ping should still be running. Stop it now by entering:
# ctrl-c
You have demonstrated the highly available (HA) features of a z/VM virtual switch. Implementing
these at the z/VM layer pushes the HA qualities down to all Linux guests.
84
Virtualization and Linux on System z Workshop
85
Virtualization and Linux on System z Workshop
1. Logon to AUTOLOG1
Logon as AUTOLOG1, but don't press Enter at the VM READ prompt:
What will happen if you press Enter? ____________________________________________
The PROFILE will run which has a final command of LOGOFF. AUTOLOG1 will be logged
off.
2. There is a special command to avoid this situation. Type:
===> acc (noprof
This means to continue processing without running the profile. You should now in Running
state.
3. Edit the PROFILE EXEC and add statements to
● automatically log on LINUX1 and IPL Linux
● automatically log on LINUX2 and IPL Linux
86
Virtualization and Linux on System z Workshop
After the Linux user IDs are logged on, Linux will start because of the logic in their PROFILE
EXEC's that IPLs minidisk 100 when starting in a disconnected mode.
4. Save the changes and logoff of AUTOLOG1.
===> file
Log off AUTOLOG1
87
Virtualization and Linux on System z Workshop
# vi /etc/inittab
Change the command for CTRL-ALT-DEL to _____________________________
5. Tell the system to pickup the new setting in the /etc/inittab file:
# init q
88
Virtualization and Linux on System z Workshop
This is an effective tool for shutting down individual Linux user IDs easily and cleanly.
You may or may not see the following messages for LINUX1 and LINUX2.
HCPSIG2113I User LINUX2 has reported successful termination
When the Linux images are completely down the system will start to shutdown even if the time hasn't
expired. When z/VM is shut down all the way, you should see the following line. Note the name of the
system in the lower right corner.
00: HCPGIR450W CP entered; disabled wait PSW 00020000 00000000 00000000
00000FFF
89
Virtualization and Linux on System z Workshop
4. You want to take the default of AUTOLOG in the third parameter so the AUTOLOG1's
PROFILE EXEC will run.
7. You should see some output from that PROFILE running at the end of the IPL messages:...
13:27:30 AUTO LOGON *** DTCVSW1 USERS = 7 BY AUTOLOG1
13:27:30 AUTO LOGON *** DTCVSW2 USERS = 8 BY AUTOLOG1
13:27:30 AUTO LOGON *** LINUX1 USERS = 9 BY AUTOLOG1
13:27:30 AUTO LOGON *** LINUX2 USERS = 10 BY AUTOLOG1
13:27:30 USER DSC LOGOFF AS AUTOLOG1 USERS = 9
13:27:30 0800-0802 ATTACHED TO TCPIP BY TCPIP
13:27:31 HCPSWU2830I VSWITCH SYSTEM VSW1 status is ready.
13:27:31 HCPSWU2830I DTCVSW2 is VSWITCH controller for device 0900.
8. When the system initialization completes, log off OPERATOR and log on to MAINT.
===> disconnect
Press Enter
Logon as MAINT
Congratulations, you have configured z/VM to cleanly shutdown and IPL your Linux systems.
90
Virtualization and Linux on System z Workshop
z/VM setup
1. To enable your Linux guest for data gathering ensure that the Linux guest directory includes the
91
Virtualization and Linux on System z Workshop
option APPLMON.
2. If you are not logged on to MAINT already
Logon as MAINT
3. Edit the USER DIRECT file and add the APPLMON option to the LINDFLT profile as shown
below:
===> x user direct
PROFILE LINDFLT
IPL CMS
MACH ESA 4
CPU 00 BASE
CPU 01
option applmon
SPOOL 000C 2540 READER *
...
5. Shutdown the Linux systems, LOGOFF and then LOGON again. This will enable the change
to the directory entry. Let's do this all from MAINT.
Setup LINUX1
1. When the system comes up,
Login to LINUX1 as root
92
Virtualization and Linux on System z Workshop
to send a non-zero value into the monitoring variables in the /proc/ virtual file system:
# echo 1 > /proc/sys/appldata/timer
# echo 1 > /proc/sys/appldata/mem
# echo 1 > /proc/sys/appldata/os
# echo 1 > /proc/sys/appldata/net_sum
4. You can set the time that lapses between consecutive data samples. The time you set is
measured by the virtual CPU timer. Because the virtual timer slows down as the guest idles, the
time sampling interval in real time can be considerably longer than the value you set. The value
in /proc/sys/appldata/interval is the sample interval in milliseconds. The default sample interval
is 10000 ms.
To read the current value, issue:
# cat /proc/sys/appldata/interval
Setup LINUX2
If you wish, setup LINUX2 using the same procedures for LINUX1 above.
93
Virtualization and Linux on System z Workshop
4. Shutdown the Linux system, LOGOFF and then LOGON again. This will enable the change
to the directory entry. Let's do this all from MAINT.
94
Virtualization and Linux on System z Workshop
95
Virtualization and Linux on System z Workshop
openssl-ibmca-1.0.0.rc2-1.el5.3.s390x.rpm
96
Virtualization and Linux on System z Workshop
This exercise steps you through the steps necessary to enable Apache to use openSSL and the PCICA
device.
1. To mount the install tree, create a mount point then mount the NFS-exported RHEL 5 install
97
Virtualization and Linux on System z Workshop
tree that your system was installed from: (This has been done in the previous section.)
# mount 129.40.35.3:/mnt/rhel5root /mnt/rhel5
# cd /mnt/rhel5/Server
2. Create a yum configuration file pointing to the new mount directory:
# cd /etc/yum.repos.d/
# vi rhel5.repo
[RHEL5]
name=Red Hat Enterprise Linux 5
baseurl=file:///mnt/rhel5/Server
gpgcheck=0
3. To import the RPM GPG key, use the rpm –import command:
# rpm --import /mnt/rhel5/RPM-GPG-KEY-redhat-release
Segmentation fault
:((
TODO: figure the error here or open a bugzilla – workaround is to add
“gpgcheck=0” to rhel5.repo
Additional RPMs will be needed for dependencies, so yum is used with the -y install flags:
# yum -y install httpd httpd-manual openCryptoki mod_ssl
Make sure your apache web server is operational before proceeding to the next step:
# service httpd start
Start a web browser and access the Web server for the http protocol:
http://129.40.35.<n>1
You should see the Red Hat Enterprise Linux Test Page.
98
Virtualization and Linux on System z Workshop
enter a pass phrase. Using this encryption standard, you will be prompted for the pass phrase every
time you start the Apache server with SSL.
# cd /etc/httpd/conf/
# openssl genrsa -des3 -out test.key 1024
Generating RSA private key, 1024 bit long modulus
...............++++++
.....................................++++++
e is 65537 (0x10001)
Enter pass phrase for test.key: redhat
Verifying - Enter pass phrase for test.key: redhat
Create a self-signed certificate. You need to provide the private key generated from the previous step
and enter the pass phrase when prompted. You will also be asked to enter information about the server.
When prompted to enter the 'Common Name', enter your Linux server's IP address. All the other fields
are optional.
# openssl req -new -key test.key -x509 -out test.crt
Enter pass phrase for test.key: redhat
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]: US
State or Province Name (full name) [Some-State]: NY
Locality Name (eg, city) : POK
Organization Name (eg, company) [Internet Widgits Pty Ltd]: IBM
Organizational Unit Name (eg, section) : Linux
Common Name (eg, YOUR name) : 129.40.35.<n>1
Email Address : root@zvm<n>lin1.pbm.ihost.com
99
Virtualization and Linux on System z Workshop
1. Around line 67, modify the SSLCryptoDevice directive to enable the crypto card.
# Use "SSLCryptoDevice" to enable any supported hardware
# accelerators. Use "openssl engine -v" to list supported
# engine names. NOTE: If you enable an accelerator and the
# server does not start, consult the error logs and ensure
# your accelerator is functioning properly.
#
SSLCryptoDevice ibmca
2. Around line 107, modify these directives to point to the file names of the key and certificate you just
created in the previous step.
# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. A new
# certificate can be generated using the genkey(1) command.
SSLCertificateFile /etc/httpd/conf/test.crt
...
...
# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
SSLCertificateKeyFile /etc/httpd/conf/test.key
3. Save your changes and restart the Web server. Enter the pass phrase for the private key when
prompted.
# service httpd restart
Since you are using a self signed certificate, a security alert window will pop up telling you that the
certificate did not come from a known (trusted) authority.
View the certificate and verify it is the one you created.
Click on 'Examine certificate'
Accept the certificate and proceed with the https request. You should see the home page for the
Apache server. Now how can you verify that the Crypto device is being used?
# ________________________________________________________
Stop the Apache server before moving on to the next exercise
100
Virtualization and Linux on System z Workshop
101
Virtualization and Linux on System z Workshop
The space used by the directories adds up to 9 MB. You should add 4kb per shared file as
filesystem overhead and about 10% on top of that for updates and contingencies which results
in
102
Virtualization and Linux on System z Workshop
9216k + (101 x 4k) = 9620 KB + 962k = 10582 KB or 10.5 MB. I like rounding up to the magic
numbers (4,8,16,32,64...), so this would be 16 MB. This number is well below the maximum
size of 1536 MB which means we are within our boundaries.
Now let’s establish the start and end address for the DCSS. This addresses must be on a page
boundary (4 KB on the mainframe) and in hexadecimal notation. (note: do not enter the
spaces between the hex numbers, they are there only for readability.)
Start address: 512 MB => 0x20 00 00 00
End address: 512 MB + 16 MB - 1 B => 0x20 ff ff ff
We must calculate the page frame number for the start and end address. You can do this by
dividing the above numbers by 4096 (4K pages). In hexadecimal notation 4096 = 1000, so
dividing the above numbers by 1000 can be accomplished by dropping the last three digits.
Start address: 0x20000000 = page frame number 0x20000
End address: 0x20ffffff = page frame number 0x20fff
103
Virtualization and Linux on System z Workshop
104
Virtualization and Linux on System z Workshop
1. Logon to maint userid on you z/VM and increase the memory to 1000M
===> define store 1000M
2. Enter the following command to define and save the DCSS
===> defseg linux1 20000-20fff sr
===> saveseg linux1
3. Logon to Linux1, activate the DCSS LINUX1 and make a file system to hold your files.
# modprobe dcssblk segments="LINUX1" <=== activate the LINUX1 DCSS
# echo 0 > /sys/devices/dcssblk/LINUX1/shared <=== don't share it (local)
# mke2fs -b 4096 /dev/dcssblk0 <=== make an ext2 filesystem
4. Create a mount point for the filesystem and mount the file system
# mkdir /xipimage
# mount /dev/dcssblk0 /xipimage -o xip
5. Copy all directories to be shared to the DCSS and save it.
# cp -a /bin /xipimage/bin
# echo 1 > /sys/devices/dcssblk/LINUX1/save
105
Virtualization and Linux on System z Workshop
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,data=ordered 0 0
/dev /dev tmpfs rw 0 0
/proc /proc proc rw 0 0
/sys /sys sysfs rw 0 0
none /selinux selinuxfs rw 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
/etc/auto.misc /misc autofsrw,fd=6,pgrp=1335,timeout=300,minproto=5 ......
/dev/dcssblk0 /xipimage ext2 ro,xip 0 0
/dev/dcssblk0 /bin ext2 ro,xip 0 0
# testxip <==== should find it because the dcss is mounted over /bin
106
Virtualization and Linux on System z Workshop
3. Now that you know that the directories were mounted correctly, we need to change Linux so
that it happens at boot time.
# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit
dc::sysinit:/sbin/xipinit
l0:0:wait:/etc/rc.d/rc 0
...
4. Reboot Linux.
# reboot
5. Once the system is up, we want to check that everything was successful. Verify that the shared
directories are over-mounted.
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,data=ordered 0 0
/dev /dev tmpfs rw 0 0
/proc /proc proc rw 0 0
/sys /sys sysfs rw 0 0
none /selinux selinuxfs rw 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
/dev/dcssblk0 /xipimage ext2 ro,xip 0 0
/dev/dcssblk0 /bin ext2 ro,xip 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
/etc/auto.misc /misc autofs
rw,fd=6,pgrp=1329,timeout=300,minproto=5,maxproto=5 ...
6. Verify that z/VM is using the DCSS by issuing the “q nss map” z/VM command. The command
called “vmcp” allows you to enter CP commands and view the output. Check the #USERS
column; it should be equal to the number of linux guest that your team successfully connected
to your own DCSS.
# modprobe vmcp
# vmcp q nss map
107
Virtualization and Linux on System z Workshop
EW = _________________________________ EN=________________________________
1. Login to MAINT and define the segment starting at 512M + 16M (the size of the previous
DCSS).
===> defseg swapping 21000-21000 ew 21001-283ff en
2. Save the segment.
===> saveseg swapping
3. Logon to your linux guest and enter the following commands
Dynamically adds the segment:
# echo "SWAPPING" > /sys/devices/dcssblk/add
Make a swap file:
108
Virtualization and Linux on System z Workshop
# mkswap /dev/dcssblk1
Setting up swapspace version 1, size = 121630 kB
109
Virtualization and Linux on System z Workshop
while [ -n "$RODIRS" ] ; do
dir="${RODIRS%%,*}"
RODIRS="${RODIRS#*,}"
test -d "$dir" || continue
echo "binding directory" $dir
mount --bind "$ROMOUNT/$dir" "$dir"
done
# turn swap on <=== UNCOMMENT by removing “#”
# swapon /dev/dcssblk1 <=== UNCOMMENT by removing “#”
110
Virtualization and Linux on System z Workshop
111
Virtualization and Linux on System z Workshop
To delete a line, position the cursor in the prefix area (over the numbers) of the line you want to delete
and type a 'd' and <enter>. To delete multiple lines, you type 'dd' on the first and last lines inclusive,
and <enter>.
00000 * * * Top of File * * *
00001
0dd02
00003
00004
00005
00dd6
00007 * * * End of File * * *
The pairs of 'd's show which lines will be deleted; in this case, lines 2-6 will be deleted:
00000 * * * Top of File * * *
00001
00002 * * * End of File * * *
The XEDIT program will renumber the remaining lines.
A useful command to remember when editing is RECOVER . When entered at the command line it
allows you to recover the last set of deleted lines.
Just as with any electronic medium, it is a good idea to SAVE your text on a regular basis. From the
command line, simply type SAVE <enter>. The file will be saved with the same name unless you
specify a different fileid (that is, filename and/or filetype) by entering
SAVE filename filetype
where you specify an alternate filename and/or filetype from the original. You can also copy a line or
lines by typing 'c' (for a single line) or 'cc' (for blocks of text on adjacent lines) and then put an 'f'
preceding where you would like the lines copied, and "enter"ing.
00000 * * * Top of File * * *
00001 Hear the sledges with the bells--
00002 Silver bells!
00003 What a world of merriment their melody foretells!
00004 How they tinkle, tinkle, tinkle,
00005 In the icy air of night!
00006 While the stars that oversprinkle
00007 All the heavens seem to twinkle
00008 With a crystalline delight;
00007 * * * End of File * * *
After you put the pairs of 'cc's on the lines you want to copy, and you have put an 'f' at the line after
which you would like the text inserted, the move operation will be performed when you press the
<enter> key:
00000 * * * Top of File * * *
00001 Hear the sledges with the bells--
00002 Silver bells!
00003 What a world of merriment their melody foretells!
112
Virtualization and Linux on System z Workshop
113
Virtualization and Linux on System z Workshop
Editing commands: They can be preceded by a number of times to repeat the command, i.e. 4dd will
cut 4 lines.
dd cut line (delete)
yy copy line (yank)
114
Virtualization and Linux on System z Workshop
File commands:
:w save file
:w filename save as 'filename'
:q quit
:q! quit without saving
:e file open a file
:r file insert (read) a file
14.3 Books
• Linux in a Nutshell
• Linux for S/390 - Redbook
• zSeries HiperSockets - Redbook
• zSeries Linux Application Development - Redpiece
• ZSeries Linux Systems Management - Redpiece
• Linux for S/390: Device Drivers and Installation Commands
• Linux on IBM eServer zSeries and S/390: VSWITCH and VLAN Features of z/VM 4.4
www.redbooks.ibm.com/redpapers/pdfs/redp3719.pdf
• Getting Started with zSeries Fibre Channel Protocol - Redpaper
• Linux on IBM zSeries and S/390: High Availability for z/VM and Linux - Redpaper
• Linux on IBM zSeries and S/390: Securing Linux for zSeries with a Central z/OS LDAP Server (RACF)
-Redpaper
• Porting UNIX Applications to Linux - Hints and Tips (
ibm.com/servers/eserver/zseries/library/techpapers/pdf/gm130115.pdf)
• Linux for S/390 and zSeries porting hints and tips (
ibm.com/servers/esdd/articles/linux_s390/index.html)
115
Virtualization and Linux on System z Workshop
• linux.com
• linux.s390.org
• oss.software.ibm.com/developerworks/opensource/linux390
116