📜 ⬆️ ⬇️

Automatic installation of Citrix XenServer

Recently, I became the owner of the HP ProLiant MicroServer N36L server . The fact that it will be Citrix XenServer, it was decided in advance, the more positive experience of installing on this server is the place to be. The installation task was a bit more complicated because I was on vacation. At home, except for beeches and a pair of mice, there is no more computer equipment. And for the installation I would like to have a keyboard that could be brought from work, and a monitor. The problem with the monitor was solved simply, there was a VGA connector on the TV, at home there was a cable for it. I decided to try to install XenServer automatically, watching the installation on TV. Since there is no optical drive on the server, we will install from a flash drive.

First, download XenServer . If Linux virtuals will be installed, then we swing support for them. You will also need a set of Linux kernel bootloaders installed on the local network of a DHCP server, this ZyXEL P-330W EE performs this function for me. It will help to have installed Linux. Well, a flash drive formatted with FAT32.
  1. Unpacking Syslinux. In the command line, in the syslinux \ win32 folder, we execute
    syslinux.exe X: 
    X: is the letter of your removable disk.
    This will make the flash drive bootable.
  2. Unpack the downloaded XenServer on a flash drive, copy the files from the boot \ isolinux folder to the root.
  3. Unpacking the support image for XenServer-xxx-linux-cd linux guest systems. Copy the packages.linux folder to the flash drive.
  4. On the flash drive, rename isolinux.cfg to syslinux.cfg , isolinux.bin to syslinux.bin .
  5. Now we need to create an answer file. Here we have a couple of options. Either the file will be downloaded from somewhere on the network, or located on a flash drive. For the first case, you can use the Web server on the local network. I have Ubuntu on a virtual machine on a beech, in it I raised Apache. The file is called xenserver.xml . The URL to which it will be downloaded http://192.168.1.60/xenserver.xml .
    Inside the file will be the following lines:

    The file itself is here . About creating an answer file you can see here . It is rumored that there are more parameters that can be specified in the answer file than specified in the basic documentation. The main thing for me was that after installation, I could reach the installed XenServer on the network and log in to it.
  6. Now we need to specify that the installer knows that our installation is using an answer file and where to get it. To do this, make a small change to the syslinux.cfg file. Edit it to the following lines:
    LABEL install
    KERNEL mboot.c32
    APPEND / boot / xen.gz dom0_mem = 752M com1 = 115200,8n1 console = com1, vga - / boot / vmlinuz xencons = hvc console = hvc0 console = tty0 - /install.img

    looked like this:
    LABEL install
    KERNEL mboot.c32
    APPEND / boot / xen.gz dom0_mem = 752M com1 = 115200,8n1 console = com1, vga - / boot / vmlinuz xencons = hvc console = hvc0 console = tty0 answerfile = http: //192.168.1.60/xenserver.xml install - install.img
  7. If we now try to boot from the flash drive, then the system curses mboot.c32: not a COM32R image . Therefore, from the syslinux \ com32 \ mboot folder (see item 1), copy and replace the file mboot.c32.
  8. Now everything is ready for installation, we insert the flashdisk into the server, wait for the installation to finish and try to enter it, for example, using Putty via SSH, specifying the IP address from the answer file, entering root and password from the same file. By typing the command xsconsole, we perform additional configuration, password change, etc.

Let's return to the case when the answer file will be on the flash drive. After unpacking the distribution, we will appear on the install.img disk. We will need it, because our answer file must be placed inside this image. We use the installed Ubuntu, well, or "any other" Linux. Unpacking and packing the image did with administrator rights. To unpack install.img let's run:
 gunzip -c ./install.img | cpio -i 
Add in to the unpacked files our xenserver.xml and back pack into the image:
 find . | cpio -o -H newc | gzip > ./install.img 
Put the image back on the flash drive. In Section 6, we edited syslinux.cfg by adding answerfile = http: //192.168.1.60/xenserver.xml install . Instead of this line, we specify answerfile = file: ///xenserver.xml install .

')

Source: https://habr.com/ru/post/123970/


All Articles