Red Hat Network Satellite 5.3.0 Provisioning HowTo Red Hat Network Satellite Partha Aji Michael DeHaan Mike McCune Dave Parker Justin Sherrill Copyright © 2009 Red Hat, Inc. This material may only be distributed subject to the terms and conditions set forth in the Open Publication License, V1.0 or later (the latest version of the OPL is presently available at http://www.opencontent.org/openpub/). Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc.
Provisioning HowTo 5.4. Required Packages ...................................................................................................... 7 6. Kickstart Profiles ..................................................................................................................... 7 6.1. Virtualization Types ...................................................................................................... 7 6.2. Creating Kickstart Profiles ..........................................................
Definitions and Terms • To use the new provisioning functionality, you need one or more target machines — either physical, bare metal computer system(s) or virtual machine host(s). If you want to use Satellite's virtual machine provisioning functionality, your virtual machine host(s) should be configured with either the Xen or KVM virtualization technologies. Note that RHEL 5.4 and newer support KVM virtualization at this time. 2.
Provisioning HowTo 3. Create a Kickstart Profile 4. Provision/reprovision machines 5. Kickstart Trees And Software Content You must have at least one kickstart tree installed on your Satellite in order to use kickstart provisioning. Satellite supports both automatic and manual kickstart tree installation. 5.1. Automatically Installed Kickstart Trees Automatic kickstart tree installation is a function of normal channel synchronization.
Manually Installed Kickstart Trees Note that the sub-directory within the tree may be different depending on your distribution. Once this step is complete, you may delete all of the RPM files from the appropriate directory within the tree path. In this example, run the following: rm /var/satellite/custom-distro/rhel-i386-server-5.3-beta/Server/*.rpm The packages are still stored on the Satellite server within the channel and thus are not needed within the kickstart tree.
Provisioning HowTo Figure 1. Creating Kickstart Distribution 5.3. Required distribution files Satellite expects certain files to exist in specified locations within the Kickstart Tree and these locations will differ depending on the architecture of the system. The table below spells out where kernel and initrd are expected to reside for the different architectures. arch kernel initrd image s390x /images/kernel.img /images/initrd.
Required Packages 5.4. Required Packages If using a custom distribution be sure that the packages koan and spacewalk-koan are available within a child channel of the distribution's base channel. These packages are available from any rhntools channel, and you may want to clone an existing rhn-tools channel in order to have access to these packages from your custom channel. 6.
Provisioning HowTo 6.2. Creating Kickstart Profiles RHN Satellite supports two distinct methods of kickstart profile creation: Wizard-based and Raw. Wizard style kickstart profiles are generated and maintained by Satellite logic, with many hooks for user modification of kickstart parameters.
Creating Kickstart Profiles Since the raw kickstart is completely written by the user, the Satellite server does not handle using the specified distro as the url in the kickstart. Because of this, you will want to include your own url -url option. It should look similar to the following: url --url http://satellite.example.com/ks/dist/org/1/my_distro Replace my_distro with the distro label and 1 with your org id.
Provisioning HowTo Figure 2. Raw Kickstart 7. Templating One of the more powerful new features in Satellite 5.3.0 is Cheetah based kickstart templating. With this new capability, you can include variables, snippets (see below), and flow control statements such as for loops and if statements in your kickstart files. 7.1.
Variables httpd mod_ssl mod_python If you want to create a web server profile, include the web server snippet in the %package section of your Kickstart file. If you wanted a profile to be both a web server and a proxy server, you could include both snippets in the package section. Then if you wanted to add another package to the web server snippet, mod_perl for example, by updating the snippet all profiles that are using that snippet would be updated as well.
Provisioning HowTo snippets see the Default Snippet section below. From this page you may also view Snippets created just for your organization on the Custom Snippets tab. You may also create a custom Snippet by clicking on the create new snippet link. Note, default snippets are stored on the Satellite server's file system in /var/lib/cobbler/snippets/ while custom snippets are stored in the /var/ lib/rhn/kickstarts/snippets/ directory.
Snippets For more information, refer to https://fedorahosted.org/cobbler/wiki/KickstartSnippets. 7.3.1. Default Snippets There are many snippets that ship by default and may be used in kickstarts written on or uploaded to the Satellite server. You may want to look at a template from a wizard style kickstart located in /var/ lib/rhn/kickstarts/wizard/ and see what default snippets are used and how they are used. One of the most useful ones is redhat_register.
Provisioning HowTo This option is already included in the wizard style kickstarts, but you may want to include it in the raw kickstarts you create yourself. If you would like more information about Cheetah and the constructs that can be used for writing kickstart templates, the Cheetah User's Guide should be very helpful: http://www.cheetahtemplate.org/docs/users_guide_html/ 8. Kickstarting a Machine 8.1.
Bare Metal 8.1.2.1. Configuring an External DHCP Server To configure your DHCP server (assuming you are using ISC DHCPd) to point to the PXE server, simply add the following to your configuration in /etc/dhcpd.conf: next-server satellite.example.com; filename "pxelinux.0"; Replace satellite.example.com with your Satellite Server's FQDN. After restarting your dhcp server, any clients that attempt to PXE boot will try to use the Satellite server as its PXE server.
Provisioning HowTo 8.1.2.4. Cobbler System Record Cobbler system records are objects within cobbler that keep track of a system and its associated kickstart profile. To do PXE kickstarting you'll need to ensure that a Satellite kickstart profile is tied to Cobbler system records corresponding to the machines you intend to PXE kickstart to that profile. To make this association: 1. Visit the System details page of each system in question and click on the Provisioning link 2.
Virtualized Guest Provisioning For example: • If you want to open up a vnc connection so you can monitor the kickstart remotely, include vnc vncpassword=PASSWORD in the Kernel Options line • If you want the kernel of the resulting system to boot with the noapic kernel option, add noapic to the Post Kernel Options line Note that this requires a system that is accessible over your network and already registered to Satellite.
Provisioning HowTo 1. Ensure the host system has a Virutalization or Virtualization Platform entitlement. 2. Go to the Guest Provisioning page at Systems => click on the desired virtual host => Virtualization => Provisioning 3. Select the kickstart profile you would like and enter a guest name 4. Select Schedule Kickstart and Finish. If you would like to configure additional parameters such as guest memory and cpu usage, simply click on the Advanced Configuration button.
Advanced Topics 9. Advanced Topics 9.1. API Red Hat Satellite 5.3.0 supports provisioning functionality using the XMLRPC API. The API supports everything from scheduling re-provisioning to modifying kickstart trees or profile details. These methods facilitate kickstart profile and tree maintenance: XMLRPC Namespace Usage kickstart create, import, and delete kickstart profiles. Also to list available kickstart trees and profiles. kickstart.tree create, rename, update and delete kickstart trees.
Provisioning HowTo To get a list of profiles run the following command in a terminal on host where the satellite is installed: sudo cobbler profile list To get a list of kicktstart trees (and kernels, initrds, and other options) run: sudo cobbler distro list To get a list of system records (which are created when a kickstart is scheduled) run: sudo cobbler system list To show more detailed output about a specific object, use the "report" command: sudo cobbler profile report --name=profile-name sudo cob
Naming Conventions sudo cobbler system find --profile="abc" | xargs -n1 --replace cobbler system edit --name={} --profile="def" --netboot-enabled=1 Setting an additional templating variable on a profile without modifying any of the other variables sudo cobbler profile edit --name=profilename --kopts="variablename=3" --inplace Assigning various variables to a system record, disregarding old variables that might be set sudo cobbler system edit --name=systemname --kopts="selinux=disabled asdf=jkl" Setting a
Provisioning HowTo 9.5. Other Cobbler settings There are only a few settings that should concern Satellite users. pxe_just_once is mentioned earlier in the PXE section. server: should be set to the address or hostname of the Satellite server. No other settings should be tweaked in /etc/cobbler/settings as Satellite assumes them to be in a certain configuration. The settings file itself is layed down by the Satellite installer. Similarly, /etc/cobbler/modules.
Troubleshooting koan --virt --server=satellite.example.org --system=system-name You can query cobbler to see what is available to install remotely by using one of the following methods: koan --list=profiles --server=satellite.example.org Or: koan --list=systems --server=satellite.example.org 10. Troubleshooting 10.1. Web Interface errors /var/log/tomcat5/catalina.out — Check this logfile first if you get errors in the RHN Satellite WebUI when viewing, scheduling or working with kickstarts.
Provisioning HowTo | | | | +--------------------------------------------------------------+ You can check the following items: 1. Verify httpd is running on your RHN Satellite 2. Verify cobblerd is running 3. Verify you can fetch the above file using wget from a different host. For example: wget http://somehost.example.com/cblr/svc/op/ks/profile/rhel5-i386u3:1:Example-Org 4. run cobbler check from the CLI.
Anaconda content errors +------------------+ Package Installation +------------------+ | | +-------------------------+ Error +--------------------------+ | | | The file chkconfig-1.3.30.1-2.i386.rpm cannot be opened. | | This is due to a missing file, a corrupt package or | | corrupt media. | Please verify your installation source. | | | If you exit, your system will be left in an inconsistent | | state that will likely require reinstallation.
Provisioning HowTo HTTP request sent, awaiting response... 200 OK Length: 0 [text/plain] Saving to: `ks-rhel-i386-server-5-u3.1' 2009-08-19 15:06:55 (0.00 B/s) - `ks-rhel-i386-server-5-u3.1' saved [0/0] If you don't get a 200 response check the error logs. After checking the base URL you can check the actual file Anaconda tried to download: # grep chkconfig /var/log/httpd/access_log 10.10.77.131 - - [19/Aug/2009:15:12:36 -0400] "GET /rhn/common/ DownloadFile.
Registration Issues Subject: WEB TRACEBACK from someserver.example.com Date: Wed, 19 Aug 2009 20:28:01 -0400 From: RHN Satellite To: admin@example.com java.lang.RuntimeException: XmlRpcException calling cobbler. at com.redhat.rhn.manager.kickstart.cobbler.CobblerXMLRPCHelper.invokeMethod(CobblerXML at com.redhat.rhn.taskomatic.task.CobblerSyncTask.execute(CobblerSyncTask.java:76) at com.redhat.rhn.taskomatic.task.SingleThreadedTestableTask.execute(SingleThreadedTest at org.quartz.
Provisioning HowTo rhnreg_ks --serverUrl=https://someserver.example.com/XMLRPC --sslCACert=/ usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --activationkey=1-c8d01e2f23c6bbaedd0f6507e9ac079d # end Red Hat management server registration Breaking this down into the 4 steps you have: 1) mkdir -p /usr/share/rhn/ Creating a directory to house the custom SSL cert used by the RHN Satellite 2) wget http://someserver.example.
Revision History Raw Kickstarts: /var/lib/rhn/kickstarts/upload/$profile_name--$org_id.cfg Wizard Kickstarts: /var/lib/rhn/kickstarts/wizard/$profile_name-$org_id.cfg • Snippets — Cobbler Snippets are stored in /var/lib/rhn/kickstarts/snippets. Cobbler accesses snippets in this structure via a symbolic link in /var/lib/cobbler/snippets callled spacewalk — thus /var/lib/cobbler/snippets/spacewalk.