CloudStack 製做 CentOS 模板

Cloudstack 製做Centos 模板linux

也是在系統之上的操做;shell

選擇ISO建立實例;進去系統以後作一些基本設置;關閉SELinux 和敵對網絡的設置;若是是自動獲取的網絡即可以如此設置網卡參數;bash

    一、網絡設置網絡

對於初始的設置能夠先保證網絡正常,基於我的的實驗平臺我這樣設置;ide

vi /etc/sysconfig/network-scripts/ifcfg-eth0 工具

DEVICE=eth0優化

TYPE=Ethernetspa

ONBOOT=yes3d

NM_CONTROLLED=no日誌

BOOTPROTO=dhcp

wKiom1R0WKeBZ-2dAACz58LzBYA971.jpg

wKioL1R0WSeiPFH-AABLY1Igwrs111.jpg

[root@test35 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=dhcp

    二、設置SELINUX=disabled

[root@test35 ~]# vi/etc/selinux/config

wKiom1R0WKuR6LMoAAHA7iqBbPA778.jpg

    三、而後進行安裝一些服務 ntp acpid ntpdate wget expect

 expect是一個簡單的工具語言,如要工做就是進行自動化的人機交互。Expect 自動交互式腳本命令  相似 Linux bash shell;

主機可以鏈接網絡的時候能夠直接yum 安裝這些;

[root@test35 ~]#yum install ntp acpid wget expect -y

啓動服務正常然後chkconfig 設置開機啓動;

wKioL1R0WTCQI1z6AAF4ZBWJ1HM624.jpg

四、下載隨機密碼腳本;

[root@test35 ~]# wget http://download.cloud.com/templates/4.2/bindir/cloud-set-guest-password.in

wget http://download.cloud.com/templates/4.2/bindir/cloud-set-guest-password.in

wKiom1R0WLihCl0WAANbwM-695c464.jpg

五、移動腳本自/etc/init.d/  (重命名了)

[root@test35 ~]# mv cloud-set-guest-password.in /etc/init.d/cloud-set-guest-password

賦予可執行的權限

[root@test35 ~]# chmod +x /etc/init.d/cloud-set-guest-password

六、而後刪除MAC與網卡綁定;這個系統啓動的時候能夠自動刪除;

[root@test35 ~]# rm -f /etc/udev/rules.d/70-persistent-net.rules

wKioL1R0WTzTeJzVAAEpYfv8DRQ654.jpg

七、清除指令記錄

history -c

關閉實例而後查看卷直接建立爲模板就能夠了

(實際應該還有不少的日誌文件須要刪除  和更改  是系統作到優化極致)

相關文章
相關標籤/搜索