Ibm ZVM FOR LINUX V6 RELEASE 1 User Manual

z/VM

Getting Started with Linux on System z
version6release1
SC24-6194-00
z/VM

Getting Started with Linux on System z
version6release1
SC24-6194-00
Note:
Before using this information and the product it supports, read the information under “Notices” on page 143.
This edition applies to version 6, release 1, modification 0 of IBM z/VM, (product number 5741-A07) and to all subsequent releases and modifications until otherwise indicated in new editions.
This edition replaces SC24-6096-03.
© Copyright International Business Machines Corporation 2009.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Contents

About this document .........v
Intended audience ............v
Conventions and terminology used in this document v
Where to find more information .......vi
Additional Publications .........vi
How to send your comments to IBM . . ix
If you have a technical problem........ix
Summary of changes.........xi
SC24-6194-00, z/VM Version 6 Release 1 .....xi
Chapter 1. About z/VM ........1
Overview of the Control Program (CP) .....3
Central processing units (CPUs) .......3
Storage ...............3
DASD and minidisks ..........4
Temporary minidisks ..........4
Virtual disks in storage ..........4
Virtual readers, punches, and printers .....4
The virtual machine console ........4
Overview of the CP spool file system .....7
The user directory ...........8
Overview of the Conversational Monitor System
(CMS) ................9
Minidisks and the CMS access mode .....9
CMS files ..............11
The PROFILE EXEC ..........12
The Help system ...........13
The CMS file editor XEDIT .........15
Input mode .............17
Overview of changing files ........18
SAVE, FILE, QUIT, and QQUIT.......19
Summary of Linux and z/VM similarities ....20
Chapter 2. Planning for Linux virtual
servers ..............21
Overview of z/VM capacity planning .....22
Estimating memory and CPU requirements....25
Overview of estimating memory and CPU
requirements .............25
Steps for estimating memory and CPU
requirements .............27
Guidelines for estimating the amount of DASD you
need.................28
For z/VM paging ...........28
For the Linux file system .........29
Planning your network ..........30
TCP/IP networking options for Linux ....30
Giving Linux virtual servers access to
cryptographic hardware for SSL acceleration . . 31
Planning for user management ........32
Steps for obtaining documentation and media . . . 34
Chapter 3. Changing the system
configuration ............35
Overview of the SYSTEM CONFIG file .....35
Steps for adding a paging, spooling, or user volume 35
Steps for releasing the primary parm disk ....37
Steps for updating the CP-owned volume list . . . 37 Steps for updating the default system identifier . . 39
Steps for updating the user volume list .....40
Steps for setting up warm start, clearing tdisk space,
and other features ............41
Steps for controlling access to devices at startup . . 43
Steps for defining a virtual switch .......44
Steps for setting addresses for consoles .....46
Steps for updating special escape character defaults 47 Steps for checking the syntax of the SYSTEM
CONFIG file ..............48
Steps for restoring CP’s access to the primary parm
disk .................49
Chapter 4. Configuring the Directory
Maintenance Facility .........51
Steps for enabling DirMaint .........51
Steps for changing the passwords for DirMaint
service machines ............52
Steps for configuring DirMaint ........53
Steps for authorizing users to perform DirMaint
tasks.................54
Steps for controlling where DirMaint creates
minidisks ...............55
Steps for copying the current USER DIRECT file . . 57 Steps for putting the configuration into production
and starting DirMaint ...........58
Steps for automatically starting DIRMAINT . . . 59
Steps for testing DirMaint .........60
Step for modifying the OPERATOR’s directory entry 60
Chapter 5. Configuring TCP/IP ....63
Setting up the production TCP/IP .......63
Steps for automatically starting TCP/IP .....63
Chapter 6. Restarting z/VM and
checking the system.........67
Steps for restarting z/VM .........67
Steps for checking paging and spooling space . . . 67
Step for checking the system identifier .....68
Step for checking the user volume list .....68
Steps for checking features .........69
Step for checking offline devices .......69
Step for checking the virtual switch ......69
Step for checking character defaults ......70
Steps for checking TCP/IP .........70
Chapter 7. Creating your first Linux virtual machine and installing Linux . . 71
© Copyright IBM Corp. 2009 iii
Overview of defining virtual machines for Linux . . 71 Steps for defining a master virtual machine for
Linux ................71
Steps for setting up LINMSTR’s disks .....75
Installing Linux in a virtual machine ......77
Overview of installing Linux in a virtual machine 77 Example of using FTP to get the Linux boot files 79 Example of punching Linux boot files to the
virtual machine reader..........80
Example of booting (IPL) the Linux boot files
from the virtual machine reader ......81
(Optional) Steps for loading Linux automatically at
logon ................82
Steps for taking a snapshot of system performance 120 Using the CP Monitor and Performance Toolkit for
VM.................123
Overview of the CP Monitor and Performance
Toolkit for VM ............123
Configuring Performance Toolkit for VM . . . 124 Using monitoring to analyze performance and
capacity ..............133
Steps for using CP commands to improve
performance..............135
Chapter 12. Servicing z/VM .....137
z/VM service concepts ..........137
Chapter 8. Cloning Linux virtual
servers ..............83
Steps for cloning a Linux virtual server .....83
Chapter 9. Setting up basic system
automation .............85
Starting and stopping virtual machines
automatically ..............85
Steps for automatically starting Linux virtual
servers and other virtual machines .....85
Steps for enabling Linux virtual servers to shut
down automatically ..........87
Setting up the programmable operator .....88
Overview of the programmable operator . . . 88
Steps for setting up the routing table .....89
Steps for setting up the programmable operator 92 Steps for automating Linux virtual consoles . . 93
Steps for testing your automation ......95
Chapter 10. Performing run-time tasks 97
Overview of console types .........97
Real operation tasks ...........98
Step for monitoring the logical operator console 98
Step for restarting z/VM ........100
Step for managing real devices ......100
Step for managing users.........105
Virtual machine operation tasks .......107
Steps for using CP commands at the Linux
virtual console ............108
Archiving and backing up critical data .....112
Overview of archiving z/VM system data . . . 112
Archiving virtual server disks .......113
Chapter 11. Monitoring performance
and capacity ............117
Overview of performance monitoring .....117
Monitoring Linux virtual servers with
Performance Toolkit for VM .......118
Overview of the z/VM scheduler......118
Appendix. Example of using FTP to install Linux from the hardware
management console ........139
Linking the HMC removable media to your z/VM
logical partition ............139
FTPing to the HMC removable media .....140
Notices ..............143
Trademarks ..............145
Glossary .............147
Bibliography............149
Where to Get z/VM Information .......149
z/VM Base Library ...........149
Overview..............149
Installation, Migration, and Service .....149
Planning and Administration .......149
Customization and Tuning ........149
Operation and Use ..........149
Application Programming ........149
Diagnosis..............150
z/VM Facilities and Features ........150
Data Facility Storage Management Subsystem
forVM..............150
Directory Maintenance Facility for z/VM . . . 150
Open Systems Adapter/Support Facility . . . 150
Performance Toolkit for VM .......151
RACF Security Server for z/VM ......151
Remote Spooling Communications Subsystem
Networking for z/VM .........151
Prerequisite Products ...........151
Device Support Facilities ........151
Environmental Record Editing and Printing
Program ..............151
Additional Publications ..........151
Index ...............153
iv
z/VM: Getting Started with Linux on System z

