4.3. Creating Kickstart File

If you plan to perform an unattended installation of Virtuozzo Infrastructure Platform, you can use a kickstart file. It will automatically supply to the Virtuozzo Infrastructure Platform installer the options you would normally choose by hand. Virtuozzo Infrastructure Platform uses the same kickstart file syntax as Red Hat Enterprise Linux.

The following sections describe options and scripts you will need to include in your kickstart file, provide an example you can start from, and explain how to use the kickstart file you have created.

4.3.1. Kickstart Options

Even though your kickstart file may include any of the standard options used in kickstart files for installing Linux operating systems, it is recommended to use the following options with as few changes as possible. Possible variations may include configuration of network adapters: activation, bonding, and VLAN setup.

Listed below are the mandatory options that you must include in a kickstart file.

auth --enableshadow --passalgo=sha512
Specifies authentication options for the Virtuozzo Infrastructure Platform physical server.
autopart --type=lvm

Automatically partitions the system disk, which is sda. This option must follow clearpart --all.

Other disks will be partitioned automatically during cluster creation.

bootloader
Specifies how the boot loader should be installed.
clearpart --all

Removes all partitions from all recognized disks.

Warning

This option will destroy data on all disks that the installer can reach!

keyboard <layout>
Sets the system keyboard type.
lang <lang>
Sets the language to use during installation and the default language to use on the installed system.
logvol
Creates a logical volume for a Logical Volume Management (LVM) group.
network <options>
Configures network devices and creates bonds and VLANs.
raid
Creates a software RAID volume.
part
Creates a partition on the server.
rootpw --iscrypted <passwd>
Sets the root password for the server. The value is your password’s hash obtained with the algorithm specified in the --passalgo parameter. For example, to create a SHA-512 hash of your password, run python -c 'import crypt; print(crypt.crypt("yourpassword"))'.
selinux --disabled
Disables SElinux, because it prevents virtualization from working correctly.
services --enabled="chronyd"
Enables time synchronization via NTP.
timezone <timezone>
Sets the system time zone. For a list of time zones, run timedatectl list-timezones.
volgroup
Creates a Logical Volume Management (LVM) group.
zerombr

Initializes disks with invalid partition tables.

Warning

This option will destroy data on all disks that the installer can reach!

4.3.2. Kickstart Scripts

After setting the options, add scripts to the kickstart file that will install the mandatory package group and Storage components.

4.3.2.1. Installing Packages

In the body of the %packages script, specify the package group hci to be installed on the server:

%packages
@^hci
%end

4.3.2.2. Installing Admin Panel and Storage

Only one admin panel is required, install it on the first node only. To deploy all other nodes, you will need to obtain a token from a working admin panel. For more information, see the Choosing Components to Install.

To install the admin panel and storage components on the node without exposing the superadmin password and storage token in the kickstart file, do the following:

  1. Add the %addon com_vstorage script to the kickstart file:

    %addon com_vstorage --management --bare
    %end
    
  2. Once the installation is complete, execute the following command on the node to configure the admin panel component:

    echo <superadmin_password> | /usr/libexec/vstorage-ui-backend/bin/configure-backend.sh \
    -i <private_iface> -x <public_iface>
    

    where

    • <superadmin_password> is the password of the superadmin account of admin panel,
    • <private_iface> is the name of the private network interface (the one you would choose for the management network during attended installation),
    • <public_iface> is the name of the public network interface (the one you would choose for the admin panel network during attended installation).
  3. Start the admin panel service:

    # systemctl start vstorage-ui-backend
    
  4. If you also installed the storage component on the node, execute the following command:

    # /usr/libexec/vstorage-ui-agent/bin/register-storage-node.sh -m <management_IP_address>
    

To install the components without running scripts afterwards at the expense of exposing the password and token, specify the interfaces for the public (external) and private (internal) networks and the password for the superadmin account of the admin panel in the kickstart file. For example:

%addon com_vstorage --management --internal-iface=<private_iface> \
--external-iface=<public_iface> --password=<password>
%end

4.3.2.3. Installing Storage Component Only

The storage component alone, without the admin panel, is installed by default and does not require any scripts in the kickstart file unless you want to specify the token.

If you do not want to expose the token in the kickstart file, run the following command on the node after the installation to register the node in the admin panel:

# /usr/libexec/vstorage-ui-agent/bin/register-storage-node.sh -m <MN_IP_address> -t <token>

where

  • <token> is the token that can be obtained in the admin panel,
  • <MN_IP_address> is the IP address of the private network interface on the node with the admin panel.

