1. First, find two versions of the Linux image file, here I am using CentOS-5.11-x86_64-bin-DVD-1of2.iso and CentOS-6.6-x86_64-bin-DVD1.iso, then use the following command to put two mount image files to a specified directory, for example:
sudo mkdir -p /var/ftp/pub/CentOS-5.11
sudo mount -t auto -o loop CentOS-5.11-x86_64-bin-DVD-1of2.iso /var/ftp/pub/CentOS-5.11
sudo mkdir -p /var/ftp/pub/CentOS-6.6
sudo mount -t auto -o loop CentOS-6.6-x86_64-bin-DVD1.iso /var/ftp/pub/CentOS-6.6
You can also modify the fstab, the system automatically mount at startup. I am here to mount them under the ftp directory.
Because relatively slow, so we only behind for CentOS-6.6 to operate.
2. Log into the system, and access to Channels -> Software Channel Management -> Manage Repositories -> create new repository,
Here we need to add two repository
Repository Label *: CentOS-6.6-x86_64
Repository URL *: file: ///var/ftp/pub/CentOS-6.6
The second Repository
Repository Label *: spacewalk_2.2-client_rhel6-x86_64
Repository URL *: http://spacewalk.RedHat.com/yum/2.2-client/RHEL/6/x86_64/
Note: Here you can use the online Repository, such as the definition of the /etc/yum.repos.d/CentOS-Base.repo and /etc/yum.repos.d/epel.repo. But if you use the online Repository, then later doing repo sync time will be very slow, sometimes take several hours to complete the synchronization.
3. Access Channels -> Manage Software Channels -> create new channel, add Channel page fill in the following information
Channel Name *: CentOS-6.6-x86_64
Channel Label *: centos-6.6-x86_64
Channel Summary *: CentOS-6.6-x86_64
4. Access Channels -> Manage Software Channels, step in creating a choice Channel "CentOS-6.6-x86_64", then select "CentOS-6.6-x86_64" and "spacewalk_2.2-client_rhel6-x86_64" in its "Repositories" tab Repository, then "Update Repositories".
Once the implementation of the "Update Repositories", there will be "Sync" tab on this page, then select the "Sync" and then perform the "Sync Now".
* Implementation "Sync Now" is very time-consuming operation, we need to wait a long time to complete. At the command line by viewing the "ps -ef | grep sync" to see if there is no similar "/ usr / bin / python -u / usr / bin / spacewalk-repo-sync --channel centos-5.11-x86_64" process to determine whether execution is completed.
* After performing "Sync Now", in Channels -> Manage Software Channels page list also you will see CentOS-6.6-x86_64 Packages column shows the specific number of packets.
* Alternatively, you can set the timing synchronization operations as required.
5. Create Activation Keys, the Key Client is used to access the Spacewalk server use
Access Systems -> Activation Keys -> create new key
Add-On Entitlements: Select Monitoring and Provisioning
6. Create Kickstartable Distributions
Access Systems -> Kickstart -> Distributions -> create new distribution
Distribution Label *: CentOS-6.6-x86_64
Tree Path *: /var/ftp/pub/CentOS-6.6
Base Channel *: CentOS-6.6-x86_64
Installer Generation *: RHEL6
7. Create Kickstart Profile
Access Systems -> Kickstart -> Kickstart Profiles -> create new kickstart profile
Label *: CentOS6
Base Channel *: CentOS-6.6-x86_64
Kickstartable Tree *: CentOS-6.6-x86_64
Modify Kickstart Profile created just after the completion of
* Select the fifth step created in the Activation Keys in the key
* Scripts to add a register in the script, the reason for this step is because in my environment registration always fails, because missing a few bags, so I added this script to download the required packages
Scripting Language: / bin / bash
Script Name *: my_install_package
sudo yum install -y http://yum.spacewalkproject.org/2.2-client/RHEL/6/x86_64/spacewalk-client-repo-2.2-1.el6.noarch.rpm
sudo yum install -y http://dl.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo yum install -y rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin
sudo yum install -y http://192.168.145.102/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm
Script Execution Time *: Choose Post Script
* In the upper-right corner, select Scripts order kickstart scripts, will my_install_package position just created into the first
8. Since the internal Spacewalk also inherited the Cobbler, so we also need to do some modifications to Cobbler
Here are some special places requiring special treatment
* In this version of Cobbler you can not use "sudo cobbler get-loaders" Installation loader, but you want to use "yum install cobbler-loaders" to install
* Need to manually install the dhcp package "sudo yum install dhcp"
After modifying the configuration Cobbler remember to take effect during the following operations to be performed
sudo /etc/init.d/cobblerd restart
sudo cobbler sync
9. The deployment of Linux systems
9.1 First use "sudo cobbler list" view profile
9.2 and then use the "sudo cobbler system" to add and set up the system
sudo cobbler system add --name = test --profile = CentOS6: 1: SpacewalkDefaultOrganization
sudo cobbler system edit --name = test --interface = eth0 --mac = 08: 00: 27: 2C: 30: 8C --ip-address = 192.168.145.155 --netmask = 255.255.255.0 --static = 1
sudo cobbler system edit --name = test --gateway = 192.168.145.1 --hostname = test
sudo cobbler sync
9.3 install the system. If the physical machine has IPMI, you can remotely boot a physical machine. Here I am using the virtual machine to do the test, so I manually start the virtual machine, then you will see the virtual machine starts automatically install the system.
9.4 Wait for the system installation is complete, you can Spacewalk in the Systems -> Systems -> Physical Systems to view the newly installed machine.