This article was originally published on the Red Hat Customer Portal. The information may no longer be current.
Satellite 6.2 introduced PXE-less discovery which is targeted to networks without PXE or DHCP services available. In this workflow, kernel on discovered nodes is replaced (via kexec technology) instead of rebooting. This turns out to be useful feature on PXE/DHCP networks as well.
To configure kexec on PXE/DHCP enabled network, do the following simple steps.
Step 1: Verify foreman discovery image version
Newer version of foreman-discovery-image must be used in order to send required "discovery_kexec" fact. We are planning rebase of foreman-discovery-image package in Satellite 6.2 upcoming errata. In the meantime, it is possible to download upstream version which is based on CentOS 7 rather than Red Hat Enterprise Linux. Series 3.4 are known to work with Satellite 6.2.
tftp_capsule# cd /var/lib/tftpboot/boot/
tftp_capsule# wget http://downloads.theforeman.org/discovery/releases/3.4/fdi-image-3.4.1.tar
tftp_capsule# tar -xvf fdi-image-3.4.1.tar
Step 2: Configure foreman discovery image kernel options
Satellite will either reboot or kexec discovered node based on presence of special fact called "discovery_kexec". When present and KExec template is associated with given Hostgroup and Operating System, kexec is performed. Reboot is the fallback mechanism if the two requirements are not met.
In Hosts - Provisioning templates search for "global" string and edit "PXELinux global default" template. In Satellite 6.2 it is possible to directly edit this template, in upcoming version this template must be cloned and Global setting must be changed to use the cloned template instead the default one.
ONTIMEOUT discovery_upstream
...
LABEL discovery_upstream
MENU LABEL Foreman Discovery Image 3.4.1
KERNEL boot/fdi-image/vmlinuz0
APPEND initrd=boot/fdi-image/initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=https://CAPSULE_URL:9090 proxy.type=proxy fdi.pxfactname1=discovery_kexec fdi.pxfactvalue1=1
IPAPPEND 2
Change proxy.url and proxy.type accordingly to point to either Satellite Server or Capsule. Note the options fdi.pxfactname1=discovery_kexec fdi.pxfactvalue1=1 which are required in order to have the "discovery_kexec" fact sent along.
Now click on Build PXE Default to rebuild pxelinux.cfg/default template. Hosts can be discovered now.
Step 3: Modify Red Hat KExec template
Find Red Hat Kexec template, clone it, associate it with requied Operating System and edit its contents:
<%#
kind: kexec
name: Red Hat kexec
oses:
- CentOS 4
- CentOS 5
- CentOS 6
- CentOS 7
- Fedora 19
- Fedora 20
- Fedora 21
- Fedora 22
- RedHat 4
- RedHat 5
- RedHat 6
- RedHat 7
-%>
<%
mac = @host.facts['discovery_bootif']
bootif = '00-' + mac.gsub(':', '-') if mac
append = @host.facts['append']
-%>
{
"kernel": "<%= @kernel %>",
"initram": "<%= @initrd %>",
<% if (@host.operatingsystem.name == 'Fedora' and @host.operatingsystem.major.to_i > 16) or
(@host.operatingsystem.name != 'Fedora' and @host.operatingsystem.major.to_i >= 7) -%>
"append": "ks=<%= foreman_url('provision') %> inst.ks.sendmac <%= "ksdevice=bootif BOOTIF=#{bootif} #{append}" %>"
<% else -%>
"append": "ks=<%= foreman_url('provision') %> kssendmac <%= "BOOTIF=#{bootif} #{append}" %>"
<% end -%>
}
The template was designed for DHCP-less environments and it assumes static IP configuration. These "discovery_*" facts are not present, therefore the default template generates "ip=::::::none" Anaconda configuration which leads to System halted. The modified version does not provide static configuration, therefore Anaconda performs DHCP request.
Make sure to set this template as default one for required Operating Systems.
Step 4: Verify requirements and provision
Before provisioning the very first discovered node, show the detail page, expand all facts and search for "discovery_kexec" fact, it should be set to "1". Also make sure the Red Hat KExec template is associated with Operating System.
Discovered hosts now can be provisioned or auto-provisioned and kexec will be performed instead of reboot.
Troubleshooting
On some hardware or VMs, kexec will freeze when discovered node is on the first virtual console (tty1) with the text user interface.
To workaround this issue switch virtual terminal to tty2 (Alt+F2) before kexecing.
저자 소개
Lukáš Zapletal is a principal software engineer at Red Hat, and is involved in the Foreman and Fedora communities as well as working on Red Hat Satellite 6. He is also interested in security, SELinux, and performance monitoring with Performance Co-Pilot (PCP).
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
가상화
온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래