Vcreate command not found while iPXE chain boot from Red Hat Satellite 6.3.

Solution Unverified - Updated

Environment

  • Red Hat Satellite 6.3
  • Red Hat Enterprise Linux 7
  • iPXE

Issue

  • Vcreate command was not found on iPXE kernel while chain booting iPXE from Red Hat Satellite 6.3 server where vlan tag is needed to connect to the switch, .
  • Not able to tag vlan id to connect to switch to perform iPXE chain boot provisioning.

Resolution

  • Add custom ipxe kernel to the satellite server. In the default ipxe kernel the command vcreate is not available, so custom ipxe kernel needs to be compiled and then needs to be added this to satellite server.
## install prerequesits on your developement server
gcc (version 3 or later)
binutils (version 2.18 or later)
make
perl
syslinux (for isolinux, only needed for building .iso images)
liblzma or xz header files..."
## download ipxe kernel from github on your developer server.
git clone git://git.ipxe.org/ipxe.git
## edit the config file
vi ipxe/src/config/general.h
## uncomment vlan_cmd ### in this config file # means is used!!!! /* are
comments
#define VLAN_CMD /* VLAN commands */
## compile the kernel
make bin/ipxe.lkrn
## copy ipxe kernel to satellite on 2 locations.
/var/lib/tftpboot/ipxe.lkrn
/usr/share/ipxe/ipxe.lkrn
  • Prepare provisioning template for creating a vlan inside ipxe.
## create Vlan
vcreate --tag <%= @host.subnet['vlanid'] %> net${idx}
## add to existing configuration
-<%= @host.subnet['vlanid'] %>
:loop_success
echo Configuring net${idx} for static IP address <%= interface.ip %>
ifopen net${idx}
vcreate --tag <%= @host.subnet['vlanid'] %> net${idx}
set net${idx}-<%= @host.subnet['vlanid'] %>/ip <%= interface.ip %>
set net${idx}-<%= @host.subnet['vlanid'] %>/netmask <%=
interface.subnet.mask %>
<% if interface.subnet.gateway.present? %>
set net${idx}-<%= @host.subnet['vlanid'] %>/gateway <%=
interface.subnet.gateway %>
<% end %>
ifstat net${idx}-<%= @host.subnet['vlanid'] %>
route
<% if interface.subnet.dns_primary.present? %>
# Note, iPXE can only use one DNS server
echo Using DNS <%= interface.subnet.dns_primary %>
set dns <%= interface.subnet.dns_primary %>
set domain <%= interface.domain.to_s %>
<% end %>
  • Edit Operation System to use ipxe chain booting template. Go to Hosts > Operating systems > Choose your operating system > PXELinux template > PXELinux chain iPXE.
  • Edit bootdisk usage in Satellite configuration. Go to Administer > Settings > Boot disk > Host image template > OS Boot Disk iPXE - Hosts.
  • Edit ipxe template for network configuration during kickstart dracut installation.
    Template FILE: OS kickstart default iPXE
## added static configuration and vlan tag
#!gpxe
<%#
kind: iPXE
name: Kickstart default iPXE
oses:
- CentOS
- Fedora
- RedHat
%>
<% subnet = @host.subnet -%>
<% if subnet.respond_to?(:dhcp_boot_mode?) && subnet.dhcp_boot_mode? -%>
 <% static = '' -%>
<% else -%>
 <% static_arg = 'static=yes' -%>
 <% static = (@host.token.nil? ? '?' : '&') + static_arg -%>
<% end -%>
## VLAN HACK 
<% if @host.primary_interface.tag != "" and
@host.operatingsystem.major.to_i >= 7
 VLAN = "vlan=" + @host.provision_interface.identifier + "." +
@host.subnet['vlanid'] + ":" + @host.provision_interface.identifier
elsif @host.primary_interface.tag != "" and
@host.operatingsystem.major.to_i >= 6
 VLAN = "vlanid=" + @host.subnet['vlanid']
else
 VLAN = nil
end -%>
## get static config 
<%
ip=@host.provision_interface.ip
 mask = subnet.mask
 gw = subnet.gateway
 dns = subnet.dns_primary
-%>
kernel <%= "#{@host.url_for_boot(:kernel)}" %> ks=<%=
foreman_url('provision')%> <%= static %> network kssendmac ks.sendmac
inst.ks.sendmac <%= VLAN %> ip=<%= ip %> netmask=<%= mask %> gateway=<%=
gw %> nameserver=<%= dns %>
initrd <%= "#{@host.url_for_boot(:initrd)}" %>
boot

For more KB articles/solutions related to Red Hat Satellite 6.x Provisioning Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Provisioning related Issues

Root Cause

  • This issue was observed because in default ipxe kernel the command vcreate was not available.
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.