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
  • Real. For example, you can dedicate a real network interface to a virtual machine for its exclusive use.
  • 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.
  • 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.

Guidelines: For CPUs, follow these guidelines:
  • Never give a virtual machine more virtual CPUs than there are real CPUs.
  • If the Linux® program cpuplugd is available, define the maximum number of virtual CPUs that a Linux server could use. cpuplugd can tailor the virtual CPUs actually used by the Linux server, and thus cause no additional CP overhead. If cpuplugd is not available, do not define more virtual CPUs than the Linux server is likely to use.

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. Unless you have sufficient CPUs available and do good planning, dedicating CPUs can have an impact on the performance of other virtual machines in the system.

Related information: For more information about Linux and CPU usage, see: Linux Performance when running under VM.

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 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.

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.

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 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).

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  FF0D312E20978000 (BASE) IFL  CPUAFF ON
    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  700C ON OSA   700C SUBCHANNEL = 0020                          
         700C DEVTYPE OSA         VIRTUAL CHPID 70 OSD REAL CHPID 70   
         700C QDIO-ELIGIBLE       QIOASSIST-ELIGIBLE                   
    OSA  700D ON OSA   700D SUBCHANNEL = 0021                          
         700D DEVTYPE OSA         VIRTUAL CHPID 70 OSD REAL CHPID 70   
         700D QDIO-ELIGIBLE       QIOASSIST-ELIGIBLE                   
    OSA  700E ON OSA   700E SUBCHANNEL = 0022                          
         700E DEVTYPE OSA         VIRTUAL CHPID 70 OSD REAL CHPID 70   
         700E 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 = 10G CONFIGURED = 70G INC = 1G STANDBY = 240G RESERVED = 0
Note: QUERY VIRTUAL option displays information about the virtual machine. The keyword VIRTUAL is optional for the class G user. For privileged 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 LPAR storage size.

Related information: For more information about CP commands, see:

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 shows you how to use this z/VM facility.

In an SSI cluster, spool volumes (disks) are shared through a function called cross-system spool. Each member of the cluster creates spool files only on spool volumes that it owns, but each member has access to the spool volumes owned by the other members. Users defined as single-configuration virtual machines1 have a single logical view of all their spool files. Users logged on to one of the members of the SSI cluster can access all of their spool files regardless of which member they have logged on to for that session. (For a spool file to be accessible, the member on which it was created must be joined to the cluster.) Users can transfer their spool files to other users or to service virtual machines2 anywhere in the cluster. They can select printers and other spool output devices for processing spool files created on any member of the cluster. Thus, the end-user view of spooling is nearly transparent. Although the CP commands that manipulate spool files operate differently internally for an SSI cluster, additional user options or parameters are not required.

User IDs defined as multiconfiguration virtual machines do not participate in cross-system spool. Each instance of a multiconfiguration virtual machine can view only the spool files owned by the instance on that member. A spool file owned by another instance of the virtual machine (that is, logged on to another member) is not visible. Spool file transfer services, such as RSCS3, can be used to move spool files to the member where the intended instance of the multiconfiguration virtual machine resides.

Some important commands that operate on spool files are:
  • 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.
  • QUERY READER ALL. For class G users, this CP command lets you view information about spool files in your virtual reader. For privileged users, use QUERY READER ALL userid, where userid is the user ID of a virtual machine. (Without userid, a privileged user using this command sees all the reader files on the system.)
  • RDRLIST. This CMS command displays information about your reader files in a full-screen interactive display.
  • RECEIVE. This CMS command moves a file from your reader onto a minidisk.
  • PUNCH. This CMS command punches (copies) a CMS file to your virtual punch.
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:

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.

For command help, see z/VM: CP Commands and Utilities Reference, and z/VM: CMS Commands and Utilities Reference.

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, created from the source, on a CP-formatted disk.

The source form of the user directory consists of directory statements that define the CP-formatted volume on which the object directory is created and the configuration and operating characteristics of the virtual machines that are known to the z/VM operating system. In an SSI cluster, there are two types of virtual machines:
Single-configuration virtual machine definition
A user ID defined by a single-configuration virtual machine definition (the traditional type of user definition) can be logged on to any member of the SSI cluster, but on only one member at a time. Single-configuration virtual machines are eligible for guest relocation.

Use this type of virtual machine for your Linux guests.

Multiconfiguration virtual machine definition
A user ID defined by a multiconfiguration virtual machine definition can be logged concurrently on multiple members of the SSI cluster. The instances of the user ID on the members have common attributes but can also be configured to access different resources.

Multiconfiguration virtual machines are not eligible for guest relocation. Use this type of virtual machine for system support, such as the MAINT user ID, and server virtual machines, such as the TCP/IP server.

The directory statements in the user directory are divided into blocks called entries. The entries are:
GLOBALDEFS (global definitions entry)
Which must begin with the GLOBALDEFS directory statement. The entry also includes directory statements that define global settings to be used by all virtual machine definitions.
PROFILE (profile entry)
Each of which begins with a PROFILE directory statement and consolidates other directory statements that are used in common by many virtual machine definitions.
USER (user entry), IDENTITY (identity entry), and SUBCONFIG (subconfiguration entry)
Each of which begins with a USER, IDENTITY, or SUBCONFIG directory statement. USER begins the entry for an single-configuration virtual machine definition. IDENTITY begins the entry for a multiconfiguration virtual machine definition and includes statements common to virtual machine configurations in that definition. SUBCONFIG begins the entry for a set of directory statements in a multiconfiguration virtual machine definition that is specific for a member of an SSI cluster.

The following is a sample single-configuration virtual machine definition. The callouts 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   INCLUDE LINDFLT
 3   IPL CMS
 4   MACHINE ESA 4
 5   CONSOLE 0009 3215
 6   NICDEF 4204 TYPE QDIO LAN SYSTEM VSWITCH1
 7   SPOOL 000C 3505 A
     SPOOL 000D 3525 A
     SPOOL 000E 1403 A
 8   LINK MAINT 0190 0190 RR
     …
 9   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 the 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 INCLUDE statement specifies the name of a profile entry to be invoked as part of the user entry. In the example, there is a profile entry elsewhere in the user directory that starts with the statement PROFILE LINDFLT.
  3. 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 environment as well as run some REXX EXECs (script-like executable files) to set up Linux.
  4. 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.
  5. 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 to change the console from 3215 to 3270.
  6. The NICDEF statement defines this virtual machine's attachment to a z/VM virtual switch.
  7. 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).
  8. LINK statements provide access to another virtual machine's minidisks.
  9. 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.
The following is a sample multiconfiguration virtual machine definition. The callouts next to each statement correspond to explanations that follow the sample.
 1   IDENTITY OPERATOR pw 32M 32M ABCDEFG 
     INCLUDE IBMDFLT 
 2   BUILD ON MEMBER1 USING SUBCONFIG OPERTR-1 
     BUILD ON MEMBER2 USING SUBCONFIG OPERTR-2 
     BUILD ON MEMBER3 USING SUBCONFIG OPERTR-3 
     BUILD ON MEMBER4 USING SUBCONFIG OPERTR-4 
     AUTOLOG AUTOLOG1 OP1 MAINT 
     ACCOUNT 2 OPERATOR 
     MACHINE ESA 
     OPTION MAINTCCW 

 3   SUBCONFIG OPERTR-1 
     LINK OP1 191 192 RR 
     MDISK 191 3390 2924 005 FLA293 MR READ WRITE MULTIPLE 

     SUBCONFIG OPERTR-2 
     MDISK 191 3390 2924 005 FLA2A3 MR READ WRITE MULTIPLE 

     SUBCONFIG OPERTR-3 
     LINK OP1 191 192 RR 
     MDISK 191 3390 2924 005 FLA2B3 MR READ WRITE MULTIPLE

     SUBCONFIG OPERTR-4 
     LINK OP1 191 192 RR 
     MDISK 191 3390 2924 005 FLA2C3 MR READ WRITE MULTIPLE 
  1. The IDENTITY statement begins the directory entry. Like the USER statement, the IDENTITY statement defines the user ID, password, default storage, maximum storage, and authorization class (or classes) for this virtual machine. You can add statements that are common to all instances of a multiconfiguration virtual machine within the IDENTITY entry (AUTOLOG, ACCOUNT, MACHINE, OPTION, and so forth).
  2. The BUILD statement specifies a system name of an SSI cluster member and the SUBCONFIG ID of the subconfiguration entry that contains the system-specific directory statements for a multiconfiguration virtual machine instance. In the example, the first BUILD statement specifies MEMBER1 as the cluster member with system-specific directory statements defined in the OPERTR-1 subconfiguration entry.

    If specified, BUILD statements must immediately follow an IDENTITY statement, an INCLUDE statement, or another BUILD statement.

  3. The SUBCONFIG statement starts a subconfiguration entry. This entry contains a set of directory statements in a multiconfiguration virtual machine definition that are specific to one of its virtual machine instances within the SSI cluster. In the example, the OPERTR-1 subcofiguration entry contains a system-specific LINK and MDISK statement.

    The SUBCONFIG statement must be unique among all users.

Related information: For more information about the user directory, see:

Creating and Updating a User Directory in z/VM: CP Planning and Administration

1 Single-configuration virtual machines and multiconfiguration virtual machines are explained in The user directory.
2 A service virtual machine or service machine is virtual machine that provides a system service, such as accounting, error recording, or monitoring.
3 IBM® Remote Spooling Communications Subsystem (RSCS) Networking, an optional feature of z/VM, is a networking program that enables users on one z/VM system to send messages, files, commands, and jobs to other users within a network.