您的位置:首页 > 运维架构 > Linux

CentOS 6.3 安装和配置cobbler(3)ubuntu篇

2013-05-17 17:02 106 查看

八:Ubuntu 12.04

cobbler上装ubuntu,是一个技术活,基本很难找到一篇完整的文档,尤其一些高级的设置。下面很多设置都是参考ubuntu里的Maas对cobbler的设置。1:导入ISO经过测试,是可以直接使用ubuntu 12.04的导入的iso,作为安装源,完成安装。
mount -t auto -o loop /root/ubuntu-12.04-server-amd64.iso /mnt
# cobbler import --path=/mnt --name=ubuntu12.04
task started: 2012-08-08_101200_import
task started (id=Media import, time=Wed Aug  8 10:12:00 2012)
Found a debian/ubuntu compatible signature: pool
adding distros
avoiding symlink loop
creating new distro: ubuntu12.04-x86_64
creating new profile: ubuntu12.04-x86_64
avoiding symlink loop
skipping import, as distro name already exists: ubuntu12.04-x86_64
avoiding symlink loop
avoiding symlink loop
associating repos
traversing distro ubuntu12.04-x86_64
descent into /var/www/cobbler/ks_mirror/ubuntu12.04
associating kickstarts
skipping /var/www/cobbler/ks_mirror/ubuntu12.04/dists/stable
skipping /var/www/cobbler/ks_mirror/ubuntu12.04/dists/precise
skipping /var/www/cobbler/ks_mirror/ubuntu12.04/dists/unstable
*** TASK COMPLETE ***
对于ubuntu来说,就没那么幸运,导入的distro和profile,是有问题的
cobbler distro report --name=ubuntu12.04-x86_64
cobbler profile report --name=ubuntu12.04-x86_64
2:修改distro默认的是错误,一定要修改。
cobbler distro edit --name=ubuntu12.04-x86_64 \
--kernel=/var/www/cobbler/ks_mirror/ubuntu12.04/install/netboot/ubuntu-installer/amd64/linux \
--initrd=/var/www/cobbler/ks_mirror/ubuntu12.04/install/netboot/ubuntu-installer/amd64/initrd.gz \
--os-version=precise
3:脚本我根据ubuntu的Maas,提取了他的pressed文件,修改了一下,可以直接下载使用:ubuntu.preseed这个preseed文件的分区,大家可以调整。里面有两种分区的方案,我注释掉了默认的分区方案。
cd /var/lib/cobbler/kickstarts
wget http://www.chenshake.com/wp-content/uploads/2012/08/ubuntu.preseed.txt mv ubuntu.preseed.txt ubuntu.preseed
由于ubuntu.preseed文件,用到几个snippets,所以需要创建/var/lib/cobbler/snippets/orchestra_disable_pxe
wget "http://$http_server:$http_port/cblr/svc/op/nopxe/system/$system_name" -O /dev/null \
/var/lib/cobbler/snippets/orchestra_proxy
# Point apt to orchestra-provisioning-server's squid
d-i     mirror/country string manual
d-i     mirror/http/hostname string $http_server
d-i     apt-setup/security_host string $http_server
d-i     apt-setup/security_path string /ubuntu
d-i     mirror/http/directory string /ubuntu
d-i     mirror/http/proxy stringhttp://@@server@@:3128/
设置静态IP地址由于cobbler没有提供脚本来设置静态IP,所以这个需要自己想办法. static.sh 脚本 ,注意,这个脚本,有一个地方你是需要修改,就是你的网段。我的网段是10.1.199.0,你改成你的网段才可以。
mkdir /var/www/html/post
cd /var/www/html/post
wget http://www.chenshake.com/wp-content/uploads/2012/08/static.sh_.txt mv static.sh_.txt static.sh
我的ubuntu.preseed 已经调用了这个脚本。
4:设置proflie增加kernel option,关联ubuntu preseed
cobbler profile edit --name=ubuntu12.04-x86_64 \
--kopts="log_port=514 priority=critical locale=en_US log_host=10.1.199.12 netcfg/choose_interface=auto " \
--kickstart=/var/lib/cobbler/kickstarts/ubuntu.preseed
5:设置本地源直接使用导入的光盘作为源
ln -s /var/www/cobbler/ks_mirror/ubuntu12.04 /var/www/html/ubuntu
这样就可以顺利完成安装。不过你登陆安装完的机器,运行 apt-get update, 就会发现问题,彻底的解决办法,就是同步一个ubuntu 12.04的本地源。这是一个体力活,全部的ubuntu 12.04 的源,一共120G,10M带宽,需要2天时间。http://www.chenshake.com/centos6-x-production-of-ubuntu12-04-source/这就是我使用的脚本,下载的本地源。存放在 /home/ubuntu 下。需要链接到web可以访问的目录
ln -s /home/ubuntu /var/www/html/ubuntu
6:安装客户端这个就和centos基本是一样。唯一的区别就是需要指定ubuntu
cobbler system  add \
--name=node15 \
--hostname=node15.chenshake.com  \
--dns-name=node15.chenshake.com \
--profile=ubuntu12.04-x86_64 \
--interface=eth0 \
--mac=00:25:90:67:CE:28 \
--interface=eth0 \
--ip-address=10.1.199.15 \
--subnet=255.255.255.0 \
--gateway=10.1.199.1 \
--static=1 \
--power-type=ipmilan \
--power-user=ADMIN \
--power-pass=ADMIN \
--power-address=10.1.199.215
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: