Installing VMware ESXi 4.1 without KVM using hetzner.de as an example

    As you can see from the header, there is a Hetzner.de server, namely the EQ4 model, 8 gigabytes of memory, the customer needs to deploy exactly 3 virtual machines, 2 Linux and 1 windows on this host, since in fact 3 of these hosts will not be mega-loaded, then the configuration is just right. On Hetzner.de there is the possibility of installing VMware ESXi 4.1, which they don’t even hide (and don’t advertise as well), you just need to indicate this when ordering a server and politely add +45 euro, 24 for an Intel network card, and 21 more for KVM.
    This instruction is not tied to Hetzner.de, but is implemented using its example.

    We ordered the network and everything is as it should, even the iron raid, it just so happened that they raised the server for us, but they didn’t connect the KVM, either it was the end of the working day, or someone stepped hard, it doesn’t matter, but I have it in my hands it turned out to be quite a working server (though they forgot to initialize the raid too).



    In the meantime


    I did not want to sleep at all, and I decided to poke esxi on the topic of different installation methods, as it turned out there were enough options:
    • from disk
    • from a flash drive
    • using PXE
    It’s annoying that not a single option for “white” people just suited me, but I also learned useful things from this micro-intelligence.
    The ESXi installer is based on RedHat anaconda and supports kickstart, which in turn makes it possible to install the hypervisor in unattended mode and all this works fine for all of the installation types listed above, in addition to this, you can also customize the installation image by adding, for example, iron support , which is considered unsupported in the original installation manner, and so on for nothing, what else to add (ssh, ftp). And for all these manipulations, good people wrote a script, which you can download here , and read about it in detail here.. By the last link you will be taken to a forum where there is simply a lot of information on this very “modding”.

    This miracle script is focused on debian-based systems (but it works on others), so without thinking twice, I rolled the fifth Debian server onto a fresh server (looking ahead I will say that I made the / boot partition 1GB in size). After installation, I downloaded the script, and the original installation image, after reading the docks how to use it, I settled on the option of creating a custom iso image (why I will tell you later iso).
    The goal was to create an image that silently installs the hypervisor, simultaneously configuring the network, setting the root password, the hostname, and also silently goes into reboot.

    I performed all operations under the root and in his own home directory (forgive me the guru)

    Create a custom installation image

    in order to enable ssh and ftp, I went here and downloaded the customization archive (by name you guess which one, there are also many other customizations) in / root, also after the first launch of the script, he created the directory (/ root / custom- esx and a few others, however, as practice has shown, the script will then clean up leaving behind only 2 directories / root / custom-esx and / root / save in which it will carefully put the new image)

    First, I created the kickstart
    ks.cfg file with the contents: and save it in /root/custom-esx/etc/vmware/weasel/ks.cfg example.com/vm - the external address that allows you to find the decompressed image, Why is not the image itself put you ask? It's simple - the installation will take place to put it mildly in a strange way (more on that later)
    vmaccepteula
    rootpw mysupersecretpass
    autopart --firstdisk --overwritevmfs
    install url example.com/vm
    network --bootproto=static --ip=192.0.2.4 --gateway=192.0.2.1 --hostname=esxi.example.com --device=vmnic0 --nameserver=192.0.2.98 --netmask=255.255.255.192
    reboot






    I also changed the bootloader config (the original can be found in the root of the installation image under the name isolinux.cfg)

    isolinux.cfg contains: Here are all the necessary files prepared, now run the script. We select: 1) ISO installation further [3] 4.1 And we answer questions when it comes to editing proftpd.conf. We open another console and copy isolinux.cfg to / root / esx-build with the original replaced, return to the first console and continue to answer questions, the script swears at the absence of 2 files, just skip them, this is not critical. We are waiting for the image to be created. It will be in / root / save
    default menu.c32
    menu title VMware VMvisor Boot Menu
    timeout 5

    label Kickstart debug
    menu label ^ESXi Installer (default KS)
    kernel mboot.c32
    append vmkboot.gz ks=file:///etc/vmware/weasel/ks.cfg --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz --- oem.tgz












    We finished the way, I think it’s not worth reminding that it will need to be unpacked on an external host, so that the files would be available at example.com/vm

    Now actually how to install it

    We will use GRUB, but since the rude cannot load images from the iso image, we need an additional utility that
    must be saved in / boot.

    We also edit /boot/grub/menu.lst.

    Add a section: the root value depends on the disk layout on your server; we change the default parameter 1 copy iso from / root / save / to /boot/esxiсustom.iso We reboot the server: (we drink coffee / tea, smoke, dance with a tambourine) Underline what is needed . As an indicator, you can start ping in another console, after two ping breaks, you can connect to fresh ESXi via ssh or via vSphere Client (only for Windows). That's just it, that's all, do not judge strictly. Comments are welcome.
    title ESXi Installation from ISO
    root (hd0,0)
    kernel /boot/memdisk iso raw
    initrd /boot/esxiсustom.iso













    I hope someone comes in handy.

    As you can see, iso is mounted through an external Pribluda, and the installer is smart and will not install anything without finding a physical disk, so you have to connect an external web server to this epic.

    There was also an idea to cheat and force the script to put everything on a hard instead of a usb flash card, but here a script that meticulously calculates usb devices was already smart, but there was no desire to bathe in tons of bash code (the script is large enough).

    Sources


    benincosa.org/blog/?p=171
    blog.nettraptor.net/?p=26
    www.vm-help.com

    UPD1:
    In the case of a hatzner, you will need to ask for additional ip addresses to assign MAC addresses with a note that this is for vmware esxi, in this case you will be able to avoid hemorrhaging by bridging and other chips, if you order an entire subnet, then be prepared to spend 2 addresses (1 additional and one from the subnet) for the

    UPD2 virtual router :
    I express my gratitude to:
    thelostreason BigD helios deniskin and also moderators,
    for troubleshooting and formatting, grammar and punctuation errors

    Also popular now: