27.12.2012 Views

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

# cd /etc<br />

# cp auto.master auto.master.orig<br />

# vi auto.master // add one line at the bottom<br />

...<br />

#<br />

+auto.master<br />

/nfs /etc/auto.cloner<br />

► <strong>The</strong> new line specifies that the file system mounted beneath the directory /nfs/ will be<br />

configured in the file /etc/auto.cloner. Now create the file /etc/auto.cloner, and add<br />

one line which points to the RHEL 6 install tree that is NFS-exported from the cloner:<br />

# vi auto.cloner<br />

rhel6 -ro,hard,intr 9.60.18.223:/nfs/rhel6<br />

This line specifies that beneath /nfs/ (in auto.master), when the directory rhel6/ (field 1)<br />

is accessed, the automounter will use the specified options (field 2) to mount the directory<br />

(field 3).<br />

► Create the /nfs/ directory. Restart the autofs service to pick up the new configuration.<br />

<strong>The</strong>n list the contents of the /nfs/rhel6/ directory. Even though this directory does not<br />

exist as a local file system, it is automatically mounted when referenced:<br />

# mkdir /nfs<br />

# service autofs reload<br />

Reloading maps<br />

► Show that the directory /nfs/rhel6/ is automatically mounted:<br />

# ls /nfs/rhel6<br />

boot.cat RELEASE-NOTES-es-ES.html RELEASE-NOTES-pt-BR.html<br />

EULA RELEASE-NOTES-fr-FR.html RELEASE-NOTES-ru-RU.html<br />

...<br />

8.2.2 Configuring yum <strong>for</strong> online updates<br />

You will now configure yum so it can install RPMs from the automount-ed install tree. <strong>The</strong><br />

configuration is identical to the cloner because in both instances the install tree is in the<br />

directory /nfs/rhel6/. However on the cloner this directory is local, while on the golden<br />

image (and later the clones) the directory is automount-ed. To configure yum, per<strong>for</strong>m the<br />

following steps:<br />

► You could create a file named rhel6.repo in the /etc/yum.repos.d directory again, or you<br />

could copy the same file from the cloner that you created previously. In this example scp is<br />

used to copy the file:<br />

# cd /etc/yum.repos.d<br />

# scp gpok223:/etc/yum.repos.d/rhel6.repo .<br />

<strong>The</strong> authenticity of host 'gpok223 (9.60.18.223)' can't be established.<br />

RSA key fingerprint is 37:5f:83:99:ba:9e:<strong>10</strong>:14:04:65:06:e1:11:d9:d9:cd.<br />

Are you sure you want to continue connecting (yes/no)? yes<br />

Warning: Permanently added 'gpok223,9.60.18.223' (RSA) to the list of known hosts.<br />

root@gpok223's password:<br />

rhel6.repo <strong>10</strong>0% 73 0.1KB/s 00:00<br />

► Type the file to verify the contents:<br />

# cat rhel6.repo<br />

[RHEL6]<br />

name=Red Hat Enterprise Linux 6<br />

baseurl=file:///nfs/rhel6/Server<br />

Chapter 8. Installing and configuring the golden image 139

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!