《LINUX實戰:CentOS7.3下利用Cobbler2.8.0安裝部署ESXi 5.5》要點:
本文介紹了LINUX實戰:CentOS7.3下利用Cobbler2.8.0安裝部署ESXi 5.5,希望對您有用。如果有疑問,可以聯系我們。
前言:前一篇提到了如安在CentOS7下利用Cobbler來安裝部署CentOS,沒接觸過的朋友可以參考我上一篇的文章:,現在又測試了下利用cobbler2.8.0部署esxi5.5,參考了網上的一些資料,但與我實際操作中碰到的有些差異,所以特意記錄下來.
1、查看cobbler的版本
[root@cobbler ~]# cobbler --version
Cobbler 2.8.0
? source: ?, ?
? build time: Tue Jan 31 23:25:14 2017
[root@cobbler ~]# cat /etc/RedHat-release?
CentOS Linux release 7.3.1611 (Core)
2、掛載并導入ESXI5.5的數據
[root@cobbler ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
[root@cobbler ~]# cobbler import --path=/mnt --name=EXSI5.5 --arch=x86_64
task started: 2017-03-21_143016_import
task started (id=Media import, time=Tue Mar 21 14:30:16 2017)
# 以下為提示信息,最開始看到的時候嚇我一跳
Found a candidate signature: breed=vmware, version=esxi51
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00: gzip compressed data, was "vmvisor-sys.tar.vtar", from Unix, last modified: Thu Sep 19 14:39:27 2013
received on stderr:?
Found a candidate signature: breed=vmware, version=esxi60
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00: gzip compressed data, was "vmvisor-sys.tar.vtar", from Unix, last modified: Thu Sep 19 14:39:27 2013
received on stderr:?
Found a candidate signature: breed=vmware, version=esxi5
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00: gzip compressed data, was "vmvisor-sys.tar.vtar", from Unix, last modified: Thu Sep 19 14:39:27 2013
received on stderr:?
Found a candidate signature: breed=vmware, version=esxi55
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00: gzip compressed data, was "vmvisor-sys.tar.vtar", from Unix, last modified: Thu Sep 19 14:39:27 2013
received on stderr:?
Found a matching signature: breed=vmware, version=esxi55
Adding distros from path /var/www/cobbler/ks_mirror/EXSI5.5-x86_64:
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/tools.t00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/tools.t00: gzip compressed data, from Unix, last modified: Thu Sep 19 14:38:11 2013
received on stderr:?
creating new distro: EXSI5.5-x86_64
trying symlink: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64 -> /var/www/cobbler/links/EXSI5.5-x86_64
creating new profile: EXSI5.5-x86_64
associating repos
*** TASK COMPLETE ***
[root@cobbler ~]# echo $?
0
闡明:以上的輸出結果可知,導入沒有問題
3、編纂kickstart文件
[root@cobbler ~]# cd /var/lib/cobbler/kickstarts/
[root@cobbler kickstarts]# vim ESXI55.cfg?
# set for install esxi55
vmaccepteula
# 注意如果暗碼長度小于7位,安裝的時候會有報錯的(可惜忘記截圖了)
rootpw redhat123456
clearpart --firstdisk --overwritevmfs
install --firstdisk --overwritevmfs
# 注意網卡名稱為vmnic0
network --bootproto=dhcp --device=vmnic0
reboot --noeject
[root@cobbler kickstarts]# ll
total 64
-rw-r--r-- 1 root root 1254 Mar 20 15:32 CentOS-6.7-x86_64.cfg
-rw-r--r-- 1 root root 1301 Mar 20 12:23 CentOS-7.3-x86_64.cfg
-rw-r--r-- 1 root root? 115 Nov 17 03:09 default.ks
-rw-r--r-- 1 root root? 22 Nov 17 03:09 esxi4-ks.cfg
-rw-r--r-- 1 root root? 184 Mar 21 14:44 ESXI55.cfg
-rw-r--r-- 1 root root? 22 Nov 17 03:09 esxi5-ks.cfg
drwxr-xr-x 2 root root? 56 Mar 20 10:39 install_profiles
-rw-r--r-- 1 root root 1424 Nov 17 03:09 legacy.ks
-rw-r--r-- 1 root root? 292 Nov 17 03:09 pxerescue.ks
-rw-r--r-- 1 root root 2916 Nov 17 03:09 sample_autoyast.xml
-rw-r--r-- 1 root root 1825 Nov 17 03:09 sample_end.ks
-rw-r--r-- 1 root root? ? 0 Nov 17 03:09 sample_esx4.ks
-rw-r--r-- 1 root root? 324 Nov 17 03:09 sample_esxi4.ks
-rw-r--r-- 1 root root? 386 Nov 17 03:09 sample_esxi5.ks
-rw-r--r-- 1 root root 1784 Nov 17 03:09 sample.ks
-rw-r--r-- 1 root root 3419 Nov 17 03:09 sample_old.seed
-rw-r--r-- 1 root root 5879 Nov 17 03:09 sample.seed
說明:可以參考sample_esxi5.ks文件進行編輯
[root@cobbler kickstarts]# cobbler list
distros:
? CentOS-6.7-x86_64
? CentOS-7.3-x86_64
? EXSI5.5-x86_64
profiles:
? CentOS-6.7-x86_64
? CentOS-7.3-x86_64
? EXSI5.5-x86_64
systems:
? cobbler2
repos:
images:
mgmtclasses:
packages:
files:
4、查看cobbler profile
[root@cobbler kickstarts]# cobbler profile report
Name? ? ? ? ? ? ? ? ? ? ? ? ? : CentOS-7.3-x86_64
TFTP Boot Files? ? ? ? ? ? ? ? : {}
Comment? ? ? ? ? ? ? ? ? ? ? ? :?
DHCP Tag? ? ? ? ? ? ? ? ? ? ? : default
Distribution? ? ? ? ? ? ? ? ? : CentOS-7.3-x86_64
Enable gPXE?? ? ? ? ? ? ? ? ? : 0
Enable PXE Menu?? ? ? ? ? ? ? : 1
Fetchable Files? ? ? ? ? ? ? ? : {}
Kernel Options? ? ? ? ? ? ? ? : {'biosdevname': '0', 'net.ifnames': '0'}
Kernel Options (Post Install)? : {}
Kickstart? ? ? ? ? ? ? ? ? ? ? : /var/lib/cobbler/kickstarts/CentOS-7.3-x86_64.cfg
Kickstart Metadata? ? ? ? ? ? : {}
Management Classes? ? ? ? ? ? : []
Management Parameters? ? ? ? ? : <<inherit>>
Name Servers? ? ? ? ? ? ? ? ? : []
Name Servers Search Path? ? ? : []
Owners? ? ? ? ? ? ? ? ? ? ? ? : ['admin']
Parent Profile? ? ? ? ? ? ? ? :?
Internal proxy? ? ? ? ? ? ? ? :?
Red Hat Management Key? ? ? ? : <<inherit>>
Red Hat Management Server? ? ? : <<inherit>>
Repos? ? ? ? ? ? ? ? ? ? ? ? ? : []
Server Override? ? ? ? ? ? ? ? : <<inherit>>
Template Files? ? ? ? ? ? ? ? : {}
Virt Auto Boot? ? ? ? ? ? ? ? : 1
Virt Bridge? ? ? ? ? ? ? ? ? ? : xenbr0
Virt CPUs? ? ? ? ? ? ? ? ? ? ? : 1
Virt Disk Driver Type? ? ? ? ? : raw
Virt File Size(GB)? ? ? ? ? ? : 5
Virt Path? ? ? ? ? ? ? ? ? ? ? :?
Virt RAM (MB)? ? ? ? ? ? ? ? ? : 512
Virt Type? ? ? ? ? ? ? ? ? ? ? : kvm
Name? ? ? ? ? ? ? ? ? ? ? ? ? : CentOS-6.7-x86_64
TFTP Boot Files? ? ? ? ? ? ? ? : {}
Comment? ? ? ? ? ? ? ? ? ? ? ? :?
DHCP Tag? ? ? ? ? ? ? ? ? ? ? : default
Distribution? ? ? ? ? ? ? ? ? : CentOS-6.7-x86_64
Enable gPXE?? ? ? ? ? ? ? ? ? : 0
Enable PXE Menu?? ? ? ? ? ? ? : 1
Fetchable Files? ? ? ? ? ? ? ? : {}
Kernel Options? ? ? ? ? ? ? ? : {}
Kernel Options (Post Install)? : {}
Kickstart? ? ? ? ? ? ? ? ? ? ? : /var/lib/cobbler/kickstarts/sample_end.ks
Kickstart Metadata? ? ? ? ? ? : {}
Management Classes? ? ? ? ? ? : []
Management Parameters? ? ? ? ? : <<inherit>>
Name Servers? ? ? ? ? ? ? ? ? : []
Name Servers Search Path? ? ? : []
Owners? ? ? ? ? ? ? ? ? ? ? ? : ['admin']
Parent Profile? ? ? ? ? ? ? ? :?
Internal proxy? ? ? ? ? ? ? ? :?
Red Hat Management Key? ? ? ? : <<inherit>>
Red Hat Management Server? ? ? : <<inherit>>
Repos? ? ? ? ? ? ? ? ? ? ? ? ? : []
Server Override? ? ? ? ? ? ? ? : <<inherit>>
Template Files? ? ? ? ? ? ? ? : {}
Virt Auto Boot? ? ? ? ? ? ? ? : 1
Virt Bridge? ? ? ? ? ? ? ? ? ? : xenbr0
Virt CPUs? ? ? ? ? ? ? ? ? ? ? : 1
Virt Disk Driver Type? ? ? ? ? : raw
Virt File Size(GB)? ? ? ? ? ? : 5
Virt Path? ? ? ? ? ? ? ? ? ? ? :?
Virt RAM (MB)? ? ? ? ? ? ? ? ? : 512
Virt Type? ? ? ? ? ? ? ? ? ? ? : kvm
Name? ? ? ? ? ? ? ? ? ? ? ? ? : EXSI5.5-x86_64
TFTP Boot Files? ? ? ? ? ? ? ? : {}
Comment? ? ? ? ? ? ? ? ? ? ? ? :?
DHCP Tag? ? ? ? ? ? ? ? ? ? ? : default
Distribution? ? ? ? ? ? ? ? ? : EXSI5.5-x86_64
Enable gPXE?? ? ? ? ? ? ? ? ? : 0
Enable PXE Menu?? ? ? ? ? ? ? : 1
Fetchable Files? ? ? ? ? ? ? ? : {}
Kernel Options? ? ? ? ? ? ? ? : {}
Kernel Options (Post Install)? : {}
Kickstart? ? ? ? ? ? ? ? ? ? ? : /var/lib/cobbler/kickstarts/sample_esxi5.ks
Kickstart Metadata? ? ? ? ? ? : {}
Management Classes? ? ? ? ? ? : []
Management Parameters? ? ? ? ? : <<inherit>>
Name Servers? ? ? ? ? ? ? ? ? : []
Name Servers Search Path? ? ? : []
Owners? ? ? ? ? ? ? ? ? ? ? ? : ['admin']
Parent Profile? ? ? ? ? ? ? ? :?
Internal proxy? ? ? ? ? ? ? ? :?
Red Hat Management Key? ? ? ? : <<inherit>>
Red Hat Management Server? ? ? : <<inherit>>
Repos? ? ? ? ? ? ? ? ? ? ? ? ? : []
Server Override? ? ? ? ? ? ? ? : <<inherit>>
Template Files? ? ? ? ? ? ? ? : {}
Virt Auto Boot? ? ? ? ? ? ? ? : 1
Virt Bridge? ? ? ? ? ? ? ? ? ? : xenbr0
Virt CPUs? ? ? ? ? ? ? ? ? ? ? : 1
Virt Disk Driver Type? ? ? ? ? : raw
Virt File Size(GB)? ? ? ? ? ? : 5
Virt Path? ? ? ? ? ? ? ? ? ? ? :?
Virt RAM (MB)? ? ? ? ? ? ? ? ? : 512
Virt Type? ? ? ? ? ? ? ? ? ? ? : kvm
闡明:由上的輸出結果,我們可以發現, EXSI5.5-x86_64默認的kickstart文件是/var/lib/cobbler/kickstarts/sample_esxi5.ks,顯然這不是我們想要的
[root@cobbler kickstarts]# cobbler profile edit --name=EXSI5.5-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ESXI55.cfg
# 修改EXSI5.5-x86_64默認的kickstart文件為/var/lib/cobbler/kickstarts/ESXI55.cfg,并再次查看
[root@cobbler kickstarts]# cobbler profile report
Name? ? ? ? ? ? ? ? ? ? ? ? ? : CentOS-7.3-x86_64
TFTP Boot Files? ? ? ? ? ? ? ? : {}
Comment? ? ? ? ? ? ? ? ? ? ? ? :?
DHCP Tag? ? ? ? ? ? ? ? ? ? ? : default
Distribution? ? ? ? ? ? ? ? ? : CentOS-7.3-x86_64
Enable gPXE?? ? ? ? ? ? ? ? ? : 0
Enable PXE Menu?? ? ? ? ? ? ? : 1
Fetchable Files? ? ? ? ? ? ? ? : {}
Kernel Options? ? ? ? ? ? ? ? : {'biosdevname': '0', 'net.ifnames': '0'}
Kernel Options (Post Install)? : {}
Kickstart? ? ? ? ? ? ? ? ? ? ? : /var/lib/cobbler/kickstarts/CentOS-7.3-x86_64.cfg
Kickstart Metadata? ? ? ? ? ? : {}
Management Classes? ? ? ? ? ? : []
Management Parameters? ? ? ? ? : <<inherit>>
Name Servers? ? ? ? ? ? ? ? ? : []
Name Servers Search Path? ? ? : []
Owners? ? ? ? ? ? ? ? ? ? ? ? : ['admin']
Parent Profile? ? ? ? ? ? ? ? :?
Internal proxy? ? ? ? ? ? ? ? :?
Red Hat Management Key? ? ? ? : <<inherit>>
Red Hat Management Server? ? ? : <<inherit>>
Repos? ? ? ? ? ? ? ? ? ? ? ? ? : []
Server Override? ? ? ? ? ? ? ? : <<inherit>>
Template Files? ? ? ? ? ? ? ? : {}
Virt Auto Boot? ? ? ? ? ? ? ? : 1
Virt Bridge? ? ? ? ? ? ? ? ? ? : xenbr0
Virt CPUs? ? ? ? ? ? ? ? ? ? ? : 1
Virt Disk Driver Type? ? ? ? ? : raw
Virt File Size(GB)? ? ? ? ? ? : 5
Virt Path? ? ? ? ? ? ? ? ? ? ? :?
Virt RAM (MB)? ? ? ? ? ? ? ? ? : 512
Virt Type? ? ? ? ? ? ? ? ? ? ? : kvm
Name? ? ? ? ? ? ? ? ? ? ? ? ? : CentOS-6.7-x86_64
TFTP Boot Files? ? ? ? ? ? ? ? : {}
Comment? ? ? ? ? ? ? ? ? ? ? ? :?
DHCP Tag? ? ? ? ? ? ? ? ? ? ? : default
Distribution? ? ? ? ? ? ? ? ? : CentOS-6.7-x86_64
Enable gPXE?? ? ? ? ? ? ? ? ? : 0
Enable PXE Menu?? ? ? ? ? ? ? : 1
Fetchable Files? ? ? ? ? ? ? ? : {}
Kernel Options? ? ? ? ? ? ? ? : {}
Kernel Options (Post Install)? : {}
Kickstart? ? ? ? ? ? ? ? ? ? ? : /var/lib/cobbler/kickstarts/sample_end.ks
Kickstart Metadata? ? ? ? ? ? : {}
Management Classes? ? ? ? ? ? : []
Management Parameters? ? ? ? ? : <<inherit>>
Name Servers? ? ? ? ? ? ? ? ? : []
Name Servers Search Path? ? ? : []
Owners? ? ? ? ? ? ? ? ? ? ? ? : ['admin']
Parent Profile? ? ? ? ? ? ? ? :?
Internal proxy? ? ? ? ? ? ? ? :?
Red Hat Management Key? ? ? ? : <<inherit>>
Red Hat Management Server? ? ? : <<inherit>>
Repos? ? ? ? ? ? ? ? ? ? ? ? ? : []
Server Override? ? ? ? ? ? ? ? : <<inherit>>
Template Files? ? ? ? ? ? ? ? : {}
Virt Auto Boot? ? ? ? ? ? ? ? : 1
Virt Bridge? ? ? ? ? ? ? ? ? ? : xenbr0
Virt CPUs? ? ? ? ? ? ? ? ? ? ? : 1
Virt Disk Driver Type? ? ? ? ? : raw
Virt File Size(GB)? ? ? ? ? ? : 5
Virt Path? ? ? ? ? ? ? ? ? ? ? :?
Virt RAM (MB)? ? ? ? ? ? ? ? ? : 512
Virt Type? ? ? ? ? ? ? ? ? ? ? : kvm
Name? ? ? ? ? ? ? ? ? ? ? ? ? : EXSI5.5-x86_64
TFTP Boot Files? ? ? ? ? ? ? ? : {}
Comment? ? ? ? ? ? ? ? ? ? ? ? :?
DHCP Tag? ? ? ? ? ? ? ? ? ? ? : default
Distribution? ? ? ? ? ? ? ? ? : EXSI5.5-x86_64
Enable gPXE?? ? ? ? ? ? ? ? ? : 0
Enable PXE Menu?? ? ? ? ? ? ? : 1
Fetchable Files? ? ? ? ? ? ? ? : {}
Kernel Options? ? ? ? ? ? ? ? : {}
Kernel Options (Post Install)? : {}
Kickstart? ? ? ? ? ? ? ? ? ? ? : /var/lib/cobbler/kickstarts/ESXI55.cfg
Kickstart Metadata? ? ? ? ? ? : {}
Management Classes? ? ? ? ? ? : []
Management Parameters? ? ? ? ? : <<inherit>>
Name Servers? ? ? ? ? ? ? ? ? : []
Name Servers Search Path? ? ? : []
Owners? ? ? ? ? ? ? ? ? ? ? ? : ['admin']
Parent Profile? ? ? ? ? ? ? ? :?
Internal proxy? ? ? ? ? ? ? ? :?
Red Hat Management Key? ? ? ? : <<inherit>>
Red Hat Management Server? ? ? : <<inherit>>
Repos? ? ? ? ? ? ? ? ? ? ? ? ? : []
Server Override? ? ? ? ? ? ? ? : <<inherit>>
Template Files? ? ? ? ? ? ? ? : {}
Virt Auto Boot? ? ? ? ? ? ? ? : 1
Virt Bridge? ? ? ? ? ? ? ? ? ? : xenbr0
Virt CPUs? ? ? ? ? ? ? ? ? ? ? : 1
Virt Disk Driver Type? ? ? ? ? : raw
Virt File Size(GB)? ? ? ? ? ? : 5
Virt Path? ? ? ? ? ? ? ? ? ? ? :?
Virt RAM (MB)? ? ? ? ? ? ? ? ? : 512
Virt Type? ? ? ? ? ? ? ? ? ? ? : kvm
# 進行cobbler數據同步
[root@cobbler ~]# cobbler sync
# 根據mac地址,分配一個固定IP
[root@cobbler ~]# cobbler system add --name=esxi55-01 --mac=00:0C:29:4A:9F:44 --profile=EXSI5.5-x86_64 --ip-address=10.10.10.168 --subnet=255.255.255.0 --gateway=10.10.10.2 --interface=vmnic0 --static=1 --hostname=esxi55-01.saltstack.com --name-servers="10.10.10.2"
闡明:以上的網卡是esxi55客戶機的真實網卡,為它安裝的時候指定一個固定的ip、子網掩碼、網關、主機名、DNS等
[root@cobbler ~]# cobbler system list
? esxi55-01
然后開啟服務器,坐等ESXI5.5安裝完畢
在esxi5.5上配置好ssh后,命令行模式下測試下網絡環境
~ # ping 10.10.10.2
PING 10.10.10.2 (10.10.10.2): 56 data bytes
64 bytes from 10.10.10.2: icmp_seq=0 ttl=128 time=1.044 ms
64 bytes from 10.10.10.2: icmp_seq=1 ttl=128 time=0.691 ms
64 bytes from 10.10.10.2: icmp_seq=2 ttl=128 time=0.624 ms
--- 10.10.10.2 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.624/0.786/1.044 ms
~ # ping www.linuxidc.com
PING www.linuxidc.com (60.215.128.246): 56 data bytes
64 bytes from 60.215.128.246: icmp_seq=0 ttl=128 time=23.509 ms
64 bytes from 60.215.128.246: icmp_seq=1 ttl=128 time=26.123 ms
64 bytes from 60.215.128.246: icmp_seq=2 ttl=128 time=26.520 ms
--- www.linuxidc.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 23.509/25.384/26.520 ms
本文永遠更新鏈接地址:
《LINUX實戰:CentOS7.3下利用Cobbler2.8.0安裝部署ESXi 5.5》是否對您有啟發,歡迎查看更多與《LINUX實戰:CentOS7.3下利用Cobbler2.8.0安裝部署ESXi 5.5》相關教程,學精學透。維易PHP學院為您提供精彩教程。