Configure and install the Linux System for Spacewalk

Source: Internet
Author: User

Configure and install the Linux System for Spacewalk

In the previous article, we introduced the installation and Account creation of Spacewalk (see). This article describes how to configure Spacewalk and use it to install Linux.

1. First find two versions of Linux image files, here I am using CentOS-5.11-x86_64-bin-DVD-1of2.iso and CentOS-6.6-x86_64-bin-DVD1.iso, and then use the following command to mount these two image files to the specified directory, such:

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 fstab to enable automatic mount when the system starts. Here I mount them to the ftp directory.

Because it is slow, we will only operate on CentOS-6.6 later.

2. log on to the system and access Channels> Software Channel Management> Manage Repositories> create new repository,

Here we need to add two repository

First Repository
Repository Label *: CentOS-6.6-x86_64
Repository URL *: file: // var/ftp/pub/CentOS-6.6

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: online Repository can be used here, such as defined in/etc/yum. repos. d/CentOS-Base.repo and/etc/yum. repos. d/epel. repo. However, if you use online Repository, the subsequent repo sync will be very slow, and sometimes it may take several hours to complete synchronization.

3. Access Channels-> Manage Software Channels-> create new channel. On the Add Channel page, enter the following information:

Channel Name *: CentOS-6.6-x86_64
Channel Label *: centos-6.6-x86_64
Architecture: x86_64
Channel Summary *: CentOS-6.6-x86_64

4. access Channels-> Manage Software Channels, select the Channel "CentOS-6.6-x86_64" created in the previous step, and then select CentOS-6.6-x86_64 and spacewalk_2.2-client_rhel6-x86_64 Repository under its Repositories tab, then "Update Repositories ".

After "Update Repositories" is executed, the "Sync" label will appear on this page. Select "Sync" and then execute "Sync Now ".

Note:

* Executing "Sync Now" is a very time-consuming operation that takes a long time to complete. You can check "ps-ef | grep sync" on the command line to see if there is something like "/usr/bin/python-u/usr/bin/spacewalk-repo-sync -- channel centos-5.11-x86_64" to determine whether the execution is complete.

* After "Sync Now" is executed, the Packages column of the CentOS-6.6-x86_64 is displayed in the list on the Channels-> Manage Software Channels page.

* In addition, you can also set scheduled synchronization operations as needed.

5. Create Activation Keys. This Key is used by the Client to access the Spacewalk server.

Access Systems-> Activation Keys-> create new key

Description: my_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 a Kickstart Profile
Access Systems-> Kickstart Profiles-> create new kickstart profile

Label *: CentOS6
Base Channel *: CentOS-6.6-x86_64
Kickstartable Tree *: CentOS-6.6-x86_64

Modify the Kickstart Profile just created.
* In Activation Keys, select the key created in step 5.
* Add a register script in Scripts. The reason for this is that the registration fails in my environment because several packages are missing, so I added this script to download the required package.

Scripting Language:/bin/bash
Script Name *: my_install_package
Script Contents:
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 *: Select Post Script

* In Scripts, select order kickstart scripts in the upper-right corner and put the position of my_install_package just created in the first place.

8. Because Spacewalk also inherits Cobbler, we also need to modify Cobbler. For more information, see my two articles.

Special actions are needed here.
* In this version of Cobbler, you cannot use "sudo cobbler get-loaders" to install the loader. Instead, you must use "yum install cobbler-loaders" to install the loader.
* You need to manually install the dhcp software package "sudo yum install dhcp"

After modifying the Cobbler configuration, remember to perform the following operations to take effect.

Sudo/etc/init. d/cobblerd restart
Sudo cobbler sync

9. Deploy the Linux System

9.1 first use "sudo cobbler list" to view the profile

9.2 then use "sudo cobbler system" to add and set 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 start the physical machine. Here I use the Virtual Machine for testing, so I manually start the virtual machine, then we can see that the virtual machine starts to automatically install the system.

9.4 after the system installation is complete, you can view the newly installed machines in the Systems> Physical Systems of Spacewalk.

Spacewalk details: click here
Spacewalk: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.