ESXi kickstart: различия между версиями

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску
Строка 25: Строка 25:
   
   
  +
==пример установочного конфига==
  +
<PRE>
  +
# Sample scripted installation file
  +
# Accept the VMware End User License Agreement
  +
vmaccepteula
  +
# Set the root password for the DCUI and ESXi Shell
  +
rootpw mypassword
  +
# Install on the first local disk available on machine
  +
install --firstdisk --overwritevmfs
  +
# Set the network to DHCP on the first network adapater, use the specified hostname and do not create a portgroup for the VMs
  +
network --bootproto=dhcp --device=vmnic0 --addvmportgroup=0
  +
# reboots the host after the scripted installation is completed
  +
reboot
  +
  +
  +
  +
%firstboot --interpreter=busybox
  +
# Add an extra nic to vSwitch0 (vmnic2)
  +
esxcli network vswitch standard uplink add --uplink-name=vmnic2 --vswitch-name=vSwitch0
  +
#Assign an IP-Address to the first VMkernel, this will be used for management
  +
esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=192.168.1.41 --netmask=255.255.255.0 --type=static
  +
# Add vMotion Portgroup to vSwitch0, assign it VLAN ID 5 and create a VMkernel interface
  +
esxcli network vswitch standard portgroup add --portgroup-name=vMotion --vswitch-name=vSwitch0
  +
esxcli network vswitch standard portgroup set --portgroup-name=vMotion --vlan-id=5
  +
esxcli network ip interface add --interface-name=vmk1 --portgroup-name=vMotion
  +
esxcli network ip interface ipv4 set --interface-name=vmk1 --ipv4=192.168.2.41 --netmask=255.255.255.0 --type=static
  +
# Enable vMotion on the newly created VMkernel vmk1
  +
vim-cmd hostsvc/vmotion/vnic_set vmk1
  +
# Add new vSwitch for VM traffic, assign uplinks, create a portgroup and assign a VLAN ID
  +
esxcli network vswitch standard add --vswitch-name=vSwitch1
  +
esxcli network vswitch standard uplink add --uplink-name=vmnic1 --vswitch-name=vSwitch1
  +
esxcli network vswitch standard uplink add --uplink-name=vmnic3 --vswitch-name=vSwitch1
  +
esxcli network vswitch standard portgroup add --portgroup-name=Production --vswitch-name=vSwitch1
  +
esxcli network vswitch standard portgroup set --portgroup-name=Production --vlan-id=10
  +
# Set DNS and hostname
  +
esxcli system hostname set --fqdn=esxi5.localdomain
  +
esxcli network ip dns search add --domain=localdomain
  +
esxcli network ip dns server add --server=192.168.1.11
  +
esxcli network ip dns server add --server=192.168.1.12
  +
# Set the default PSP for EMC V-MAX to Round Robin as that is our preferred load balancing mechanism
  +
esxcli storage nmp satp set --default-psp VMW_PSP_RR --satp VMW_SATP_SYMM
  +
# Enable SSH and the ESXi Shell
  +
vim-cmd hostsvc/enable_ssh
  +
vim-cmd hostsvc/start_ssh
  +
vim-cmd hostsvc/enable_esx_shell
  +
vim-cmd hostsvc/start_esx_shell
  +
</PRE>
 
==Links==
 
==Links==
 
* http://www.virtuallyghetto.com/2010/09/automating-esxi-41-kickstart-tips.html
 
* http://www.virtuallyghetto.com/2010/09/automating-esxi-41-kickstart-tips.html

Версия 19:14, 20 марта 2012

ESXi kickstart file

  • ESX можно установить с файлом ответов.
  • Существует файл ответа по умолчанию, который установит ESX без лишних вопросов, с паролем root = mypassword.
  • Так же, можно подложить свой файл ответов, как и раньше по сети, или на USB флешке.


Создание своего образа

  • Скачать ESXi ISO
  • Подмонтировать образ:
mount -o loop VMware-VMvisor-Installer-5.x.x-XXXXXX.x86_64.iso /esxi_cdrom_mount
  • Cкопировать содержимое
cp -r /esxi_cdrom_mount /esxi_cdrom
cp ks_custom.cfg /esxi_cdrom
  • исправить boot.cfg file в соответвии с требованиеми (см. ниже)
  • Пересоздать образ.
mkisofs -relaxed-filenames -J -R -o custom_esxi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table /esxi_cdrom


пример установочного конфига

# Sample scripted installation file
# Accept the VMware End User License Agreement
vmaccepteula
# Set the root password for the DCUI and ESXi Shell
rootpw mypassword
# Install on the first local disk available on machine
install --firstdisk --overwritevmfs
# Set the network to DHCP on the first network adapater, use the specified hostname and do not create a portgroup for the VMs
network --bootproto=dhcp --device=vmnic0 --addvmportgroup=0
# reboots the host after the scripted installation is completed
reboot

 

%firstboot --interpreter=busybox
# Add an extra nic to vSwitch0 (vmnic2)
esxcli network vswitch standard uplink add --uplink-name=vmnic2 --vswitch-name=vSwitch0
#Assign an IP-Address to the first VMkernel, this will be used for management
esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=192.168.1.41 --netmask=255.255.255.0 --type=static
# Add vMotion Portgroup to vSwitch0, assign it VLAN ID 5 and create a VMkernel interface
esxcli network vswitch standard portgroup add --portgroup-name=vMotion --vswitch-name=vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name=vMotion --vlan-id=5
esxcli network ip interface add --interface-name=vmk1 --portgroup-name=vMotion
esxcli network ip interface ipv4 set --interface-name=vmk1 --ipv4=192.168.2.41 --netmask=255.255.255.0 --type=static
# Enable vMotion on the newly created VMkernel vmk1
vim-cmd hostsvc/vmotion/vnic_set vmk1
# Add new vSwitch for VM traffic, assign uplinks, create a portgroup and assign a VLAN ID
esxcli network vswitch standard add --vswitch-name=vSwitch1
esxcli network vswitch standard uplink add --uplink-name=vmnic1 --vswitch-name=vSwitch1
esxcli network vswitch standard uplink add --uplink-name=vmnic3 --vswitch-name=vSwitch1
esxcli network vswitch standard portgroup add --portgroup-name=Production --vswitch-name=vSwitch1
esxcli network vswitch standard portgroup set --portgroup-name=Production --vlan-id=10
# Set DNS and hostname
esxcli system hostname set --fqdn=esxi5.localdomain
esxcli network ip dns search add --domain=localdomain
esxcli network ip dns server add --server=192.168.1.11
esxcli network ip dns server add --server=192.168.1.12
# Set the default PSP for EMC V-MAX to Round Robin as that is our preferred load balancing mechanism
esxcli storage nmp satp set --default-psp VMW_PSP_RR --satp VMW_SATP_SYMM
# Enable SSH and the ESXi Shell
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell

Links