About this document

This document describes how to configure and use z/VM®functions and facilities for Linux®servers running on the IBM®System z®platform (hereafter referred to as the mainframe). The document provides requirements and guidelines to implement during z/VM installation, but primarily assumes you have installed z/VM and are ready to deploy Linux in virtual machines.
Early sections acquaint you with z/VM and take you from the point after z/VM installation to the point where you are ready to install your first Linux server. At that point you must turn to the installation documentation provided by your Linux distributor. Following the deployment of your first Linux server, you can replicate or clone additional servers.
When you finish the early sections, you will have two or more Linux servers running on z/VM with TCP/IP connections to the network. Subsequently, you can turn to vendor-supplied documentation to install applications on Linux. Later sections cover operations, administration, performance, and other day-to-day bare essentials.

Intended audience

This document is designed to help anyone who does system programming, administration, or operation, but has limited knowledge of z/VM and wants to get started deploying Linux servers on z/VM. Before you begin, you must:
v Understand mainframe hardware concepts, such as logical partitions (LPARs)
and I/O
v Know and have used the Linux operating system
v Know and have used TCP/IP.
The environment for your z/VM system environment is assumed to include:
v A mainframe with an OSA-Express device
v z/VM version 6 release 1
v Directory Maintenance Facility
v Performance Toolkit for VM
v If you do not have an external file server for the Linux code, you might need an
NFS or FTP server.

Conventions and terminology used in this document

This document is primarily a cookbook; that is, it provides instructions about how to accomplish a task or goal. When required, background concepts are provided to help you understand a key z/VM function or facility. Instructions and background concepts are separated but linked together through cross-references, providing an efficient path through the instructional material. At the beginning of each set of instructions, you will see a Before you begin section, which explains what you need to know or to do before you perform the task. Cross-references in the Before you begin section take you to the necessary background concepts. Thus, if you already know the necessary concepts, you do not need to read those background topics and can simply follow the instructions.
© Copyright IBM Corp. 2009 v
Though the topics in this document are self-sufficient, you might want to explore a function or facility in detail. Some topics end with a list of documents that you can use to understand a function or facility in detail.
In general, new terms (in italics) are defined in the context they are introduced.
Sometimes the manual focuses on the virtual machine functions (the virtual hardware) and other times the complete Linux server system (the virtual machine and the Linux operating system as a whole). When focusing on the virtual machine functions only, the term virtual machine or virtual machine for Linux is used. The term Linux virtual server refers to the complete Linux system (virtual machine hardware and the Linux operating system as a whole) running on z/VM.
Commands and statements that you must type are in bold while system responses are in normal font.
Example: In the example, you would type “query processors”. The rest of the example is the system response:
query processors
PROCESSOR 00 MASTER PROCESSOR 01 ALTERNATIVE Ready;
Variable information appears in bold italics, which means you must substitute your own values for the variable.
Example: For the command, you would need to supply your own password for the variable new_password.
dirm add linmstr like linux pw new_password
A vertical ellipsis
. . .
indicates system responses that have been removed for clarity.

Where to find more information

For z/VM terms used in this document, see z/VM: Glossary or use the z/VM HELP Facility (for more information about glossary terms and the z/VM HELP Facility, see “Glossary” on page 147).
For more information about related publications, see “Bibliography” on page 149.

Additional Publications

For white papers, IBM Redbooks®publications, and other useful information about Linux on the mainframe, visit the z/VM resources for Linux on IBM System z Web site at:
http://www.vm.ibm.com/linux/
Publications you might be interested in are:
vi z/VM: Getting Started with Linux on System z
v z/VM and Linux on IBM System z: The Virtualization Cookbook for SLES9, SG24-6695
v Security on z/VM, SG24-7471
Links to Other Online Documents
If you are viewing the Adobe®Portable Document Format (PDF) version of this document, it might contain links to other documents. A link to another document is based on the name of the requested PDF file. The name of the PDF file for an IBM document is unique and identifies the edition. The links provided in this document are for the editions (PDF names) that were current when the PDF file for this document was generated. However, newer editions of some documents (with different PDF names) might exist. A link from this document to another document works only when both documents reside in the same directory.
About this document vii
viii z/VM: Getting Started with Linux on System z

How to send your comments to IBM

We appreciate your input on this publication. Feel free to comment on the clarity, accuracy, and completeness of the information or give us any other feedback that you might have.
Use one of the following methods to send us your comments:
1. Send an e-mail to mhvrcfs@us.ibm.com
2. Visit the z/VM reader's comments Web page at www.ibm.com/systems/z/os/
zvm/zvmforms/webqs.html
3. Mail the comments to the following address:
IBM Corporation Attention: MHVRCFS Reader Comments Department H6MA, Mail Station P181 2455 South Road Poughkeepsie, NY 12601-5400 U.S.A.
4. Fax the comments to us as follows:
From the United States and Canada: 1+845+432-9405 From all other countries: Your international access code +1+845+432-9405
Include the following information:
v Your name and address v Your e-mail address v Your telephone or fax number v The publication title and order number:
z/VM V6R1 Getting Started with Linux on System z SC24-6194-00
v The topic and page number related to your comment v The text of your comment
When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you.
IBM or any other organizations will only use the personal information that you supply to contact you about the issues that you submit to IBM.

If you have a technical problem

Do not use the feedback methods listed above. Instead, do one of the following:
v Contact your IBM service representative.
v Contact IBM technical support.
v Visit the z/VM support Web page at www.vm.ibm.com/service/
v Visit the IBM mainframes support Web page at www.ibm.com/systems/
support/z/
© Copyright IBM Corp. 2009 ix
x z/VM: Getting Started with Linux on System z

Summary of changes

This document contains terminology, maintenance, and editorial changes. Technical changes or additions to the text and illustrations are indicated by a vertical line to the left of the changes. Some program updates might be provided through z/VM service by program temporary fixes (PTFs) for authorized program analysis reports (APARs), which also might be available for some prior releases.

SC24-6194-00, z/VM Version 6 Release 1

This edition supports the general availability of z/VM V6.1. Changes made are:
v A step was added to “Steps for copying the current USER DIRECT file” on page
57.
v Other minor technical and editorial changes.
© Copyright IBM Corp. 2009 xi
xii z/VM: Getting Started with Linux on System z

Chapter 1. About z/VM

This topic is a z/VM primer and covers general VM concepts, such as editing and finding files, required to complete z/VM system tasks.
When you log onto z/VM, you have the functional equivalent of a real computer and its associated devices at your fingertips. This functional equivalent of a computing system is called a virtual machine. Virtual machines are not real, but do work like real systems. Everyone in your entire organization can use z/VM to share the resources of a single computer, while at the same time accessing the system as if each is the only user.
Figure 1 shows a stylized representation of a real mainframe computing system. Each real computing system has one or more central processing units (CPUs), storage (memory), peripheral devices for input and output, such as disks, tapes, printers, and displays, and the operator console. The operating system manages all these resources to do work.
CPU
0
CPU
1
CPU
2
. . .
CPU
n
central storage
operator console
operating system
channels
control units
disk
tape printer
user displays
Figure 1. Representation of a mainframe computing system
z/VM virtualizes real computing resources so that each user appears to have a complete mainframe computing system, as shown in Figure 2 on page 2. This means each virtual machine can run its own operating system to manage its virtual resources. It also means you can perform virtual machine tasks as if they were real machine tasks: you can boot (perform an initial program load of) an operating system, attach and detach devices, and manage the work of your virtual machine operating system.
© Copyright IBM Corp. 2009 1
channels
control units
CPU
0
CPU
1
CPU
2
. . .
CPU
n
Linux
. . .
Linux
. . .
Linux
. . .
CMS
. . .
Linux (other)
. . .
. . .
z/VM
z/VM operator console
disk printer
Figure 2. Representation of virtual machines
A virtual machine is directly associated with a z/VM user ID or logon identifier. When you log onto z/VM, you have a virtual machine at your disposal and control the virtual machine the way a system operator controls the real hardware.
Some user IDs (virtual machines) are given special privileges to control z/VM and the real machine. For example, the OPERATOR has special privileges allowing control of real machine resources. Another user, usually called MAINT, has special privileges to change z/VM code, apply z/VM maintenance, and add new users. Whether or not users have special privileges, they all perform their tasks through a virtual machine. So, as shown in Figure 2, some virtual machines run Linux, while others run other operating systems, such as the Conversational Monitor System (CMS) (more about CMS in a moment).
The Control Program (CP) is the component of z/VM that manages the resources of a single computer so that multiple computing systems (virtual machines) appear to exist. Think of CP as a supervisor (or hypervisor) program running in a layer between the hardware and virtual machines. When you are working in the CP environment, you are provided with CPU (central processing unit) functions, input and output devices, and storage. Through CP, each virtual machine can run its own operating system, such as Linux, z/OS
tape
®
, or z/VM itself.
Operating systems running in virtual machines are often called guests. Other terms and phrases you might encounter are:
2 z/VM: Getting Started with Linux on System z
v Running first level: running directly on the hardware, which is what z/VM does.
v Running second level or running under VM or running on (top of) VM: running as a
guest.
During its time slice, a guest actually runs on the real machine. The hardware microcode handles most guest program instructions and CP takes control only when necessary, which maintains good performance.
The Conversational Monitor System (CMS) is the interactive component of z/VM. CMS is a single-user operating system that runs in a virtual machine. Typically, each directory entry (user definition) has a statement that loads the CMS operating system at logon time (see “The user directory” on page 8). CMS is not only an end-user interactive component, but a home for running system utilities and tasks, such as TCP/IP and system management functions. At the z/VM level, systems personnel use CMS to manage z/VM itself and guests. At the guest level, you can use CMS to define resources for your virtual machine, so loading CMS is useful even if you plan subsequently to load Linux into the same virtual machine.

Overview of the Control Program (CP)

