Automatic installation of the operating system on dedicated Selectel servers

  • Tutorial
Automatic installation of the operating system on dedicated Selectel servers

In the previous article, we already talked about managing the load of dedicated servers and promised to show something even more interesting. We are pleased to introduce a fully automatic installation of the operating system on dedicated servers.

For many of our customers, installing the OS on the server seems troublesome and not very interesting. Usually, our engineers did this, spending more and more time with an increase in the number of servers and clients. Therefore, it was decided to fully automate this process, while making it as flexible and simple as possible for the client.

It was also decided to slightly diversify the format of the articles and show the whole process in the form of a screencast (at the end of the article) on the example of installing the recently released CentOS 6.4.

The original entry is published on our blog .

Perhaps the easiest howto to install the OS


We start naturally with the server profile - open the list of servers, find the desired server and go to it. Be sure to assign an IPv4 address to the server, if this has not been done before.

Automatic OS installation on dedicated Selectel servers

Next, go to the server reinstallation page and specify the data necessary for installation:
  • Hostname of the server; by default, a unique server number of the form csNNNN is registered;
  • We choose the OS distribution in accordance with your requirements and personal preferences;
  • OS architecture (bitness), we recommend x86_64 if you do not have special requirements;
  • OS version, we recommend the latest release (for Ubuntu the latest LTS release).


Automatic installation of the operating system on dedicated servers

The choice of type of software RAID will be considered in more detail. Most of our dedicated servers have two or more hard drives, but there is no hardware RAID controller. Therefore, we strongly recommend that our customers use software RAID1 (mirroring) or RAID10 (mirroring plus striping, but this raid requires 4+ drives) to increase data storage reliability. For the same reason, we refused to add the RAID0 option (striping), since when using it and if one of the HDD fails, all the information stored on the server will be lost. Total currently available:

  • Without RAID, we recommend using if there is only one disk in the server or when using a hardware RAID controller. Installation will be performed on the first disk, the rest will be left unallocated;
  • RAID1 will be assembled an array of the first 2 disks, the remaining disks will be left unallocated;
  • RAID10 uses the first 4 disks, the rest will be left unallocated.


Please note that you should not try to build RAID10 on a server with 1 disk, the OS installer most likely will not understand this joke. It is not possible to take into account all possible combinations of servers, especially considering arbitrary configuration servers. Therefore, in this matter we rely on your prudence.

Further, the last, but very important stage is the choice of disk layout. Required partitions: / boot (1 GB), / (at least 5 GB), swap (at least 4 GB). You can add any number of sections and delete them. For each section, the size in GB is indicated, and one of the sections must be marked to fill in the space. As a file system, we recommend using ext4 by default, also note that some operating systems impose certain restrictions on the choice of FS.

Automatic installation of the operating system on dedicated servers

After selecting and checking all the settings, click “Start reinstallation” and confirm in the dialog box. Once again, we pay attention to the fact that upon reinstallation, all data from all disks is deleted. Even if you selected “No RAID” partitioning on a server with 4 disks, all 4 disks will be erased. This is necessary since most installers go into a stupor when finding the remnants of RAID / LVM metadata on disks during their partitioning.

Automatic OS installation on dedicated servers

Immediately after confirmation, the server will reboot through IPMI and begin loading the appropriate OS installer over the network. The reinstallation page will be blocked during the installation of the OS, a corresponding message will be displayed in its place. If you understand that the server made a mistake, you can abort the installation at any time by clicking the “Cancel reinstallation” button. In this case, the server will immediately reboot, and network download will switch to boot from the first hard drive. The installation process can be monitored through the KVM console, a link to which is on the same page.

Automatic OS installation on Selectel servers

Server installation takes 5-10 minutes, depending on server performance and OS distribution. To reduce installation time and increase reliability, our mirror.selectel.ru mirror is used. If during the installation of the server any error occurred, for example, Internet access was interrupted, then first try to restart the server, the installation will start again. If this does not help, then contact tech support through the ticket system, they will certainly help you.

So, the server has booted up and is ready for further configuration and operation.

Automatic installation of the operating system on dedicated Selectel servers

All systems are installed in the lowest possible configuration by default, no system settings are changed unless absolutely necessary. On all systems, only the ssh server is automatically installed and turned on. The installation password can be viewed after installation on the server reinstallation page, with each reinstallation a new password is generated. When installing the Ubuntu OS, the root user is disabled, a user is created with the username 'user', in all other systems the user is one - 'root'. Also, we always recommend that you change your password after installing the server, create a new user and disable ssh root access for the user.

Automatic OS installation on dedicated Selectel servers

Screencast





Technical FAQ



How are drives marked up? Partitioning drives uses LVM and mdraid:
  • No RAID
    • sda1 / boot 1GB;
    • sda2 PV for LVM;
    • all other sections as LV inside vg0;
  • RAID1
    • sda1, sdb1- md0 RAID1 / boot 1GB;
    • sda2, sdb2- md1 RAID1 PV for LVM;
    • all other LV partitions inside vg0;
  • RAID10
    • sda1-sdd1- RAID1 / boot 1GB;
    • sda2-sdd2- RAID10 PV for LVM;
    • all other sections as LV inside vg0.


Why LVM? Using LVM adds flexibility when editing partitions, makes it relatively easy to resize, merge, add, and delete partitions. Also, the use of LVM made it possible to unify installation patterns and circumvent some problems when marking disks (there was no need to use extended partitions and their numbering).

Why is / boot separate and so big? Most operating systems recommend moving the / boot partition separately when using LVM or RAID for the root partition. 1GB is not much at all - it is ~ 0.2% of a 500GB drive (the minimum non-SSD drive available for our servers). At the same time, this is enough to store several tens of ordinary kernels with initrd or several dev kernels, the size of which can exceed 200MB. Given that resizing the / boot partition is extremely troublesome, we decided not to be greedy.

I want to leave free space on the disk, but I can’t uncheck the “fill in the space” checkbox. Is this a bug? No, this is not a bug, most installers require stretching one of the partitions to all free space. As a solution to the problem, we recommend creating a dummy partition, marking it with the “fill in space” checkbox and deleting it after installing the system.

How it works? All systems are installed by their regular installers using preseed, kickstart or autoyast, depending on the distribution. Currently available:
  • Debian 6, 7;
  • Ubuntu from 12.04 to 13.04;
  • CentOS current versions from branches 5. * and 6. *;
  • RedHat Enterprise Linux 6.4 without a license (purchased separately);
  • OpenSUSE 12.3.

Also popular now: