sudo mkdir -p /var/ftp/pub/CentOS5 sudo mount -t auto -o loop CentOS-5.11-x86_64-bin-DVD-1of2.iso /var/ftp/pub/CentOS5 sudo mkdir -p /var/ftp/pub/CentOS6 sudo mount -t auto -o loop CentOS-6.6-x86_64-bin-DVD1.iso /var/ftp/pub/CentOS6
第一个 Repository
Repository Label*: CentOS6_repo
Repository URL*: file:///var/ftp/pub/CentOS6 或 ftp://192.168.145.102/pub/CentOS6
第二个 Repository
Repository Label*: spacewalk_2.2-client_rhel6_repo
Repository URL*: http://spacewalk.redhat.com/yum/2.2-client/RHEL/6/x86_64/
Channel Name*: CentOS6_channel Channel Label*: centos6_channel Architecture: x86_64 Channel Summary*: CentOS6_channel
Description: my_key Add-On Entitlements: 选中 Monitoring 和 Provisioning
Distribution Label*: CentOS6_dist Tree Path*: /var/ftp/pub/CentOS6 Base Channel*: CentOS6_channel Installer Generation*: RHEL6
Label*: CentOS6 Base Channel*: CentOS6_channel Kickstartable Tree*: CentOS6_dist
redhat_management_server: 192.168.145.102
sudo /etc/init.d/cobblerd restart sudo cobbler sync
9. 部署Linux系统
9.1 首先使用 "sudo cobbler list" 来查看 profile
9.2 然后使用 “sudo cobbler 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 sync9.3 安装系统。如果物理机有IPMI,可以远程启动物理机。这里我使用的虚拟机做测试,所以我是手动启动虚拟机,此时就会看到虚拟机开始自动安装系统了。
10. 注册系统
10.1 访问 Systems -> Systems -> 选中机器 -> Software -> Software Channels
查看有没有关联 Channel,如果没有可以选择一个,比如上面的创建的 “CentOS6_channel”。
10.2 登录到新安装的系统上运行
yum install -y http://yum.spacewalkproject.org/2.2-client/RHEL/6/x86_64/spacewalk-client-repo-2.2-1.el6.noarch.rpm yum install -y http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum install -y rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin spacewalk-oscap yum install -y http://<spacewalk_server>/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm rhnreg_ks --serverUrl=http://<spacewalk_server>/XMLRPC --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --activationkey=<activation_key>
* 其中 <spacewalk_server> 是spacewalk所在机器,<activation_key>是在Activation Keys里创建的key
10.3 等待系统安装完成后,就可以在 Spacewalk 的 Systems -> Systems -> Physical Systems 查看新安装的机器了。