CP acts as a hypervisor layer between the hardware and virtual machines. Each virtual machine appears to have its own CPU, storage (memory), and devices. In reality, these items can be
v Real. For example, you can dedicate a real network interface to a virtual
machine for its exclusive use.
v Shared. For example, the CPU is shared through time sharing and real storage is
shared as virtual storage. What appears as real storage to a guest is actually virtual storage to CP.
v Simulated. For example, a virtual switch is a simulated LAN networking switch.
CP transparently maps virtual devices and resources to their real counterparts. Topics in this section explain how CP manages computer resources for virtual machines.

Central processing units (CPUs)

A virtual machine can have up to 64 virtual CPUs. If capable of running in multiprocessor mode, your virtual machine operating system dispatches work on its virtual CPUs as if it were running on real hardware. CP handles the dispatching of work on your virtual CPUs to real CPUs.
Guideline: Never give a virtual machine more virtual CPUs than there are real CPUs.
Usually virtual machines share all CPUs, but a real CPU can be dedicated to a virtual machine, which means that the CPU is reserved for that virtual machine’s exclusive use. This obviously has an impact on the performance of other virtual machines in the system.

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.
Chapter 1. About z/VM 3
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 mapsa1MBsegment of virtual storage to the same 1 MB of real storage.

DASD and minidisks

DASD, the mainframe term for disk drives, stands for “direct access storage device” and is analogous to a hard disk drive on a personal computer. A single real DASD is called a volume or real volume. Each volume has a label or volume serial number (volser) that identifies the volume to z/VM.
Of special importance is the way z/VM shares DASD. CP can logically partition real DASD volumes into minidisks, which is analogous to dividing a personal computer hard disk into multiple partitions. A minidisk has its own label, which is distinct from the real DASD label. Each virtual machine can have one or more minidisks and those minidisks are under control of the guest operating system. To the guest, a minidisk appears as an entire DASD volume (though smaller) and the guest runs channel programs as normal to do I/O. Behind the scenes, CP reorients the channel programs: the guest perceives all minidisks as starting at cylinder 0, but the real DASD volume has only one cylinder 0, so CP must modify the cylinder offsets in the channel program to address DASD cylinders owned by the guest.

Temporary minidisks

You can create a temporary minidisk from a special pool of real disks. The disk lasts as long as the virtual machine is logged on. At logoff, the temporary minidisk is deleted and the space returned to the available temporary disk pool.

Virtual disks in storage

Virtual disks in storage are similar to temporary minidisks, except the disks are mapped to storage rather than the cylinders of real disks. Using virtual disks in storage avoids the need for disk I/O. CP manages the virtual disk pages as part of its real memory management.

Virtual readers, punches, and printers

These devices are not associated with real devices, but are implemented through the spool file system. For more information, see “Overview of the CP spool file system” on page 7.

The virtual machine console

The virtual machine console or virtual console is the primary interface to the virtual machine. When you log on to a virtual machine from a local terminal or a remote workstation, the virtual console is associated with the terminal session. From the
4 z/VM: Getting Started with Linux on System z
console, you can enter CP commands, such as loading (IPL) an operating system. The virtual console is the device an operating system views as its system or hardware console.
Note: The key assignments for your keyboard might differ from standard key
assignments. Some 3270 emulators allow you to remap the key assignments; for example, the Clear function might be assigned to the ESC key on some keyboards and the Pause/Break key on others. Consult your display documentation for key mappings.
As you do work on your console, the lower right corner of the screen displays various status notices. The notices tell you what is happening in the system at the present time. If you forget what these notices mean, you can come back to this section for reference.
CP READ
This notice means that the Control Program (CP) is waiting for you to enter a command.
VM READ
This notice means that a virtual machine operating system, such as CMS, is waiting for you to enter a command.
RUNNING
This notice means the virtual machine is working on something. For CMS, this means CMS is ready for you to enter a command.
MORE ...
This notice means that there is more information than can fit on the current screen. After a pause (which depends on the terminal settings for your virtual machine), the next screen of information is displayed. To view the next screen right away, press the Clear key. To hold this information on the screen, press the Enter key, which changes MORE... to HOLDING.
HOLDING
This notice means the system is waiting for you to clear the screen before showing you more information. The notice appears when the screen displays MORE... and you press the Enter key. The notice can also appear when another user sends you a message. To cancel the hold, press the Clear key.
NOT ACCEPTED
This notice means that the system is working on something and is too busy to accept another command. Wait several seconds and issue your command again.
Related information
For more information about virtual consoles, see “Using a Virtual Machine Operator’s Console” in z/VM: Virtual Machine Operation.
CP commands
CP provides you with commands that allow you to view and manipulate your virtual hardware (virtual CPUs, virtual storage, minidisks, and other devices). To issue some CP commands, you need to be in a special privilege class assigned to you in the user directory. Privilege classes are denoted by the letters A through Z, the numbers 1 through 6, or the word Any.For the tasks explained in this document, the user IDs you use have all the required privilege classes (like superusers in Linux).
Chapter 1. About z/VM 5
Related information
For more information about privilege classes, see “Privilege Classes” in z/VM: CP Commands and Utilities Reference.
Examples of using the CP commands: QUERY displays information about your virtual machine.
1. To display virtual CPUs, class G users can issue the QUERY VIRTUAL CPUS
command:
query virtual cpus
CPU 00 ID FF05152120640000 (BASE) Ready;
The response tells you the virtual machine has one base virtual CPU whose address is 00.
2. To display available storage (memory), class G users can issue the QUERY
STORAGE command:
query virtual storage
STORAGE = 512M Ready;
The response tells you the virtual machine has 512 megabytes of storage.
3. To display information about minidisks, class G users can issue the QUERY
VIRTUAL DASD command:
query virtual dasd
DASD 0120 3390 PK5001 R/O 250 CYL ON DASD 810B SUBCHANNEL = 000D DASD 0190 3390 SYGEMC R/O 130 CYL ON DASD 7355 SUBCHANNEL = 0005 DASD 0191 3390 USGE24 R/W 10 CYL ON DASD 7378 SUBCHANNEL = 0000 DASD 019A 3390 PK5001 R/O 400 CYL ON DASD 810B SUBCHANNEL = 0009 DASD 019D 3390 US7E0K R/O 250 CYL ON DASD 801C SUBCHANNEL = 0006
The response tells you the virtual machine has 5 minidisks, one of which is read/write (R/W); the others are read only (R/O).
4. To display information about network devices such as the Open Systems
Adapter, class G users can issue the QUERY VIRTUAL OSA command:
query virtual osa
OSA F5F0 ON OSA F599 SUBCHANNEL = 0000
F5F0 DEVTYPE OSA CHPID 76 OSD F5F0 QDIO-ELIGIBLE QIOASSIST-ELIGIBLE
OSA F5F1 ON OSA F59A SUBCHANNEL = 0001
F5F1 DEVTYPE OSA CHPID 76 OSD F5F1 QDIO-ELIGIBLE QIOASSIST-ELIGIBLE
OSA F5F2 ON OSA F59B SUBCHANNEL = 0002
F5F2 DEVTYPE OSA CHPID 76 OSD F5F2 QDIO-ELIGIBLE QIOASSIST-ELIGIBLE
5. To display the size of real storage, class B and E users can issue the QUERY
STORAGE command:
query storage
STORAGE = 512M
Note: QUERY VIRTUAL option displays information about the virtual machine.
The keyword “VIRTUAL” is optional for the class G user. For privileged
6 z/VM: Getting Started with Linux on System z
users (those with privilege classes other than G), using QUERY without the keyword “VIRTUAL” displays information about the real machine. For instance, QUERY VIRTUAL STORAGE displays the virtual storage size of the virtual machine while QUERY STORAGE (class B and E) displays the real machine storage size.
Related information
z/VM: CP Commands and Utilities Reference, SC24-6175

