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, teaming/bonding, and VLAN setup.
Listed below are the mandatory options that you must include in a kickstart file.
| Option | Description |
|---|---|
auth --enableshadow --passalgo=sha512 |
Specifies authentication options for the Virtuozzo Infrastructure Platform physical server. |
autopart --type=lvm |
Automatically partitions the system disk, which is Note Other disks will be partitioned automatically during cluster creation. |
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. |
network <options> |
Configures network devices and creates bonds/teams and VLANs. |
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. |
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 Management Panel and Storage¶
Only one management 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 management panel. For more information, see the Choosing Virtuozzo Infrastructure Platform Components to Install.
To install the management panel and storage components on the node without exposing the superadministrator password and storage token in the kickstart file, do the following:
Add the
%addon com_vstoragescript to the kickstart file:%addon com_vstorage --management --storage --bare %end
If you do not want to install the storage component on the same node, omit the
--storageoption.Once the installation is complete, execute the following command on the node to configure the management 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 management 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 management panel network during attended installation).
Start the management panel service:
# systemctl start vstorage-ui-backend
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 management panel in the kickstart file. For example:
%addon com_vstorage --internal-iface=<private_iface> --external-iface=<public_iface> \
--password=<password> --management --storage
%end
4.3.2.3. Installing Storage Component Only¶
The storage component alone, without the management 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 management 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 management panel,<MN_IP_address>is the IP address of the private network interface on the node with the management 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 management 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 or team.
#network --device=bond0 --bondslaves=<iface1>,<iface2> \
#--bondopts=mode=balance-xor,miimon=100,xmit_hash_policy=layer3+4
#network --device=team0 --teamslaves=<iface1>,<iface2>
# Erase all partitions from all recognized disks.
# WARNING: Destroys data on all disks that the installer can reach!
clearpart --all
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 management panel and storage components.
# Specify an internal interface for the management network and
# an external interface for the management panel network.
#%addon com_vstorage --internal-iface=eth0 --external-iface=eth1 \
#--password=xxxxxxxxx --management --storage
#%end
# Uncomment to install the storage component. To register the node,
# specify the token as well as the IP address of the management panel.
#%addon com_vstorage --storage --token=xxxxxxxxx --mgmt-node-addr=10.37.130.1
#%end