Chapter 9. Configuring RHEL 5.2 for cloning 137
Linux version 2.6.18-92.el5 (brewbuilder@btest1.z900.redhat.com) (gcc version 4.1.2
20071124 (Red Hat 4.1.2-41)) #1 SMP Tue Apr 1 19:03:24 EDT 2008
We are running under VM (64 bit mode)
...
Red Hat Enterprise Linux Server release 5.2 (Tikanga)
Kernel 2.6.18-92.el5 on an s390x
virtc531 login:
Your new system should come up cleanly using the modified IP address and host name.
Modify the SSH keys on the target system
Start an SSH session to the new clone as root.
The SSH keys that were copied are identical to those of the golden image. Remove them and
restart the sshd service. This will trigger the ssh-keygen command to automatically create
three new keys that are unique to this new guest. Note that sshd is designed so that it can be
restarted remotely, so you will not lose your SSH client connection:
# cd /etc/ssh
# rm -f /etc/ssh/ssh_host_*
# service sshd restart
Stopping sshd: [ OK ]
Generating SSH1 RSA host key: [ OK ]
Generating SSH2 RSA host key: [ OK ]
Generating SSH2 DSA host key: [ OK ]
Starting sshd: [ OK ]
At this point you have now cloned a Linux system manually. You can look around the new
system. It should be identical to the golden image except for the IP address and host name.
Next you will learn how to clone a Linux system automatically. You will use the LINUX01 user
ID again. To clone, the target user ID must be logged off. You could shut the new system
down cleanly, but because you will be cloning again, it does not matter. Go to the 3270
session and log off the LINUX01 user ID:
==> #cp log
9.3 Cloning one new virtual server
Now that you have cloned a server manually and better understand the steps, you can use
the clone script to clone automatically.
9.3.1 Creating a configuration file for LINUX01
For each Linux guest you want to clone, you must create a configuration file that you can use
to customize the image after cloning. Perform the following steps on the LNXINST installation
server:
1. Open an SSH session to LNXINST as root.
2. Install the clone script RPM:
# rpm -ivh /nfs/virt-cookbook-RH5.2/clone-1.0-5.s390x.rpm
Preparing... ########################################### [100%]
1:clone ########################################### [100%]
Komentarze do niniejszej Instrukcji