3,150 瀏覽數

VMware – PXE


基本上所有的 Linux 安裝我都是透過 PXE ,所以其他類似 Linux 的作業系統,如 XenServer 或是 VMware 以及 RHEV 都是同樣可以如法泡製的,詳細的 PXE 設定與安裝請先自行參考 PXE Installation

首先要找到可以從 PXE 開機的 Kernel 和 initrd 檔案並修改 tftp 的 default 的設定值即可,我們先來看看 default 的設定值 (RHEL6 預設的 tftp 路徑為 /var/lib/tftpboot ,其他如 RHEL 4/5 預設路徑為 /tftpboot)

[root@benjr ~]# vi /var/lib/tftpboot/linux-install/pxelinux.cfg/default

VMware 的 ESXi 3 / 4 的 Kernel 在光碟的根目錄 (/) 下,其檔案名稱為 mboot.c32 而 initrd 則為 vmkernel.gz 同樣是在根目錄 (/) 下.

  • vmware esxi 3.5

    label esxi3.5
    kernel vmware-esxi-3.5/mboot.c32
    append vmware-esxi-3.5/vmkernel.gz — vmware-esxi-3.5/binmod.tgz — vmware-esxi-3.5/ienviron.tgz — vmware-esxi-3.5/cim.tgz — vmware-esxi-3.5/oem.tgz — vmware-esxi-3.5/license.tgz — vmware-esxi-3.5/install.tgz
    
  • vmware esx 4

    label esx4
    kernel vmware-esx-4/vmlinuz
    append initrd=vmware-esx-4/initrd.img vmkopts=debugLogToSerial:1 mem=512M askmethod
    
  • vmware esxi 4

    label esxi4
    kernel vmware-esxi-4/mboot.c32
    append vmware-esxi-4/vmkboot.gz — vmware-esxi-4/vmkernel.gz — vmware-esxi-4/sys.vgz — vmware-esxi-4/cim.vgz — vmware-esxi-4/ienviron.tgz — vmware-esxi-4/image.tgz — vmware-esxi-4/install.tgz 
    
  • vmware esxi 4.1

    雖然 esxi4 與 esxi4.1 的設定方式差不多,但 esxi4.1 會出現問題 "The system has found a problem on your machine and cannot continue. Could not populate the filesystem: Boot image is corrupted"

    label esxi4.1
    kernel vmware-esxi-4.1/mboot.c32
    append vmware-esxi-4.1/vmkboot.gz — vmware-esxi-4.1/vmkernel.gz — vmware-esxi-4.1/sys.vgz — vmware-esxi-4.1/cim.vgz — vmware-esxi-4.1/ienviron.vgz — vmware-esxi-4.1/install.vgz — vmware-esxi-4.1/image.tgz
    

    vmware_esxi_4.1.0
    查了原因,大概是 ESXi 4.1 開始支援 PXE + Kickstart 自動的安裝方式.參考了 PXE boot VMware ESXi 4.1 and Manual Install 設定方式,主要我們需要修改 image.tgz 檔.

    [root@benjr ~]# mkdir –p usr/lib/vmware/installer/
    [root@benjr ~]# cp  /var/lib/tftpboot/linux-install/vmware-esxi-4.1/imagedd.bz2 usr/lib/vmware/installer
    [root@benjr ~]# cd usr/lib/vmware/installer
    [root@benjr installer]# mv imagedd.bz2 VMware-VMvisor-big-260247-x86_64.dd.bz2
    [root@benjr installer]# tar –cvzf image.tgz usr/lib/vmware/installer
    [root@benjr installer]# cp image.tgz /var/lib/tftpboot/linux-install/vmware-esxi-4.1
    
  • vmware esxi 5

    VMware ESXi5 的 initrd 已經變得稍微不一樣,反而是用 boot.cfg 來取代原先的 vmkernel.gz 這個檔案.

    label esxi5
    kernel vmware-esxi-5/mboot.c32
    append -c vmware-esxi-5/boot.cfg
    

    boot.cfg 好複雜完全不知道下面這些參數的用途.

    [root@benjr vmware-esxi-5]# cat boot.cfg 
    bootstate=0
    title=Loading ESXi installer
    prefix=/vmware-esxi-5/
    kernel=tboot.b00
    kernelopt=runweasel
    modules=b.b00 — useropts.gz — k.b00 — a.b00 — brcdprov.v00 — net-bna.v00 — scsi-bfa.v00 — emulex-c.v00 — ima-be2i.v00 — net-be2n.v00 — scsi-be2.v00 — scsi-lpf.v00 — fupb.v00 — concrete.v00 — filetran.v00 — fwupdate.v00 — hwckvm.v00 — immpasst.v00 — pciinfo.v00 — soibms.v00 — LSIProvi.v00 — ima-qla4.v00 — provider.v00 — ata-pata.v00 — ata-pata.v01 — ata-pata.v02 — ata-pata.v03 — ata-pata.v04 — ata-pata.v05 — ata-pata.v06 — ata-pata.v07 — block-cc.v00 — ehci-ehc.v00 — s.v00 — weaselin.i00 — ilfu.v00 — ipmi-ipm.v00 — ipmi-ipm.v01 — ipmi-ipm.v02 — misc-cni.v00 — misc-dri.v00 — net-bnx2.v00 — net-bnx2.v01 — net-cnic.v00 — net-e100.v00 — net-e100.v01 — net-enic.v00 — net-forc.v00 — net-igb.v00 — net-ixgb.v00 — net-nx-n.v00 — net-qlge.v00 — net-r816.v00 — net-r816.v01 — net-s2io.v00 — net-sky2.v00 — net-tg3.v00 — ohci-usb.v00 — sata-ahc.v00 — sata-ata.v00 — sata-sat.v00 — sata-sat.v01 — sata-sat.v02 — sata-sat.v03 — scsi-aac.v00 — scsi-adp.v00 — scsi-aic.v00 — scsi-bnx.v00 — scsi-fni.v00 — scsi-hps.v00 — scsi-ips.v00 — scsi-meg.v00 — scsi-meg.v01 — scsi-meg.v02 — scsi-mpt.v00 — scsi-mpt.v01 — scsi-mpt.v02 — scsi-qla.v00 — scsi-qla.v01 — uhci-usb.v00 — tools.t00 — ibmcusto.v00 — imgdb.tgz — imgpayld.tgz
    build=
    updated=0
    
  • VMware vSphere 6.0

    透過 PXE 安裝 ESXi 如同 VMware vSphere 5 ,如果檔案室放置於 tftp 服務上記得修改 boot.cfg 檔案,裡面 modules 指定檔案位置預設都是根目錄,必須將 “/" 移除.要不然會發生 xx 檔案 not found .

    [root@benjr vmware-esxi-6]# cat boot.cfg 
    bootstate=0
    title=Loading ESXi installer
    prefix=/vmware-esxi-6/
    timeout=5
    kernel=tboot.b00
    kernelopt=runweasel
    modules=b.b00 --- jumpstrt.gz --- useropts.gz --- k.b00 --- chardevs.b00 --- a.b00 --- user.b00 --- uc_intel.b00 --- uc_amd.b00 --- sb.v00 --- s.v00 --- mtip32xx.v00 --- ata_pata.v00 --- ata_pata.v01 --- ata_pata.v02 --- ata_pata.v03 --- ata_pata.v04 --- ata_pata.v05 --- ata_pata.v06 --- ata_pata.v07 --- block_cc.v00 --- ehci_ehc.v00 --- elxnet.v00 --- emulex_e.v00 --- weaselin.t00 --- esx_dvfi.v00 --- ima_qla4.v00 --- ipmi_ipm.v00 --- ipmi_ipm.v01 --- ipmi_ipm.v02 --- lpfc.v00 --- lsi_mr3.v00 --- lsi_msgp.v00 --- lsu_hp_h.v00 --- lsu_lsi_.v00 --- lsu_lsi_.v01 --- lsu_lsi_.v02 --- lsu_lsi_.v03 --- lsu_lsi_.v04 --- misc_cni.v00 --- misc_dri.v00 --- net_bnx2.v00 --- net_bnx2.v01 --- net_cnic.v00 --- net_e100.v00 --- net_e100.v01 --- net_enic.v00 --- net_forc.v00 --- net_igb.v00 --- net_ixgb.v00 --- net_mlx4.v00 --- net_mlx4.v01 --- net_nx_n.v00 --- net_tg3.v00 --- net_vmxn.v00 --- nmlx4_co.v00 --- nmlx4_en.v00 --- nmlx4_rd.v00 --- nvme.v00 --- ohci_usb.v00 --- qlnative.v00 --- rste.v00 --- sata_ahc.v00 --- sata_ata.v00 --- sata_sat.v00 --- sata_sat.v01 --- sata_sat.v02 --- sata_sat.v03 --- sata_sat.v04 --- scsi_aac.v00 --- scsi_adp.v00 --- scsi_aic.v00 --- scsi_bnx.v00 --- scsi_bnx.v01 --- scsi_fni.v00 --- scsi_hps.v00 --- scsi_ips.v00 --- scsi_meg.v00 --- scsi_meg.v01 --- scsi_meg.v02 --- scsi_mpt.v00 --- scsi_mpt.v01 --- scsi_mpt.v02 --- scsi_qla.v00 --- uhci_usb.v00 --- xhci_xhc.v00 --- tools.t00 --- xorg.v00 --- imgdb.tgz --- imgpayld.tgz
    build=
    updated=0
    

2 個網友的想法 “VMware – PXE

  1. 自動參照通知: VMware esxi 無 Video (螢幕)輸出的安裝方式 | Benjr.tw

  2. mboot.c32 not a com32r image
    遇過 mboot.c32 not a com32r image 的錯誤訊息,或是其他不能載入 Kernel ,ramdisk 時可以直接更新 mboot.c32 或是 pxelinux.0 看看. 這兩的檔案都可以在 syslinux 上找到

    mboot.c32 is a comboot module for Syslinux that loads images using the Multiboot protocol.

發表迴響