In VM2000, the main memory of a VM and of the guest system can be expanded or reduced by the VM2000 administrator during the current session (dynamic main memory reconfiguration) to allow a flexible reaction to changes in load or types of tasks without interrupting the operation of the system.
Example
Increasing the size of the main memory of a reserve VM for taking over the load of a failed productive system.
Dynamic reconfiguration of main memory requires measures to be taken in the guest system (if it is active), in the VM’s firmware component (SU x86) and in VM2000. It can be carried out for the monitor system as well.
The MEMORY-SIZE
operand is used to dimension the main memory of the VM when the VM is initialized. The MIN-MEMORY-SIZE
and MAX-MEMORY-SIZE
(SU x86) operands can be used to specify the minimum and maximum main memory size if the size of the main memory of the VM is altered at a later time. The VM2000 administrator must ensure that the main memory size is not less than the minimum required for running the guest system (see "Initializing a VM").
Main memory reconfiguration is possible at all times for inactive guest systems (with the status INIT-ONLY or DOWN). In the case of active guest systems (VM state RUNNING), main memory reconfiguration is only possible after SYSTEM READY
for the guest system. Main memory reconfiguration is not possible for VMs in the IN HOLD (WAIT) or ...(MIGR) states.
Any further /EXTEND-
VM-MEMORY
or /REDUCE-VM-MEMORY
command for the same VM is rejected while a main memory reconfiguration command is being processed.
The commands /SHOW-VM-ATTRIBUTES
and /SHOW-VM-RESOURCES INFORMATION=*MEMORY/*ALL
provide information on the current, the minimum and the maximum main memory size of the VM and the planned main memory size during main memory reconfiguration.
Since dynamic reconfiguration of main memory requires measures to be taken in the guest system, in the firmware component (SU x86) and in VM2000, the process can be time consuming. The /MOVE-VM
(SU /390) and /START-VM
commands can be executed during this time. The new main memory size of the relevant VM is used in the case of /EXTEND-VM-MEMORY
, and the old main memory size is used in the case of /REDUCE-VM-MEMORY
. The same applies when the guest system is restarted.
The dynamic reconfiguration of main memory can be monitored with a monitor job variable (see "Monitoring the reconfiguration of a main memory with job variables"). Notification of the end of a reconfiguration request is sent to all VM2000 administrators via the message VMS4094
(successful) or VMS4095
(only partially successful or unsuccessful) as an asynchronous message, and to the authorized BS2000 consoles or applications via routing code “9“. See also "Automating VM2000 and VM administration".
Termination of main memory configuration
Main memory configuration is terminated in the following cases:
SETS or shutdown of the guest system
Abortion of the guest system with
/RESET-VM
Termination of the VM with
/DELETE-VM
Restarting of the VM with
/START-VM ...,CHECK-VM-STATE=*NO
In all cases, the VM2000 administrator is notified of termination by message VMS4095
. This message is also distributed in the monitor system by means of routing code “9“, see also "Automating VM2000 and VM administration".
In the case of main memory expansion, an accounting record is written for the VM in all cases.
On SU x86, aborting a main memory reconfiguration with /START-VM , /RESET-VM or /DELETE-VM should be avoided. Reason: The reconfiguration will only be aborted in BS2000 but continued in the firmware and the carrier system. A BS2000 IPL with /START-VM may be delayed until the reconfiguration in the carrier system is complete. |
Enlarging main memory
The main memory for a VM can be extended by means /EXTEND-VM-MEMORY
. At the same time, it is possible to increase the minimum main memory size for the VM.
On SU x86, requesting and assigning main memory are not an atomic actions, but take place in several steps. If an error occurs or maximum wait times are exceeded, the main memory of the VM is enlarged only to the size which had been assigned at the time the error occurred. A VM’s main memory can only be enlarged to the maximum main memory size (MAX-MEMORY-SIZE ). |
When the command is processed, actions are first carried out in VM2000 and in the VM’s firmware component (SU x86), and then actions are carried out in the guest system (enlarge main memory in the guest system).
Reducing main memory
By means of /REDUCE-VM-MEMORY
, the main memory for a VM can be reduced up to its minimum main memory size.
On SU /390, the new main memory size may be below the MIN-MEMORY-SIZE of the VM concerned only if the VM is in state INIT-ONLY or DOWN. In this case, the value for the VM’s MIN-MEMORY-SIZE is assigned the value of NEW-MEMORY-SIZE . | |
On SU x86, the new main memory size may not be below the MIN-MEMORY-SIZE of the VM concerned. |
When the command is processed, actions are first carried out in the guest system (reduce the main memory in the guest system) and then actions are carried out in VM2000 and in the VM’s firmware component (SU x86).
Monitoring the reconfiguration of a main memory with job variables (MONJV)
When the reconfiguration of the main memory is initiated by the VM2000 administrator with /EXTEND-VM-MEMORY
or /REDUCE-VM-MEMORY
, a monitoring job variable can be defined for this (MONJV).
The location and validity of the MONJV correspond to the runtime environment of the sender of the command. VM2000 manages and updates the MONJV as long as the reconfiguration of the main memory is running. By using appropriate procedures, the VM2000 administration can automatically react to the information stored in the MONJV and thus facilitate VM2000 administration.
For general information on job variables in VM2000, see "Monitoring a VM with job variables (MONJV)".
MONJVs can also be used to monitor a VM and during a VM Migration, see "Monitoring a VM with job variables (MONJV)" and "Monitoring a VM Migration with job variables (MONJV)".
For an example of how to use a MONJV to monitor the reconfiguration of a main memory, see below.
Beginning and end of monitoring
The MONJV used to monitor a main memory reconfiguration is created at the start of the main memory reconfiguration with /EXTEND-VM-MEMORY
or /REDUCE-VM-MEMORY
by specifying the MONJV
operand. The monitoring of the reconfiguration of the main memory starts at this point; the MONJV is supplied with data by VM2000.
If a MONJV already exists with the specified name, a password can be specified in the operand JV-PASSWORD
to check for access authorization.
The monitoring ends with a normal end or an abort of the reconfiguration of the main memory. Even when the monitoring has finished, the MONJV is retained as a user job variable without MONJV protection.
Protecting the MONJV
See the paragraph with this name in section "Monitoring a VM with job variables (MONJV)".
Location of the MONJV
See the paragraph with this name in section "Monitoring a VM with job variables (MONJV)".
Values for the MONJV
A MONJV for a main memory reconfiguration comprises a system part (bytes 1-128) and a user part (bytes 129-256). Specific values are entered by VM2000 in the system part of the MONJV at specific times during the main memory reconfiguration.
Byte | Meaning / possible values |
---|---|
1-3 | Monitoring status (left-aligned, padded with a space):
|
4 | Reserved, has the value zero (0) |
5-8 | Reserved, contains spaces |
9-12 | Catalog ID of the home pubset of the monitor system |
13-16 | Reserved, contains spaces |
17 | Type of MONJV: character |
18-20 | Current system sequence number ( |
21-36 | Beginning of monitoring (opening the MONJV) in UTC time (format: |
37-70 | Reserved |
71-78 | Name of VM ( |
79-81 | Index of VM printable ( |
82-86 | Memory size of VM in Mbytes ( |
87-91 | Minimum memory size of VM in Mbytes ( |
92-96 | Memory size used by the guest system in Mbytes ( |
97-106 | Memory size of VM in Mbytes ( |
107-116 | Minimum memory size of VM in Mbytes ( |
117-126 | Memory size used by the guest system in Mbytes ( |
127-128 | Reserved |
129-256 | Reserved for users |
Displaying the MONJV
See the paragraph with this name in section "Monitoring a VM with job variables (MONJV)".
Behavior when the system is terminated abnormally in the monitor system
See the paragraph with this name in section "Monitoring a VM with job variables (MONJV)".
Example
This sample procedure shows how the reconfiguration of a main memory is monitored with MONJV. For an analogous sample procedure using PROP-XT, see "Automating VM2000 and VM administration".
/SET-PROC-OPT /" **************************************************************" /" ** PROCEDURE VMMEM FOR GUEST SYSTEMS WITH VM-ID=2 AND 3 ******" /" **************************************************************" /" ** THE PROCEDURE PERFORMS A MEMORY RECONFIGURATION. " /" ** IMPORTANT STEPS: " /" ** - CONNECTION TO VM2000 ESTABLISHED " /" ** - CHECK CURRENT MEMORY SIZE " /" ** - REDUCE MEMORY OF VM2 " /" ** - HANDLE ASYNCHRONOUS END VIA MONJV " /" ** - CHECK CURRENT MEMORY SIZE " /" ** - EXTEND MEMORY OF VM3 " /" ** - HANDLE ASYNCHRONOUS END VIA MONJV " /" ** - DISCONNECTION FROM VM2000 " /" **************************************************************" /" **************************************************************" /DECLARE-VARIABLE NAME=SHVAS(TYPE=STRUCTURE),MULT-E=*LIST /DECLARE-VARIABLE NAME=MIMEMSI(TYP=INT) /DECLARE-VARIABLE NAME=TXT(TYPE=STRING,INIT-VALUE='OK') /DECLARE-VARIABLE NAME=JVRES(TYPE=STRING) /ASSIGN-SYSLST LST.VMMEM /MODIFY-JOB-OPTIONS LOG=*PAR(LIST=Y) /BEGIN-BLOCK /"** CONNECTION TO VM2000 " /BEGIN-VM-DIALOG VM-ID=1 /"** CHECK CURRENT MEMORY SIZE " /EXEC-CMD (SHOW-VM-ATTR VM-ID=2,INF=*MEMORY),STRUCT-OUT=SHVAS /IF (SHVAS#.MIN-MEM-SIZE = '*UNDEF') / TXT = 'MEMORY CONFIGURATION CURRENTLY NOT POSSIBLE FOR VM-ID=2' / GOTO LABEL=ERROR /END-IF /MIMEMSI=INT(SHVAS#.MIN-MEM-SIZE) /IF (SHVAS#.MEM-SIZE = MIMEMSI) / TXT = 'CURRENT MEMORY SIZE IS MINIMUM MEMORY SIZE' / GOTO LABEL=ERROR /END-IF /"** CHECK MEMORY SIZE OF VM-ID=3 " /EXEC-CMD (SHOW-VM-ATTR VM-ID=3,INF=*MEMORY),STRUCT-OUT=SHVAS /IF (SHVAS#.MIN-MEM-SIZE = '*UNDEF') / TXT = 'MEMORY CONFIGURATION CURRENTLY NOT POSSIBLE FOR VM-ID=3' / GOTO LABEL=ERROR /END-IF /"** REDUCE MEMORY OF VM-ID=2 " /REDUCE-VM-MEMORY VM-ID=2,NEW-MEM-SIZE=*MINIMUM,MONJV=JV.VMMEM.VM02 /IF-CMD-ERROR / TXT = 'ERROR IN REDUCE-VM VM-ID=2' / GOTO LABEL=ERROR /END-IF /"** SYSTEM MUST WAIT FOR END OF MEMORY CONFIGURATION " /WAIT-EVENT *JV(((JV.VMMEM.VM02,1,2) = '$T' OR - / (JV.VMMEM.VM02,1,2) = '$A'),TIME-LIM=300) /IF-CMD-ERROR / TXT = 'ERROR IN WAIT FOR END OF REDUCE-VM VM-ID=2' / GOTO LABEL=ERROR /END-IF /JVRES = JV('JV.VMMEM.VM02') /IF (SUBSTRING(JVRES,1,2) = '$A') / TXT = 'REDUCE-VM VM-ID=2 TERMINATED ABNORMALLY' / GOTO LABEL=ERROR /END-IF /"** EXTEND MEMORY OF VM3 ********" /EXTEND-VM-MEMORY VM-ID=3,NEW-MEM-SIZE=*MAXIMUM,MONJV=JV.VMMEM.VM03 /IF-CMD-ERROR / TXT = 'ERROR IN EXTEND-VM VM-ID=3' / GOTO LABEL=ERROR /END-IF /"** SYSTEM MUST WAIT FOR END OF MEMORY CONFIGURATION " /WAIT-EVENT *JV(((JV.VMMEM.VM03,1,2) = '$T' OR - / (JV.VMMEM.VM03,1,2) = '$A'),TIME-LIM=300) /IF-CMD-ERROR / TXT = 'ERROR IN WAIT FOR END OF EXTEND-VM VM-ID=3 / GOTO LABEL=ERROR /END-IF /JVRES = JV('JV.VMMEM.VM03') /IF (SUBSTRING(JVRES,1,2) = '$A') / TXT = 'EXTEND-VM VM-ID=3 TERMINATED ABNORMALLY' / GOTO LABEL=ERROR /END-IF /"** NORMAL END" /END-BLOCK /IF-BLOCK-ERROR "HANDLE OTHER ERRORS" / TXT = 'OTHER ERRORS' / GOTO LABEL = ERROR /END-IF /ERROR: /IF (TXT <> 'OK') / SEND-MSG TO=OPER,MSG='*** ERROR IN VMMEM: &TXT ***' /END-IF /END-VM-DIALOG 1 "SHUT DOWN CONNECTION TO VM2000" /IF-CMD-ERROR; END-IF /DEL-JV JV.VMMEM.VM02 /IF-CMD-ERROR; END-IF /DEL-JV JV.VMMEM.VM03 /IF-CMD-ERROR; END-IF /MOD-JOB-OPTIONS LOG=*PAR(LIST=NO) /ASSIGN-SYSLST *PRIMARY /EXIT-PROC