Overview of the CP spool file system

In the early days of computing, input to the computer came from punched cards loaded into a card reader. You used a key punch to record your program on punched cards, then loaded the cards into a card reader, which interpreted your cards and loaded your program into the computer. Output from the program was written to a printer. z/VM preserves this bit of computing history through virtual reader, punch, and printer devices, also called unit record devices. Unit record devices provide a handy way to send files from one virtual device to another, to other virtual machines, or to real devices (such as real printers). For instance, you can think of a file being sent from one virtual machine to another as the virtual equivalent of taking a card stack from one computer and loading the stack onto another computer’s card reader.
Behind the manipulation of these files is a CP file system called the spool file system. CP manages spool files on one or more DASD volumes that act as temporary storage areas. A spool file is a collection of data along with device control instructions for processing on a unit record device. Spooling is the processing of files created by or intended for virtual readers, punches, and printers. Through CP and CMS commands, you can send spool files from one virtual device to another, from your virtual machine to another, and to real devices.
By convention, each virtual machine has a virtual reader at virtual device number 00C, a virtual punch at virtual device number 00D, and a virtual printer at virtual device number 00E. Your virtual reader is like the in-box of an e-mail system, except more than just e-mail can be placed there. Through your virtual punch, you can place a copy of an entire operating system into the system spool, then use the CP IPL command to load and run that operating system in your virtual machine. “Installing Linux in a virtual machine” on page 77 shows you how to use this z/VM facility.
Some important commands that operate on spool files are:
v SPOOL. Use the CP SPOOL command to set control options for one or more of
your virtual spool devices. A handy way to keep a log of your system activity is to spool your console (SPOOL CONSOLE *, meaning send the console log to yourself), which keeps all your console activity in a spool file. When you close your console (SPOOL CONSOLE STOP CLOSE), your console log is sent to you.
v QUERY READER ALL. This CP command lets you view information about spool
files in your virtual reader.
v RDRLIST. This CMS command displays information about your reader files in a
full-screen interactive display.
v RECEIVE. This CMS command moves a file from your reader onto a minidisk.
v PUNCH. This CMS command punches (copies) a CMS file to your virtual
punch.
Chapter 1. About z/VM 7
Related information
For information about managing spool files for the entire z/VM system, start with the summary topics on controlling spool files in z/VM: System Operation, SC24-6233:
v Control Spool Files in the Print Queue
v Control Spool Files in the Reader Queue
v Control Spool Files in the Punch Queue
For information about managing spool files for your virtual machine, see “Using Spooled Devices to Print, Punch, and Read Information,” in z/VM: Virtual Machine Operation, SC24-6241.
For command help, see z/VM: CP Commands and Utilities Reference, SC24-6175, and z/VM: CMS Commands and Utilities Reference, SC24-6166.
For online help, type help on the CMS command line, then press the Enter key.

The user directory

