你好,游客 登录 注册 搜索
背景:
阅读新闻

U盘引导自动化部署ConVirt宿主机

[日期:2012-03-30] 来源:Linux社区  作者:john88wang [字体:大 中 小]

五 ks.cfg文件内容 

  1. #platform=x86, AMD64, or Intel EM64T  
  2. # System authorization information  
  3. auth  --useshadow  --enablemd5   
  4. # System bootloader configuration  
  5. bootloader --location=mbr  --driveorder=sda,sdb   设置系统启动顺序先从sda启动
  6. # Partition clearing information  
  7. clearpart --drives=sda  --all --initlabel   只格式化sda
  8. # Use text mode install  
  9. text  采用文本模式安装
  10. # Firewall configuration  
  11. firewall --enabled --ssh    
  12. # Run the Setup Agent on first boot  
  13. firstboot --disable  
  14. # System keyboard  
  15. keyboard us  
  16. # System language  
  17. lang en_US  
  18. # Installation logging level  
  19. logging --level=info 
  20. # Use HTTP installation media  
  21. url --url http://10.1.14.153/mirror/CentOS56_amd64_part1/  采用网络安装
  22. # Network information  设置静态IP地址,以方便连接到WEB服务器
  23. #####################################################################################  
  24. #####################################################################################  
  25. network --bootproto=static --device=eth0 --gateway=10.1.14.1 --ip=10.1.14.228 --nameserver=10.1.20.10 --netmask=255.255.255.0 --onboot=on  
  26. #####################################################################################  
  27. #####################################################################################  
  28. # Reboot after installation  
  29. reboot  
  30. #Root password  
  31. rootpw --iscrypted $1$QQBcvMTx$PDw5du8L0ikM60Esprmo50  
  32.  
  33. # SELinux configuration  
  34. selinux --enforcing  
  35. # Do not configure the X Window System  
  36. skipx  
  37. # System timezone  
  38. timezone --isUtc Asia/Shanghai  
  39. # Install OS instead of upgrade  
  40. install  
  41. # Disk partitioning information  分区要特别注意,这里采用在一块硬盘上自定义分区
  42. part / --bytes-per-inode=4096 --fstype="ext3" --size=50000  --ondisk=sda 
  43. part swap --bytes-per-inode=4096 --fstype="swap" --recommended  --ondisk=sda 
  44. part /usr --bytes-per-inode=4096 --fstype="ext3" --size=20000   --ondisk=sda 
  45. part /var --bytes-per-inode=4096 --fstype="ext3" --grow --size=1  --ondisk=sda 
  46. %packages   安装必要的软件包
  47. @base  
  48. @core  
  49. kvm 
  50. wget  
  51. dnsmasq   
  52. tunctl  
  53. tcp_wrappers  
  54. expect  
  55. pexpect  
  56.  
  57. %post   执行后安装脚本,需要安装完后执行哪些操作。
  58. cd /etc/yum.repos.d/  
  59. rm -f *.repo  
  60. echo "Downloading  CentOS.repo ..............."  
  61. wget http://10.1.14.153/mirror/ks/CentOS.repo  自己搭建的yum源文件   
  62. rpm -Uvh http://10.1.14.153/mirror/software/socat-1.6.0.1-1.el5.rf.x86_64.rpm  
  63. cd /home  socat必须单独下载,centos的yum源里没有socat
  64. echo "Downloading  ISO image ......"  
  65. wget http://10.1.14.153/mirror/software/win2003auto.iso  要安装的windows2003镜像,convirt支持从本地读取iso安装虚拟机
  66. echo "Downloading  convirture-tool ............"  下载并解压convirt-tools
  67. wget http://10.1.14.153/mirror/software/convirture-tools.tar.gz  
  68. echo "Installing  convirture-tool ..................."  
  69. tar -zxvf convirture-tools.tar.gz  
  70. cd /root  
  71. wget http://10.1.14.153/mirror/ks/convirt-tool-install.sh  
  72. sh convirt-tool-install.sh 
  73. convirt-tool-install里的内容上就是
  74. cd  /home/convirture-tools/install/managed_server/scripts
    ./convirt-tool setup
  75. 因为在后安装脚本执行时总是不能执行./convirt-tool setup所以就只有安装完重启后单独执行操作

 在安装过程中要注意几点:

1,本文是只有一块硬盘,并对一块硬盘进行分区。若安装时有多块硬盘,或要做软RAID,LVM等磁盘格式请按照红帽官方文档介绍进行分区,并且用U盘安装的过程中要确定好U盘得盘符。

2.网络问题,设置正确的IP地址,以使安装过程中能够访问到WEB服务器。

3.post-installation脚本是很头疼的一件事。如果用不好就不要用,里面的脚本只要有一处错误,安装过程就会卡住,影响安装进度。而且执行脚本时会出现莫名奇妙的问题,在本文中可以将后安装脚本放到安装完成以后再执行。在本文中,post-installation里始终不能执行./convirt-tool setup。刚开始以为是执行权限或是chroot的问题,但是还是不行。

4.本文写的不是最终方案。只作参考。

希望能够帮助到更多的人顺利部署111111111111111111111111

linux
相关资讯       ConVirt 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款