4.3. Kickstart File Example

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

# Install OpenVZ
install
# Uncomment the line below to install OpenVZ in a completely unattended mode
# cmdline
# Use the path of http://example.com/vz to get the installation files.
url --url http://example.com/vz
# Use English as the language during the installation and as the default system
# language.
lang en_US.UTF-8
# Use the English keyboard type.
keyboard us
# Uncomment the line below to remove all partitions from the SDA hard drive and
# create these partitions: /boot, /, /vz, and swap.
# clearpart --drives=sda --all --initlabel
# zerombr
part /boot --fstype=ext4 --size=512
part / --fstype=ext4 --size=20096
part /vz --fstype=ext4 --size=40768 --grow
part swap --size=4000
# Use a DHCP server to obtain network configuration.
network --bootproto dhcp
# Set the root password for the server.
rootpw xxxxxxxxx
# Use the SHA-512 encryption for user passwords and enable shadow passwords.
auth --enableshadow --passalgo=sha512
# Set the system time zone to America/New York and the hardware clock to UTC.
timezone --utc America/New_York
# Set sda as the first drive in the BIOS boot order and write the boot record to
# mbr.
bootloader --location=mbr
# Tell the OpenVZ installer to reboot the system after installation.
reboot
# Install the OpenVZ license on the server.
key XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX
# Create the virt_network1 Virtual Network on the server and associate it with the
# network adapter eth0.
vznetcfg --net=virt_network1:eth0
# Configure the ip_tables ipt_REJECT ipt_tos ipt_limit modules to be loaded in
# Containers.
# Use the http://myrepository.com to handle Fedora OS and application templates.
vztturlmap $FC_SERVER http://myrepository.com
# Install the listed EZ templates. Cache all OS templates after installation. Skip
# the installation of pre-created templates.
nosfxtemplate
%eztemplates --cache
centos-6-x86_64
centos-6-x86
mailman-centos-6-x86_64
mailman-centos-6-x86
# Install the packages for OpenVZ on the server.
%packages
@base
@core
@vz
@ps