Boot virtual machine by using BOOTP server
A Bootstrap Protocol (BOOTP) server with Trivial File Transfer Protocol (TFTP) and HTTP services allows virtual machines to boot and install over the network by using an ISO image mounted on the BOOTP server.
BOOTP server setup and configuration
- BOOTP server setup for Ubuntu
-
- Install the BOOTP protocol on the virtual machine by using the following
command:
sudo apt-get install inetutils-inetd sudo apt-get install bootpThe
inetutils-inetdpackage providesinetdsuper-server that listens for incoming network connections and starts other daemons to handle the incoming requests - Verify whether the
inetutils-inetdpackage is installed by using the following command:dpkg -l | grep inetutils-inetd - Verify whether the BOOTP daemon is installed by using the following
command:
dpkg -l | grep bootp - Start the BOOTP daemon by using the following
command:
sudo /usr/sbin/bootpd -d2 /etc/bootptab 2> /var/log/bootp.log - Verify whether the BOOTP server is running by using the following
command:
ps -ef | grep boot - Create the BOOTP server database /etc/bootptab file by using the following
command:
sudo vi /etc/bootptab -
Enter the following text in the /etc/bootptab file. Replace
HOST_IP_ADDRESS,SUBNET MASK,GATEWAY_IP_ADDRESS,DOMAIN_NAME,NAME_SERVER_IP_ADDRESS, andBOOT_SERVER_IP_ADDRESSwith the values for your network.HOST_NAME:\ bf=core.elf:\ ip=HOST_IP_ADDRESS:\ sm=SUBNET_MASK:\ gw=GATEWAY_IP_ADDRESS:\ dn=DOMAIN_NAME:\ ns=NAME_SERVER_IP_ADDRESS:\ sa=BOOT_SERVER_IP_ADDRESS: - Repeat the step 7 for each controller.
- Install the
tfptd-hpaandtftp-hpapackages on the virtual machine by using the following command:sudo apt-get install tftpd-hpaAfter the packages are installed, the TFTP server starts in a secure mode and uses the /var/lib/tftpboot directory as the root directory. Edit thetftpd-hpafile and update the /var/lib/tftpboot directory as the TFTP directory.vi /etc/default/tftpd-hpaRestart the TFTP server by using the following command:systemctl restart tftpd-hpa - Install and configure the Apache HTTP Server version 2.0 by using the following
command:
sudo apt-get install apache2Edit the /etc/apache2/sites-available/ks-server.conf configuration file and update the /var/www/html/ directory as the root directory.cat /etc/apache2/sites-available/ks-server.conf # cat /etc/apache2/sites-available/ks-server.conf <VirtualHost virtual_host_IP]> ServerAdmin root@<FQDN of the BOOTP server> DocumentRoot /var/www/html/ ServerName <FQDN of the BOOTP server> ErrorLog ${APACHE_LOG_DIR}/ks-server-error.log CustomLog ${APACHE_LOG_DIR}/ks-server-access.log common <Directory /var/www/html/> Options Indexes MultiViews AllowOverride All Require all granted </Directory> </VirtualHost>Restart the Apache HTTP Server version 2.0 by using the following command:sudo systemctl restart apache2 - Create a grub /var/lib/tftpboot/core.elf file that supports network booting
by using the following command in a
ppc64lemachine:grub-mkimage --output=/var/lib/tftpboot/core.elf --format=powerpc-ieee1275 boot configfile echo elf http ieee1275_fb linux loadenv ls net normal ofnet reboot regexp serial sleep tftp time true date -p /Alternatively, download the core.elf file from
core.elf. - Create a /var/lib/tftpboot/grub.cfg configuration file by using the
following command:
sudo vi /var/lib/tftpboot/grub.cfgThe grub.cfg configuration file has the following fields:
ip=$net_default_ip for c in 1 2 3 4; do nim_configfile=$prefix/grub-nim.cfg-$ip configfile=$prefix/grub.cfg-$ip source "$nim_configfile" source "$configfile" regexp --set=ip '^(.*)\..+$' "$ip" done - Download the PowerVC ISO image by using
the wget command. Create a folder
<ISO_DIRECTORY> under the
/var/www/html/ directory and mount the ISO image to the
<ISO_DIRECTORY> folder by using the following
command:
mount -o loop <ISO_FILE_NAME> /var/www/html/ISO_DIRECTORY - Create a grub file in
grub.cfg-<VM_IP_ADDRESS>format with the IP address of the virtual machine that must be created by using the following command:sudo vi /var/lib/tftpboot/grub.cfg-[VM_IP_ADDRESS]The following file is a sample GRUB configuration file for a specific IP address:set default=0 set timeout=20 menuentry "PowerVC (PowerVM)" --class fedora --class gnu-linux --class gnu --class os { insmod http insmod tftp regexp -s 1:mac_pos1 -s 2:mac_pos2 -s 3:mac_pos3 -s 4:mac_pos4 -s 5:mac_pos5 -s 6:mac_pos6 '(..):(..):(..):(..):(..):(..)' ${net_default_mac} set bootif=${mac_pos1}:${mac_pos2}:${mac_pos3}:${mac_pos4}:${mac_pos5}:${mac_pos6} set root=http,<BOOTP_SERVER_IP> set serveraddress=<BOOTP_SERVER_IP> set ipaddr=VM_IP_ADDRESS set gateway=GATEWAY_ADDRESS set netmask=SUBNET_MASK set nameserver=NAME_SERVER_IP_ADDRESS set hostname=HOST_NAME set infname=INTERFACE_NAME set searchdomain=DOMAIN_NAME set fqdn=VM_FQDN linux //<ISO_DIRECTORY>/ppc/ppc64le/img2a ro inst.text inst.repo=http://<BOOTP_SERVER_IP>/<ISO_DIRECTORY> BOOTIF=${net_default_mac} biosdevname=0 net.ifnames=0 --append "ds=nocloud;seedfrom=/var/lib/cloud/seed/nocloud/ rd.dm=0 rd.luks=0 rd.nomodeset rd.neednet=1 plymouth.enable=0 media=network consoleblank=0 optype=Install mode=auto fsck.mode=skip powervcroot=http://<BOOTP_SERVER_IP>/<ISO_DIRECTORY> ip=${ipaddr}:${nameserver}:${gateway}:${netmask}:${hostname}:${infname}:${searchdomain}:${fqdn}" initrd //<ISO_DIRECTORY>/ppc/ppc64le/img3a } - Check the TFTP server status by using the following
command:
sudo systemctl status tftpd-hpa - Verify the TFTP server configuration by using the following
command:
cat /etc/default/tftpd-hpa - Check the Apache server status by using the following
command:
sudo systemctl status apache2
- Install the BOOTP protocol on the virtual machine by using the following
command:
This configuration enables you to use BOOTP for IP address assignment and GRUB, TFTP, and HTTP to boot a virtual machine by using a network-mounted ISO image.
Deploy the virtual machine
- Create the initial image in PowerVC.
- Deploy a blank virtual machine with the required capacity.
- Perform the following steps on NovaLink or HMC to open the console page:
- NovaLink
-
- List the logical partitions (LPARs) on the system busing the following
command:
pvmctl lpar listNote the ID (lpar_id) that is displayed for the required LPAR.
- Open a virtual terminal session for the required LPAR by using the following
command:
mkvterm --id <lpar_id>
- List the logical partitions (LPARs) on the system busing the following
command:
- HMC
-
- Login to HMC.
- Open a virtual terminal session by using the following
command:
vtmenu - Select the server in the displayed screen.
- Select the LPAR for the selected server in the displayed screen.
- Restart the virtual machine.
- Select SMS Menu in the virtual terminal session.
- Select Setup Remote IPL (Initial Program Load).
- Select the adapter device for which remote IPL needs to be setup.
- Select .
- Configure the following IP parameters:
- Client IP address (VM_IP_ADDRESS)
- Server IP address (BOOTP_SERVER_IP)
- Gateway IP address (GATEWAY_IP_ADDRESS)
- Subnet Mask (SUBNET_MASK)
- Press Escape to return to the previous screen, select Ping Test, and continue if the ping test succeeds.
- Navigate back to the main menu on the SMS terminal and select Select Boot Options.
- Select .
- Select the same device that was selected in step 7.
- Select to boot the virtual machine.
- Repeat from step 1 for all the controllers.
After BOOTP, GRUB, and HTTP server setup, the virtual machine successfully boots by using the specified ISO image and static IP configuration. This feature is useful for automated and repeatable deployment or testing environments.