System setup

This section describes the steps necessary to set up the Linux™ systems for suspend and resume testing. This section also provides information about the swap partition needed to suspend and resume a Linux instance.

These parameters are specified in the 'parameters' option of the /etc/zipl.conf configuration file. All the following commands and changes are run by the root user.

Setting up Linux for suspend and resume

This section describes the Linux kernel parameters used for setting up suspend and resume support.

The kernel parameter used to configure support for suspend and resume is:

resume=<device_node> [no_console_suspend] [noresume]

Where:
resume=<device_node>
Specifies the standard device node of the swap partition with the data that is required for resuming the Linux instance.
[no_console_suspend]
Prevents the Linux consoles from being suspended early in the suspend process. Without this parameter, you cannot see the kernel messages that are issued by the suspend process.
[noresume]
Restarts the Linux kernel without resuming a previously suspended Linux instance. Use this parameter to circumvent the resume process, for example, if the data written by the previous suspend process is damaged.
As an example, to use a partition named /dev/dasda2 as the swap partition, and prevent the Linux consoles from being suspended early in the suspend process, use this Linux kernel parameter:
resume=/dev/dasda2 no_console_suspend
This is a sample zipl.conf file:
[defaultboot]
defaultmenu = menu
[SLES11_SP1]
    image = /boot/image-2.6.32.12-0.7-default
    target = /boot/zipl
    ramdisk = /boot/initrd-2.6.32.12-0.7-default,0x2000000
    parameters = "root=/dev/disk/by-path/ccw-0.0.7335-part1 mem=32768M
TERM=dumb init=/linuxrc resume=/dev/disk/by-path/ccw-0.0.791d-part1 
no_console_suspend"
[Failsafe]
    image = /boot/image-2.6.32.12-0.7-default
    target = /boot/zipl
    ramdisk = /boot/initrd-2.6.32.12-0.7-default,0x2000000
    parameters = "root=/dev/disk/by-path/ccw-0.0.7335-part1 TERM=dumb x11failsafe
noresume"


:menu
    default = 1
    prompt = 0
    target = /boot/zipl
    timeout = 10

Setting up a swap partition

During the suspend process, Linux writes data to a swap partition. This data is required later to resume Linux. Set up a swap partition that is at least as large as the available LPAR memory, or the memory of the z/VM® guest virtual machine.

Do not use this swap partition for any other operating system that might run in the LPAR or z/VM guest virtual machine while the Linux instance is suspended. You cannot suspend a Linux instance while most of the memory and most of the swap space are in use.

If there is insufficient remaining swap space to hold the data for resuming the Linux instance, suspending the Linux instance fails. To assure sufficient swap space you might have to configure two swap partitions: one partition for regular swapping, and another for suspending the Linux instance. Configure the swap partition for suspending the Linux instance with a lower priority than the regular swap partition.

Use the pri= parameter to specify the swap partitions in the /etc/fstab file with different priorities. See the swapon man page for details.

The following example shows two swap partitions with different priorities:
  • /dev/dasdb1 swap swap pri=-1 0 0
  • /dev/dasdc1 swap swap pri=-2 0 0

Suspending a Linux instance

Issue the following command to suspend a Linux instance:
echo disk > /sys/power/state

On the Linux console you might see progress messages until the console itself is suspended. Most of these messages require log level 7 or higher to be displayed. You cannot see the progress messages if you suspend the Linux instance from an ssh session.

To change the log level of console messages, issue this command:
klogd  -c n 
where n is the log level value. The default is 7.
Issue this command to change the log level to 7:
/sbin/klogd -c 7 

Resuming a suspended Linux instance

Restart Linux to resume a suspended Linux instance. Use the same Linux kernel, initial RAM disk, and kernel parameters that you used to first boot the suspended Linux instance. You must reestablish any terminal session for Hypervisor Console (HVC) terminal devices and for terminals provided by the iucvtty program. You also must reestablish all ssh sessions that have timed out while the Linux instance was suspended. If resuming the Linux instance fails, restart Linux again with the noresume kernel parameter. The restart process then ignores the data that was written to the swap partition and starts Linux without resuming the suspended instance.

More information about the use of suspend and resume can be found in the Device Drivers, Features and Commands manual found at this location:

https://public.dhe.ibm.com/software/dw/linux390/docu/lk36dd08.pdf

z/VM CP STOP and BEGIN commands

The Linux guest can issue the CP command CP STOP ALL to place the Linux guest in a stopped state. All virtual CPUs are stopped and execution is halted. The state of attached devices might remain undefined.

With the CP STOP command, you can place the processors into a soft stop state or a hard stop state. This test used the hard stop option.
CPU ALL
Specifies the processor or processors that you want to place in hard stop. You can specify a single processor address, a list of processor addresses delimited by blanks, a non-wrapping pair of addresses separated by a hyphen (-) with no blanks, or the keyword ALL. If you omit this operand, all of your virtual processors are placed into a soft stop state.
Important: If you enter the CP STOP command without operands, all of your virtual processors are placed into soft stop.

To restart the Linux guest, the guest issues the command CP BEGIN. This will reactivate the stopped virtual CPUs and execution will begin again.

The CP BEGIN command can be issued from a SECUSER user that has been set for the Linux guest or from the CP administration guests MAINT or OPERATOR. A class G user can issue these command. Any z/VM guest can issue CP STOP and CP BEGIN for itself.

More information about the use of the BEGIN and STOP commands can be found in the CP Commands manual found at this location:

https://www.ibm.com/resources/publications/OutputPubsDetails?PubID=SC24617500

Linux guest setup

In this test, 11 Linux guests were used. Five guest were set up as a relational database server (RDB) and driven by the SwingBench workload. Six guests were setup for WebSphere®; one of the WebSphere guests acted as the Network Deployment Manager node and the other five guests were set up as WebSphere Application Server (WAS) nodes. Each WebSphere Application Server node had it's own local DB2® instance that contained the DayTrader database.