The z/VM user directory (or user registry) describes the configuration and operating characteristics of each virtual machine that can be created by CP. A z/VM user directory exists in two forms: a source form that consists of one or more CMS files, and an object form, compiled from the source, on a CP-formatted disk.
Each virtual machine has a directory entry. Here is a sample directory entry. The callouts in reverse type next to each statement correspond to explanations that follow the sample.
Note: In this document the user directory is modified by using the IBM Directory
Maintenance program, DirMaint
, which handles both source and object forms of the user directory. Information about the directory entries is shown for educational purposes only. Unless explicitly instructed to do so, do not attempt to update the user directory source files manually.
1 USER LINUXC MYPASS 256M 1G G 2 IPL CMS 3 MACHINE ESA 4 4 CONSOLE 0009 3215 5 NICDEF BC0 TYPE QDIO LAN SYSTEM VSWITCH1 6 SPOOL 000C 3505 A
SPOOL 000D 3525 A SPOOL 000E 1403 A
7 LINK MAINT 0190 0190 RR
...
8 MDISK 0191 3390 1595 50 VMLU1A MR
MDISK 0200 3390 0001 3338 LX1519 MR MDISK 0201 3390 0001 3338 LX1559 MR MDISK 0202 3390 0001 3338 LX1599 MR
1. The USER statement begins a directory entry. The user ID for this virtual
machine is LINUXC. “MYPASS” is the user’s logon password. The virtual machine has a default storage of 256 megabytes (“256M”), but you can redefine storage up to a maximum of 1 gigabyte (“1G”). The second “G” means the virtual machine user is a general class user and can control functions for this virtual machine only.
2. The IPL statement indicates which operating system to load when you log on
to the virtual machine. The example shows that CMS will be loaded. Loading CMS is handy because it allows you to make changes to the normal
8 z/VM: Getting Started with Linux on System z
environment as well as run some REXX™EXECs (script-like executable files) to set up Linux. After changing the environment, you can load Linux into the virtual machine.
3. The MACHINE statement describes the processor architecture of the virtual
machine. The maximum number of virtual CPUs that can be defined for this virtual machine is four. The default is one.
4. The CONSOLE statement defines the operating console (virtual console) for the
virtual machine. CMS requires console type 3215. If supported by the operating system, you can specify 3270 or issue the CP command TERMINAL CONSOLE 3270 in the PROFILE EXEC prior to loading the operating system.
5. The NICDEF statement defines this virtual machine’s attachment to a z/VM
virtual switch.
6. SPOOL statements define the unit record devices. By convention, device
number 000C is for the virtual reader (type 3505), device number 000D is for the virtual punch (type 3525), and device number 000E is for the virtual printer (type 1403).
7. LINK statements provide access to another virtual machine’s minidisks.
8. MDISK statements define minidisks owned by the virtual machine. The format
of the statement is:
MDISK devno type start_cyl extent vol_label access_mode
where
devno
Is the virtual device number of the minidisk.
type
Is the disk type of the real disk; typically 3390.
start_cyl
Is the real disk starting location of the first cylinder of the minidisk.
extent
Is the minidisk size in cylinders.
vol_label
Is the volume label of the real disk.
access_mode
Is the access mode. MR means the virtual machine has read/write access.
Related information
“Creating and Updating a User Directory,” in z/VM: CP Planning and Administration, SC24-6178

Overview of the Conversational Monitor System (CMS)

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.

Minidisks and the CMS access mode

CMS, like other operating systems running in a virtual machine, can access minidisks to store and retrieve files. For CMS, each minidisk has an access mode
Chapter 1. About z/VM 9
represented by an alphabetic letter that determines how CMS searches for files. In Linux, path variables defining directories determine the search order for files. CMS searches for files among minidisks based on the alphabetical order of the access mode. First, CMS looks on the A minidisk, then the B minidisk, and so forth.
The 191 minidisk holds a special place in CMS. A 191 minidisk to a CMS user is like the home file directory for a Linux user. CMS always tries to access a user’s 191 minidisk as access mode A. The CMS 191 minidisk is often called the “A-disk.”
To see your CMS minidisks and their access modes, use the QUERY ACCESSED command. QUERY ACCESSED is similar to the df command in Linux. To access minidisks that are not already in the CMS access order, use the ACCESS command.
Example of viewing and accessing CMS minidisks
1. To view your accessed CMS minidisks, type the QUERY ACCESSED command
and press the Enter key:
Ready;
query accessed
Mode Stat Files Vdev Label/Directory A R/W 595 191 CHA191 E R/O 1776 201 IDTOOL S R/O 690 190 CMS21 Ready;
The column under “Mode” shows the access mode for each minidisk. In the example, there are three minidisks accessed as A, E, and S.
Notice that while in CMS all commands end with a “Ready;” prompt, indicating that CMS is ready to do more work.
2. To assign an access mode, use the ACCESS command. Example: To access the
minidisk at virtual address 491 as B, type this command and press the Enter key:
Ready;
access 491 b
DMSACP723I B (491) R/O Ready;
The response tells you minidisk 491 is accessed read only (R/O) as B.
3. If you assign a mode currently assigned to another minidisk, the new minidisk
replaces the current minidisk:
Ready;
access 19d d
DMSACC724I 19D replaces D (200) DMSACP723I D (19D) R/O Ready;
4. To remove a minidisk from an access mode, use the RELEASE command:
Ready;
release b
Ready;
10 z/VM: Getting Started with Linux on System z

CMS files

