首先我們假定兩台xCAT機器,機器名和ip地址分別如下
xcat master
hostname: xcat
ip: 192.168.31.102
xcat node
hostname: xcat1
ip: 192.168.31.251
具體操作步驟如下:
1. 創建本地操作系統安裝文件
chtab key=master site.value='<host ip>'copycds -n CentOS5.11 -a x86_64 CentOS-5.11-x86_64-bin-DVD-1of2.iso CentOS-5.11-x86_64-bin-DVD-2of2.iso
copycds -n centos6.6 -a x86_64 CentOS-6.6-x86_64-bin-DVD1.iso CentOS-6.6-x86_64-bin-DVD2.iso
2. 配置 master 屬性
chtab key=master site.value='<host ip>'
3. 配置password,可以使用“tabdump passwd”查看
chtab key=system passwd.username=root passwd.password=Letmein
4. 配置節點
nodeadd xcat1 \
groups=compute,all \
mac.interface=eth0 \
mac.mac=08:00:27:2C:30:8C \
hosts.ip=192.168.31.251 \
noderes.netboot=pxe \
noderes.xcatmaster=192.168.31.102 \
noderes.installnic=eth0 \
noderes.primarynic=eth0 \
noderes.nfsserver=192.168.31.102 \
nodetype.os=centos6.6 \
nodetype.arch=x86_64 \
nodetype.profile=compute \
nodetype.nodetype=osi
添加完成後可以使用下面的命令來查看各種信息
tabdump nodelist
tabdump nodetype
tabdump noderes
tabdump mac
tabdump hosts
5. 配置host
makehosts
配置後/etc/hosts文件內容大致如下
127.0.0.1 localhost
192.168.31.102 xcat
192.168.31.251 xcat1
6. 配置DHCP
makedhcp -n
配置後在我的環境裡dhcpd啟動會有問題,所以我做了下面修改
* 在/etc/dhcp/dhcpd.conf文件中刪除下面幾行
zone . {
primary NORESOLUTION; key xcat_key;
}
zone 31.168.192.IN-ADDR.ARPA. {
primary NORESOLUTION; key xcat_key;
}
* 編輯/etc/init.d/dhcpd文件,將
user=dhcpd
group=dhcpd
改為
user=root
group=root
然後重新啟動dhcpd服務
/etc/init.d/dhcpd restart
7. 設置部署系統
nodeset xcat1 install
此時可以看到類似下面的輸出結果,說明xcat1機器將會安裝centos6.6-x86_64-compute
xcat1: install centos6.6-x86_64-compute
如果我們需要修改安裝的系統可以使用下面的命令來修改
chtab node=xcat1 \
nodetype.os=centos5.11 \
nodetype.arch=x86_64 \
nodetype.profile=compute \
nodetype.nodetype=osi
nodeset xcat1 install
此時可以看到xcat1機器將會安裝centos5.11-x86_64-compute
xcat1: install centos5.11-x86_64-compute
8. 由於使用的是虛擬機做測試,沒有IPMI功能,所以我們只能手動啟動xcat1機器,然後就會發現xcat1進入自動安裝系統了。