xCAT部署物理机操作系统


首先我们假定两台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进入自动安装系统了。

本文永久更新链接地址:

相关内容