CMS files have a file name, file type, and file mode. File names and file types can be up to 8 characters long. The file mode corresponds to the access mode of the minidisk.
Examples:
PROFILE EXEC A1 MYDOC LISTING A1 DNFPFS LISTPS B1
By convention, some file types have special meanings. For example, EXEC is the file type for a file that contains executable statements, LISTING is the file type for text files, and LISTPS is the file type for PostScript
To view and manipulate files, use the FILELIST command. FILELIST is similar to the dir command in Linux.
Examples of using FILELIST
1. To view all the files on your A-disk, type this command and press the Enter
key:
filelist
Result: You see something like this:
®
files.
CHASTING FILELIST A0 V 169 Trunc=169 Size=253 Line=1 Col=1 Alt=0
Cmd Filename Filetype Fm Format Lrecl Records Blocks Date Time
CHASTING NETLOG A0 V 108 2132 53 10/15/03 16:02:30 KIJL0CMD HGENRPT A1 V 119 13 1 10/13/03 12:00:40 KIJL0CMD LOG A1 V 122 131 2 10/13/03 12:00:37 KIJL0CMD SCRIPT A1 V 81 454 4 10/13/03 12:00:37 REXEC HELPTCPI A1 V 79 133 2 10/13/03 10:26:11 NETSTAT HELPTCPI A1 V 79 749 9 10/13/03 10:25:31
2. In the “Cmd” column, you can type commands that are issued against the file
on that line.
Example: To edit a file in the filelist, type the XEDIT command in the “Cmd” column:
CHASTING FILELIST A0 V 169 Trunc=169 Size=253 Line=1 Col=1 Alt=0 Cmd Filename Filetype Fm Format Lrecl Records Blocks Date Time xedit CHASTING NETLOG A0 V 108 2132 53 10/15/03 16:02:30
KIJL0CMD HGENRPT A1 V 119 13 1 10/13/03 12:00:40 KIJL0CMD LOG A1 V 122 131 2 10/13/03 12:00:37 KIJL0CMD SCRIPT A1 V 81 454 4 10/13/03 12:00:37 REXEC HELPTCPI A1 V 79 133 2 10/13/03 10:26:11 NETSTAT HELPTCPI A1 V 79 749 9 10/13/03 10:25:31
3. Use “/” and “=” to avoid extra typing when you enter a command in
FILELIST. The “/” means “this file” and “=” can be used to repeat a file name, file type, or file mode.
Example: To copy a file called REXEC HELPTCPI from minidisk A to minidisk D, type this command and press the Enter key (typing over the other columns is OK):
Chapter 1. About z/VM 11
CHASTING FILELIST A0 V 169 Trunc=169 Size=253 Line=1 Col=1 Alt=0
Cmd Filename Filetype Fm Format Lrecl Records Blocks Date Time
CHASTING NETLOG A0 V 108 2132 53 10/15/03 16:02:30 KIJL0CMD HGENRPT A1 V 119 13 1 10/13/03 12:00:40 KIJL0CMD LOG A1 V 122 131 2 10/13/03 12:00:37 KIJL0CMD SCRIPT A1 V 81 454 4 10/13/03 12:00:37
copy/==d HELPTCPI A1 V 79 133 2 10/13/03 10:26:11
NETSTAT HELPTCPI A1 V 79 749 9 10/13/03 10:25:31
4. To see only certain files, use “*” as a wildcard character.
Example: To find any file on any accessed disk with a file type SCRIPT, type this command and press the Enter key:
filelist * script *
Result: You see something like this:
CHASTING FILELIST A0 V 169 Trunc=169 Size=555 Line=32 Col=1 Alt=0
Cmd Filename Filetype Fm Format Lrecl Records Blocks Date Time
APLANBD SCRIPT A1 V 65 20 1 7/16/02 12:31:01 APROGBD SCRIPT A1 V 80 213 3 7/16/02 12:30:05 B2HSYS SCRIPT Q1 V 113 4910 45 6/17/02 10:42:25 B2HMSG SCRIPT Q1 V 76 670 7 6/17/02 10:42:04 B2H SCRIPT Q1 V 72 107 1 5/20/02 0:47:02 B2HAPP SCRIPT Q1 V 86 3129 25 5/20/02 0:47:02 B2HEXA SCRIPT Q1 V 93 1390 10 5/20/02 0:47:02 B2HINF SCRIPT Q1 V 81 1389 14 5/20/02 0:47:02 B2HSETUP SCRIPT Q1 V 70 175 2 5/20/02 0:47:02 B2HUSE SCRIPT Q1 V 89 2622 25 5/20/02 0:47:02 ACRONYMS SCRIPT V1 V 962 62886 769 4/05/01 16:27:39 VMSERVE SCRIPT V1 V 103 3180 31 1/24/01 8:48:49

The PROFILE EXEC

