• No results found

Installing snIPL on Red Hat Enterprise Linux 5

Chapter 4. Linux-HA release 2 installation and initial configuration

4.3 Installing Linux-HA release 2 components

4.3.4 Installing snIPL on Red Hat Enterprise Linux 5

With all packages compiled, there is no need to go through the building process again for the other nodes. Simply copy all generated rpm files and install them. In addition, remember to install all dependencies.

4.3.4 Installing snIPL on Red Hat Enterprise Linux 5

snIPL for z/VM provides a way to remotely control z/VM system management functions. It can be used to reset, activate, or deactivate a z/VM Linux guest image for I/O fencing purposes. A pre-compiled package is available for SLES 10, but for Red Hat Enterprise Linux 5, it must be built from source.

snIPL uses the System Management API (SMAPI) of z/VM 4.4 or later. To communicate with the z/VM host, snIPL for z/VM establishes a network

connection and uses the RPC protocol to send and retrieve data. To compile and run snIPL for z/VM, the RPC protocol specification DMSVSMA.X must be copied to the Linux system that is running snIPL (usually in the /usr/share/dmsvsma/

directory).

snIPL compilation depends on Heartbeat. Therefore, you must have the heartbeat and heartbeat-devel packages installed before any attempts to compile snIPL.

Another dependency is the hwmcaapi library. This library is maintained by the IBM HMC team and is available at the IBM Resource Link at the following address:

http://www.ibm.com/server/resourcelink

At the time this book was written, the hwmcaapi-2.10.0-73j.s390x.rpm and hwmcaapi-devel-2.10.0-73j.s390x.rpm packages were available for download from the IBM Resource Link.

1. Download and install the hwmcaapi-2.10.0-73j.s390x.rpm and hwmcaapi-devel-2.10.0-73j.s390x.rpm packages on the guests for a successful compilation.

More information: For instructions on how to obtain the DMSVSMA.X file, see 3.2.3, “Locating the dmsvsma.x file” on page 53.

2. After downloading from the IBM Resource Link, transfer the packages to the lnxrh1 box (in our environment), and install them by using rpm

(Example 4-33). The warnings can be safely ignored.

Example 4-33 Installing library hwmcaapi packages

# cd /usr/src/

warning: user kschroed does not exist - using root

########################################### [ 50%]

2:hwmcaapi warning: user kschroed does not exist - using root

warning: user kschroed does not exist - using root warning: user kschroed does not exist - using root

########################################### [100%]

warning: user kschroed does not exist - using root

#

3. Unpack snipl-0.2.1.3.tar.gz, and the snipl-0.2.1.3 directory is created.

Example 4-34 shows the content of the directory.

Example 4-34 snipl-0.2.1.3 directory contents

# cd /usr/src

lic_vps.loT snipl.8 snipl_interface.h vmsmapi.h

#

4. Compile snIPL. Go to the snipl-0.2.1.3 directory and enter a make command (Example 4-35).

Example 4-35 Running make inside snipl-0.2.1.3 directory

# cd /usr/src/snipl-0.2.1.3

# make ...

gcc -DUNIX=1 -DST_TEXTDOMAIN='"stonith"' -g -O2 -Wall -I. -I/usr/include -I/usr/include/stonith -o snipl -L. -L/usr/lib64 -lnsl -ldl -lvmsmapi -lsniplapi -lhwmcaapi -lconfig snipl.o prepare.o

/bin/sh libtool --mode=compile gcc \

-DUNIX=1 -DST_TEXTDOMAIN='"stonith"' -g -O2 -Wall -I.

-I/usr/include -I/usr/include/stonith -DLPAR_INCLUDED=1 -DVM_INCLUDED=1

`pkg-config --cflags glib-2.0` \ -c lic_vps.c -o lic_vps.lo

gcc -DUNIX=1 -DST_TEXTDOMAIN=\"stonith\" -g -O2 -Wall -I. -I/usr/include -I/usr/include/stonith -DLPAR_INCLUDED=1 -DVM_INCLUDED=1

-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c lic_vps.c -fPIC -DPIC -o .libs/lic_vps.o

In file included from /usr/include/stonith/stonith.h:47, from ./snipl_stonith_plugin.h:31, from lic_vps.c:17:

/usr/include/pils/plugin.h:23:20: error: ltdl.h: No such file or directory make: *** [lic_vps.lo] Error 1

#

You see some text scrolling on your panel and probably an error message indicating that ltdl.h could not be found (highlighted in bold in

Example 4-35). In fact ltdl.h is installed on the system and is available. We just have to tell the compiler how to find it.

5. Set the environment variable CFLAGS as shown in Example 4-36.

Example 4-36 Helping the compiler on how to find ltd.h

# CFLAGS="-I/usr/share/libtool/libltdl" make You should now have a working snIPL binary.

6. Continue the installation as shown in Example 4-37.

Example 4-37 Installing snIPL binaries

# make install

install -d -m755 /usr/lib64/stonith/plugins/stonith2 install -d -m755 /usr/lib64 /usr/bin /usr/share/man/man8 install -g root -o root -m755 libconfig.so /usr/lib64 install -g root -o root -m755 libsniplapi.so /usr/lib64

install -g root -o root -m755 libvmsmapi.so /usr/lib64 install -g root -o root -m755 snipl /usr/bin

install -g root -o root -m644 snipl.8 /usr/share/man/man8 /bin/sh libtool --mode=install /usr/bin/install -c lic_vps.la \ /usr/lib64/stonith/plugins/stonith2/lic_vps.la

/usr/bin/install -c .libs/lic_vps.so

7. Check the snipl version as shown in Example 4-38.

Example 4-38 Checking the snipl version

# snipl -v

System z snipl - Linux Image Control - version 2.1.3 Copyright IBM Corp. 2001, 2007

#

8. After the packages are installed in the server, create a configuration file (Example 4-39).

image = lnxrh3 image = lnxrh4 image = lnxsu3 image = lnxsu4

#

The following reverse numbers correspond to the reverse numbers in Example 4-39 on page 94 for further explanation:

1. We define the IP address of the z/VM system under which our Linux guests reside.

2. We identify the type as VM.

3. We specify the guest user and password for the guest that has snIPL access. In our environment, we give the guest user OPERATOR snIPL access to the guests defined in NAMELIST (see Example 3-8 on page 52).

4. We specify the Linux systems that must be loaded by snIPL.

The snIPL configuration also defines another z/VM LPAR, with IP 9.12.4.189.

This is because we need to have snIPL access to Linux guests running in this z/VM LPAR as well. And we go through the OPERATOR guest ID to do so as well.

5. Now that snIPL is installed and configured, make a connection test (Example 4-40) and validate communication between snIPL and the z/VM host.

Example 4-40 Using snipl to list the z/VM images

# snipl -V 9.12.4.4 -x

available images for server 9.12.4.4 and userid OPERATOR :

lnxsu2 lnxrh2 lnxsu1 lnxrh1

#

The hostname command: For 4, in the image definitions, you must specify what the hostname command returns on your Linux systems.

The image definition is case sensitive. That is, if the hostname command returns lnxsu1, you must enter lnxsu1 in lowercase.