How to detect guest relocation

Information about guest relocations are stored in the s390 debug feature (s390dbf). You can access this information in a kernel dump or from a running Linux instance.

About this task

You can detect if a Linux instance has been moved to another guest virtual machine or LPAR. One available mechanism for guest relocation is z/VM® Single System Image (SSI).

You can access the s390 debug feature lgr from a live system or with the crash tool from a kernel dump. When the debug feature contains only one entry, no relocation has been detected and the entry identifies the boot virtual guest machine. For each detected relocation one additional entry is written.

Procedure

Choose the method that suits your purpose:
  • Use the crash tool to read from a kernel dump. Issue a command of this form:
    # crash <vmlinux files> <dump file>
    crash> s390dbf lgr hex_ascii
  • Use the cat command on a live system to read the debugfs entry for lgr. Issue a command of this form:
    # cat /sys/kernel/debug/s390dbf/lgr/hex_ascii

Example

Assume that one relocation of the guest virtual machine ZVMGUEST has been detected from a z/VM in LPAR VM000A to a z/VM in LPAR VM000B. You can see this in the kernel dump:
# crash vmlinux dump
crash> s390dbf lgr hex_ascii
00 01317816806:277332 3 - 00 .. | ... IBM856100000000000266A802 ... VM000A ... ZVMGUEST
00 01317866806:277332 3 - 00 .. | ... IBM85610000000000022E4802 ... VM000B ... ZVMGUEST
Alternatively, you can see such a relocation from a running system:
# cat /sys/kernel/debug/s390dbf/lgr/hex_ascii
00 01317816806:277332 3 - 00 .. | ... IBM856100000000000266A802 ... VM000A ... ZVMGUEST
00 01317866806:277332 3 - 00 .. | ... IBM85610000000000022E4802 ... VM000B ... ZVMGUEST

For more information about the complete s390dbf record, see the struct lgr_info definition in the Linux kernel source code.

For network problems with a relocated guest, see http://www.ibm.com/vm/virtualnetwork/lgrgrat.html.