6

VMware ESXi 自动化部署实践

 2 years ago
source link: https://wsgzao.github.io/post/esxi/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

VMware ESXi 本身部署就很简单,任何人分分钟钟即可掌握,但是在短时间内需要部署几十台 ESXi 就显得力不从心了,本文主要介绍通过镜像定制 kickstart 自动化部署 ESXi,PXE 网络部署可参考扩展阅读部分。

让 ESXi 的部署速度再快一点


2015 年 10 月 22 日 - 初稿

阅读原文 - https://wsgzao.github.io/post/esxi/

VMware - http://www.vmware.com/support.html
(周剑辉)VMware vSphere 5.1 学习系列之三:安装 ESXi - http://m.educity.cn/linux/1149107.html
Autoinst 索引 - https://wsgzao.github.io/index/#Autoinst


下载 ESXi 镜像

经验证 ESXi 5 和 6 均可使用此方法

ESXi 版本:VMware-VMvisor-Installer-5.5.0.update02-2718055.x86_64-Dell_Customized-A05.iso

其它版本下载地址:https://my.vmware.com/web/vmware/downloads

配置自动化文件

ks.cfg

#
# Sample scripted installation file
#

# Accept the VMware End User License Agreement
vmaccepteula

# Set the root password for the DCUI and Tech Support Mode
rootpw vmware

# Install on the first local disk available on machine
install --firstdisk --overwritevmfs

# Set the network to DHCP on the first network adapter
network --bootproto=dhcp --device=vmnic0

# Reboot at the end
reboot

# A sample post-install script
%post --interpreter=python --ignorefailure=true
import time
stampFile = open('/finished.stamp', mode='w')
stampFile.write( time.asctime() )

ISOLINUX.CFG

DEFAULT menu.c32
MENU TITLE Dell-ESXi-5.5U2-2718055-A05 Boot Menu
NOHALT 1
PROMPT 0
TIMEOUT 80
LABEL install
KERNEL mboot.c32
APPEND -c boot.cfg ks=cdrom:/KS.CFG
MENU LABEL Dell-ESXi-5.5U2-2718055-A05 ^Installer
LABEL hddboot
LOCALBOOT 0x80
MENU LABEL ^Boot from local disk

整合镜像文件

整合工具我使用 UltraISO,下载地址如下

https://wsgzao.github.io/post/windows/# 光盘刻录

  1. Windows 下使用 UltraISO 打开官方镜像
  2. 把 ks.cfg 和 ISOLINUX.CFG 添加并覆盖至根目录
  3. 点击保存即可

Linux 编译保存镜像请参考官方手册
http://pubs.vmware.com/vsphere-55/topic/com.vmware.vsphere.install.doc/GUID-C03EADEA-A192-4AB4-9B71-9256A9CB1F9C.html

  1. 建议先通过 VMware Workstation 模拟测试
  2. 在生产环境中验证可行性

GitHub 源码 - https://github.com/wsgzao/autoinstall/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK