.. _Creating Kickstart File: Creating Kickstart File ----------------------- If you plan to perform an unattended installation of |product_name|, you can use a kickstart file. It will automatically supply to the |product_name| installer the options you would normally choose by hand. |product_name| 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. .. _Kickstart Options: 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. .. raw:: latex \setlist[description]{leftmargin=!,labelindent=0pt,labelwidth=1em+\widthof{auth --enableshadow --passalgo=sha512}} ``auth --enableshadow --passalgo=sha512`` Specifies authentication options for the |product_name| 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 `` Sets the system keyboard type. ``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 `` Configures network devices and creates bonds and VLANs. ``raid`` Creates a software RAID volume. ``part`` Creates a partition on the server. ``rootpw --iscrypted `` 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 `` 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! .. raw:: latex \setlist[description]{leftmargin=!,labelindent=0pt,labelwidth=1em+\widthof{ }} .. _Kickstart Scripts: Kickstart Scripts ~~~~~~~~~~~~~~~~~ After setting the options, add scripts to the kickstart file that will install the mandatory package group and Storage components. .. _Installing Packages: Installing Packages ******************* In the body of the ``%packages`` script, specify the package group ``hci`` to be installed on the server: :: %packages @^hci %end .. _Installing Admin Panel and Storage: 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 :ref:`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: #. Add the ``%addon com_vstorage`` script to the kickstart file: :: %addon com_vstorage --management --bare %end #. Once the installation is complete, execute the following command on the node to configure the admin panel component: :: echo | /usr/libexec/vstorage-ui-backend/bin/configure-backend.sh \ -i -x where - ```` is the password of the superadmin account of admin panel, - ```` is the name of the private network interface (the one you would choose for the management network during attended installation), - ```` is the name of the public network interface (the one you would choose for the admin panel network during attended installation). #. Start the admin 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 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= \ --external-iface= --password= %end .. _Installing Storage Component Only: 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 -t where - ```` is the token that can be obtained in the admin panel, - ```` 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= --mgmt-node-addr= %end .. _Kickstart File Example: Kickstart File Example ~~~~~~~~~~~~~~~~~~~~~~ Below is an example of kickstart file that you can use to install and configure |product_name| 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= # Configure network interfaces via DHCP. network --device= --activate network --device= --activate # Alternatively, assign static addresses to network interfaces. #network --device= --activate --bootproto=static --ip= \ #--netmask= --gateway= --nameserver=[,,...] #network --device= --activate --bootproto=static --ip= \ #--netmask= --gateway= --nameserver=[,,...] # If needed, uncomment and specify network interfaces to create a bond. #network --device=bond0 --bondslaves=, \ #--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 .. _Creating the System Partition on Software RAID1: 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``: #. Partition the disks. #. Create a RAID1 volume. #. Create swap and root LVM volumes. .. include:: /includes/creating-system-partition-on-software-raid1.inc 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