Product SiteDocumentation Site

5.9. Advanced Topics

5.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:
XML-RPC 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.
kickstart.filepreservation list, create, and delete file preservation lists that can be associated to a kickstart profile. Note: once a file preservation list has been created, it can be associated to a kickstart profile by calling the kickstart.profile.system.add_file_preservations API method.
kickstart.keys list, create, and delete cryptography keys (GPG/SSL) that can be associated to different kickstart profiles. Note: once a cryptography key has been created, it can be associated to a kickstart profile by calling the kickstart.profile.system.add_keys API method.
kickstart.profile manipulate IP ranges, change the kickstart tree and the child channels channel, download kickstart file associated to a profile, manipulate advanced options, manipulate custom options, and add pre/post scripts associated to a kickstart profile.
kickstart.profile.keys list, add (associate), and remove (disassociate) activation keys associated to a kickstart profile.
kickstart.profile.software manipulate the list of packages associated to a kickstart profile.
kickstart.profile.system manage file preservations, manage cryptography keys, enable/disable config management and remote commands, setup partitioning schemes, and setup locale information associated to a given kickstart profile.
Table 5.2. XML-RPC Methods

Additionally, the following API methods calls may be used to re-provision a host and schedule guest installs.
  • system.provision_system
  • system.provision_virtual_guest
For more information on these API calls and others refer to the API documentation available on https://sat FQDN/rhn/rpc/api replacing sat FQDN with your Satellite server.

5.9.2. Cobbler On the Command Line

Satellite uses Cobbler to facilitate provisioning. When the kickstart profiles, trees (distributions) and systems for provisioning are updated in satellite, they are synchronized to the Cobbler instance on the Satellite host. This means that you can use cobbler directly to manage their provisioning if you prefer.
To get a list of profiles run the following command in a shell on host where the satellite is installed:
sudo cobbler profile list
To get a list of kicktstart trees (and kernels, ramdisks, 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 cobbler system report --name=system-name
Various parameters can be tweaked just as with the Satellite Web UI, for instance, asking that each virtualized install of a given profile get 1 GB of RAM:
sudo cobbler profile edit --name=profile-name --virt-ram=1024

5.9.3. Cobbler Command Line: Next Steps

Setting a system (see pxe_just_once above) to be reinstalled at next reboot:
sudo cobbler system edit --name=system-name --netboot-enabled=1
Assigning a system to a new profile for reinstallation:
sudo cobbler system edit --name=system-name --profile=new-profile-name --netboot-enabled=1
Listing all systems assigned to a particular profile:
sudo cobbler system find --profile=profile-name
Assigning all systems currently set to the "abc" profile to the "def" profile and reinstalling them the next time they power cycle:
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" --in-place
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 all new installs of any profile containing webserver as a string to use a profile named RHEL5-i386 instead of RHEL 4 for any new installs:
sudo cobbler profile find --name="*webserver*" | xargs -n1 --replace cobbler profile edit --name={} --profile="RHEL5-i386"
Generating a net install ISO to install systems that cannot PXE:
sudo cobbler buildiso [--help]

5.9.4. Naming Conventions

Satellite manipulates Cobbler distributions, profiles, and systems. To help keep data in sync between itself and Cobbler, Satellite relies on some naming conventions for these object types:
  • distributions: $tree_name:$org_id:$org_name (if manually created)
    Or $tree_name (if synced by Satellite Sync)
  • profiles: $profile_name:$org_id:$org_name
You will encounter these names if you choose to interact with Cobbler directly at the command line. Note that it is important that you do not alter Satellite generated names so long as you want to allow Satellite to maintain the objects in question.

Note

Satellite does not create or recognize Cobbler "repo" objects. Satellite's equivalent derives from its notion of channels and is a function of a layer of logic over them. It takes the form of a special URL which Cobbler is made to use instead.

5.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.conf, which controls authentication sources, should remain as installed by the Satellite installer. (The authentication module choice must remain authn_spacewalk and is not changeable).
After changing /etc/cobbler/settings (such as the server parameter or pxe_just_once) it is important to run the following so that the settings take effect:
sudo /sbin/service cobblerd restart
sudo cobbler sync

5.9.6. Using Koan directly

koan (kickstart over a network) is a client utility that lets you invoke Satellite's (and Cobbler's) functionality remotely from already provisioned hosts. With it you can exercise kickstart provisioning, create virtual guests (on VM hosts), and list the kickstarts available from the Satellite host. It is available in the koan package.
You can read the koan manpage by running:
man koan
You can re-provision an existing system using koan by using one of the following methods:
koan --replace-self --server=satellite.example.org --profile=profile-name
Or:
koan --replace-self --server=satellite.example.org --system=system-name
Reboot after running the above command to install the new OS. This can also be used with upgrade kickstarts if desired (for instance, to upgrade a large number of machines between RHEL 4 and RHEL 5)
You can provision a virtual guest by using one of the following methods:
koan --virt --server=satellite.example.org --profile=profile-name
Or:
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