To install the storage component without running scripts afterwards at the expense of exposing the token, specify the token and the IP address of the node with the admin panel in the kickstart file. For example:

%addon com_vstorage --storage --token=<token> --mgmt-node-addr=<MN_IP_address>
%end

4.3.3. Kickstart File Example

Below is an example of kickstart file that you can use to install and configure Virtuozzo Infrastructure Platform in the unattended mode. You can use this file as the basis for creating your own kickstart files.

Important

This kickstart file instructs the installer to erase and automatically partition every disk that it recognizes. Make sure to disconnect any disks with useful data prior to installation.

# Use the SHA-512 encryption for user passwords and enable shadow passwords.
auth --enableshadow --passalgo=sha512
# Use the US English keyboard.
keyboard --vckeymap=us --xlayouts='us'
# Use English as the installer language and the default system language.
lang en_US.UTF-8
# Specify the encrypted root password for the node.
rootpw --iscrypted xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Disable SELinux.
selinux --disabled
# Enable time synchronization via NTP.
services --enabled="chronyd"
# Set the system time zone.
timezone America/New_York

# Specify a hostname for the node.
network --hostname=<hostname>

# Configure network interfaces via DHCP.
network --device=<iface1> --activate
network --device=<iface2> --activate
# Alternatively, assign static addresses to network interfaces.
#network --device=<iface1> --activate --bootproto=static --ip=<IP_addr> \
#--netmask=<mask> --gateway=<gw> --nameserver=<ns1>[,<ns2>,...]
#network --device=<iface2> --activate --bootproto=static --ip=<IP_addr> \
#--netmask=<mask> --gateway=<gw> --nameserver=<ns1>[,<ns2>,...]

# If needed, uncomment and specify network interfaces to create a bond.
#network --device=bond0 --bondslaves=<iface1>,<iface2> \
#--bondopts=mode=balance-xor,miimon=100,xmit_hash_policy=layer3+4

# Erase all partitions from all recognized disks.
# WARNING: Destroys data on all disks that the installer can reach!
clearpart --all --initlabel
zerombr
# Automatically partition the system disk, which is 'sda'.
autopart --type=lvm

# Install the required packages on the node.
%packages
@^hci
%end

# Uncomment to install the admin panel and storage components.
# Specify an internal interface for the management network and
# an external interface for the admin panel network.
#%addon com_vstorage --management --internal-iface=eth0 \
#--external-iface=eth1 --password=xxxxxxxxx
#%end

# Uncomment to install the storage component. To register the node,
# specify the token as well as the IP address of the admin panel.
#%addon com_vstorage --storage --token=xxxxxxxxx --mgmt-node-addr=10.37.130.1
#%end

4.3.3.1. Creating the System Partition on Software RAID1

To create a system partition on a software RAID1 volume, you will need to do the following instead of using autopart:

  1. Partition the disks.
  2. Create a RAID1 volume.
  3. Create swap and root LVM volumes.

It is recommended to create RAID1 from disks of the same size as the volume equals the size of the smallest disk.

The following example for a BIOS-based server partitions the disks sda and sdb, assembles the software RAID1 array, and creates expandable swap and root LVM volumes:

# Create partitions on sda.
part biosboot  --size=1     --ondisk=sda --fstype=biosboot
part raid.sda1 --size=256   --ondisk=sda --fstype=ext4
part raid.sda2 --size=39936 --ondisk=sda --grow
# Create partitions on sdb.
part biosboot   --size=1     --ondisk=sdb --fstype=biosboot
part raid.sdb1  --size=256   --ondisk=sdb --fstype=ext4
part raid.sdb2  --size=39936 --ondisk=sdb --grow
# Create software RAID1 from sda and sdb.
raid /boot --level=RAID1 --device=md0 --fstype=ext4 raid.sda1 raid.sdb1
raid pv.01 --level=RAID1 --device=md1 --fstype=ext4 raid.sda2 raid.sdb2
# Make LVM volumes for swap and root partitions.
volgroup vgsys pv.01
logvol swap --fstype=swap --name=swap --vgname=vgsys --recommended
logvol /    --fstype=ext4 --name=root --vgname=vgsys --size=10240 --grow
# Set the RAID device md0 as the first drive in the BIOS boot order.
bootloader --location=mbr --boot-drive=sda --driveorder=md0
bootloader --location=mbr --boot-drive=sdb --driveorder=md0

For installation on EFI-based servers, specify the /boot/efi partition instead of biosboot.

part /boot/efi --size=200 --ondisk={sda|sdb} --fstype=efi