Skip to Content
VMWARE錦囊妙計第二版
book

VMWARE錦囊妙計第二版

by Ryan Troy, Matthew Helmke
April 2013
Beginner to intermediate
368 pages
6h 45m
Chinese
GoTop Information, Inc.
Content preview from VMWARE錦囊妙計第二版
268
|
第七章
7.5 使用 %pre 的進階安裝腳本
問題
您想在 Kickstart 組態配置執行之前執行額外腳本,或是設定它將執行的環境。
解決方案
Kickstart 的命令與 Bash shell 命令放到 Kickstart 組態配置的
%pre
落。
討論
Kickstart 組態配置文件的
%pre
段落,您可以指定在 Kickstart 組態配置被解析後想執
行的命令。使用
%pre
段落,您可以擷取與您的系統有關的特定變數,像是磁碟型態,
並且建立一個基於磁碟的分割區架構。舉例來說,如果您想在 Dell 伺服器與 HP 伺服器
上使用相同的 Kickstart 文件,您可以在
%pre
段落檢查目前使用哪一種磁碟類型,並且
進行對應的磁碟分割。
讓我們檢視一種簡單的可能作法,當在設定網路配置時,下列的命令使用一些標準 Unix
文字解析,以確定 bootp 裡的 ESXi 伺服器網路資訊:
%pre –interpreter=busybox
VMK_INT="vmk0"
VMK_LINE=$(localcli network ip interface ipv4 get | grep "${VMK_INT}")
I
PADDR=$(echo "${VMK_L
I
NE}" | awk '{pr
i
nt $2}')
NETMASK=$(echo "${VMK_LINE}" | awk '{print $3}')
GATEWAY=$(esxcfg-route | awk '{print $5}')
DNS="172.30.0.100,172.30.0.200" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly
深度學習|內行人的做法

深度學習|內行人的做法

Josh Patterson, Adam Gibson

Publisher Resources

ISBN: 9789862767443