The PROFILE EXEC is a special executable file analogous to the .profile (or .bash_profile) in Linux and UNIX. Every time a CMS user logs on, CMS runs the PROFILE EXEC residing on the 191 minidisk, file mode A. You can use the PROFILE EXEC to set up your virtual machine environment; for instance, access disks, set up special PF keys, or even load another operating system in your virtual machine. In Chapter 7, “Creating your first Linux virtual machine and installing Linux,” on page 71, you learn how to set up a PROFILE EXEC for your Linux virtual servers.
There can be times when you do not want the PROFILE EXEC to execute when you log on. For example, assume your PROFILE EXEC automatically loads Linux. If you have just shut down Linux and want to start CMS, but prevent Linux from being loaded again, you can prevent CMS from executing the PROFILE EXEC by issuing access (noprof. When you IPL (load) CMS, you see an identifier line displayed and CMS pauses with VM READ in the lower right corner of the display. At that point you can issue access (noprof:
12 z/VM: Getting Started with Linux on System z
IPL CMS z/VM V6.1.0 2004-09-30 16:24
access (noprof

The Help system

z/VM provides online help through the CMS Help system. The HELP command is like the man command in Linux. You can find full descriptions of z/VM commands by using the HELP command. By issuing help, you can access the main help menu for z/VM:
HELP TASKS Task Help Information line 1 of 39 (c) Copyright IBM Corporation 1990, 2003
z/VM Help, main panel
This panel lists other Help panels that provide information about various z/VM functions, topics, and tasks. To view a Help panel, move the cursor to any character of the name and press the ENTER key or the PF1 key.
HELPINFO - HELP Facility topics MENUS - z/VM Help menus TASKS - Basic z/VM tasks - good choice for beginners COMMANDS - z/VM commands available to general users CMS - CMS commands CP - CP commands QUERYSET - QUERY and SET commands and subcommands TCPIP - TCP/IP commands PF1= Help 2= Top 3= Quit 4= Return 5= Clocate 6= ? PF7= Backward 8= Forward 9= PFkeys 10= 11= 12= Cursor
VM READ GDLVME
====>
Macro-read 1 File
To get quicker access to command information, you can issue the HELP command with one of the keywords you see in the main menu. Example: For quick access to the information about the CP IPL command, issue:
help cp ipl
Chapter 1. About z/VM
13
Examples of using the HELP command
1. To get help for all the CP commands, type this command and press the Enter
key:
help cp menu
Result: You see a screen like this:
CP MENU Menu Help Information line 1 of 32 (c) Copyright IBM Corporation 1990, 2003
Help for CP commands
To display a Help panel, move the cursor to any character of the name and press the ENTER key or the PF1 key. An asterisk (*) preceding the name indicates a MENU panel. A colon (:) preceding the name indicates a TASK panel.
*CPQUERY *XLINK CPACcess DISCARD LOCate RESTART SYStem *CPSET *XSPOOL CPCAche DISConn LOCATEVM RETAIN TAg *CPUTIL :DUMPS CPHX DISPlay LOCK REWind TERMinal *DEFINE :DYNIO CPLISTfi DRain LOGoff SAVESEG TRace *DELETE :HELP CPRELeas DUmp Logon SAVESYS TRANsfer *DETACH #CP CPTRAP DUPlex Message SCREen TRSAVE *DISABLE ACNT CPTYPE ECho MODify SEND TRSOurce *DISPLAY ACTivate CPU ENable MONitor SET UNCOUPLE PF1= Help 2= Top 3= Quit 4= Return 5= Clocate 6= ? PF7= Backward 8= Forward 9= PFkeys 10= 11= 12= Cursor
====>
Macro-read 1 File
2. To get help for a specific command (for example, CP QUERY), type this
command and press the Enter key:
help cp query
Result: You see a screen like this:
CP QUERY All Help Information line 1 of 11
(c) Copyright IBM Corporation 1990, 2003
QUERY
Purpose
You can display various information about your virtual machine by using the QUERY command operands.
For information on the individual QUERY command operands, press PF11.
***EndofFile***
PF1= 2= Top 3= Quit 4= Return 5= Clocate 6= ? PF7= Backward 8= Forward 9= PFkeys 10= 11= Related 12= Cursor
====>
Related information
v z/VM: CMS Primer, SC24-6172
14 z/VM: Getting Started with Linux on System z
Macro-read 1 File
v For more advanced information, see z/VM: CMS User’s Guide, SC24-6173.
v For online help, type help on the CMS command line, then press the Enter key.

The CMS file editor XEDIT

CMS provides a file editor called XEDIT, which is a not only a full-screen editor, but a powerful programming tool. XEDIT has functions similar to vi in Linux. This topic introduces you to basic editing functions.
To enter an editing session, use the XEDIT command. Example: To create a new file called MY FILE A, type this command and press the Enter key:
xedit my file a
Without any modifications, an editing screen looks like this.
MY FILE A1 F 80 Trunc=80 Size=0 Line=0 Col=1 Alt=0 1
DMSXIN571I Creating new file: 2
4
=====***TopofFile*** 5
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7...6
=====***EndofFile***
3
3
====> 7
8 XEDIT 1File
Numbers in the figure explanations match the reverse type call-outs in the figure:
1. File identification line. The first line displays the file name, file type, file mode
and other file characteristics. “F 80” means the length of a line is fixed at 80 characters. “Trunc=80” means any characters beyond the 80-character length are truncated. “Size=0” means there are no lines in this file. “Line=0” means the current line is 0 (more about the current line in point 5 on page 16). “Col=1” is the position of the column pointer (more about the column pointer in point 6 on page 16). “Alt=0” means the file has had no alterations.
2. Message line. XEDIT communicates with you by displaying messages on the
second and third lines.
3. File area. This part of the screen is available to display the file. You can make
changes to the file by moving the cursor under any line and typing over the characters, or by using special keys to insert or delete characters. You can make as many changes as you want on the displayed lines before pressing the Enter key. When you press the Enter key, the changes are made to the copy of the file that is kept in virtual storage. The SAVE or FILE subcommand permanently records those changes on the copy of the file that resides on disk.
Chapter 1. About z/VM 15
Because a file can be too long to fit on one screen, various subcommands scroll the screen so you can move forward and backward in a file. Scrolling the screen is like turning the pages of a book.
4. Prefix area. The prefix area is the five left-most columns on the screen, and it
displays five equal signs (=====). Each line in the file has a prefix area. You can perform various editing tasks such as deleting a line by entering short commands, called prefix subcommands, in the prefix area of a line.
5. Current line. The current line is the file line in the middle of the screen (above
the scale). It is highlighted, appearing brighter than the other file lines.
The current line is important because most subcommands perform their functions starting with the current line. Naturally, the line that is current changes during an editing session as you scroll the screen, move up and down, and so forth. When the current line changes, the line pointer (not visible on the screen) moves. Many XEDIT subcommands perform their functions starting with the current line and move the line pointer when they are finished.
6. Scale. The scale appears under the current line to help you edit. It is like the
margin scale on a typewriter.
The vertical bar (|) in column one on the scale is the column pointer. Various subcommands perform their functions within a line starting at the column pointer, which you can move to different positions on the scale by using XEDIT subcommands. The current column is the column under which the column pointer is positioned.
7. Command line. The large arrow (====>) at the bottom of the screen points to
the command input area. One way you communicate with the editor is to enter XEDIT subcommands on this line. You can type subcommands in uppercase or lowercase or a combination of both, and many can be abbreviated. For example, BOTTOM, Bottom, and b are all valid ways to type the BOTTOM subcommand (which scrolls the file to the bottom).
8. Status area. The lower right corner displays the current status of your editing
session, for example, edit mode or input mode, and the number of files you are editing. The status area in the figure shows you are editing one file.
Tip: If you want to explore XEDIT and its capabilities, type “help” at the XEDIT command line, which opens the XEDIT help menu.
16 z/VM: Getting Started with Linux on System z
Loading...
+ 142 hidden pages