Satellite VM automation Foreman
PXE-less Discovery
Steps required for PXE-Less Discovery:
-Install 'foreman-discovery-image' Packages on Satellite Server
-Sync Red Hat Repos
-Create Content View (which includes 'kickstart' repo
-Enable Red Hat Repos (including 'kickstart' repos), publish and promote new CV
-Enable 'Discovery Red Hat Kexec'
-Create Custom Provisioning Template
-Create Custom Partition Template
-Modify the Operating System
-Create a Subnet
-Create Host Group
-Create Discovery Rules
-Create Discovery Image
-Mount Discovery iso Image to Vmware
1. Add Red Hat Kickstart Repo to CV, publish and promote new CV
2. Enable Auto Discovery Provisioning on satellite server
Administer→Settings
TAB: Discovered
"Auto provisioning" : Yes
3. Enable 'Discovery Red Hat Kexec'
Hosts→Provisioning Templates
Select "Discovery Red Hat kexec"
Verify Associations
Add our custom Location : Riyadh & Jeddah
Add our custom Org : Zain
4. Create Custom Provisioning Template
Hosts→Templates→Provisioning Templates
Search on 'kickstart default'
To the right of the template called "Kickstart default", select 'clone'
4.1. Adjust Provisioning Template Settings
TAB: Template
Change the name to "atestRHEL9.2n"
TAB: Associations
Add 'Red Hat 9.2' to the 'Selected Items' list
TAB: Locations Add our locations to the 'Selected items' list
Select 'Submit'
5. Create Custom Partition Table
Hosts→Templates→Partition Table
Search on 'kickstart default'
To the right of the partition table called "Kickstart default", select 'clone'
5.1. Adjust Partition Template Settings
TAB: Template
Change the name to "Kickstart_PT_RHEL9.2" and select 'Submit'
6. Update Operating System
Hosts→Provisioning Setup→Operating Systems
Select 'Red Hat 9.2'
6.1. Adjust Operating System Settings
TAB: Partition Table
Select "Kickstart_PT_RHEL9.2" and add to 'Selected Items' list
6.2. TAB: Templates
Provisioning Template: 'atestRHEL9.2n’
Discovery Kexec template: 'Discovery Red Hat kexec'
Select 'Submit'
8. Create a Subnet
Enter the basic network info required for the client to communicate with the Satellite.
10. Create new Host Group
Configure→Host Groups
Select 'Create Host Group'
HG_Redhat9.2
11. Create Discovery Rules :
Configure→Discovery Rules
facts.nmprimary_ipv4_dns = 10.123.105.106
select host group : HG_Redhat9.2
11. Create Compute profile:
Infrastructure → Compute profile → Create new : RHEL9_MB2
12. Create Discovery Image
cd /usr/share/foreman-discovery-image
#discovery-remaster foreman-discovery-image-3.8.2-1.iso discovery-remaster foreman-
discovery-image-3.8.2-1.iso "fdi.pxip=10.240.12.20/24 fdi.pxgw=10.240.12.1 \
fdi.pxdns=10.123.115.106 proxy.url=https://saryconredsat.sa.zain.com:9090 \
proxy.type=proxy fdi.pxauto=1"
Copy the new Generated Iso to Vmware Vcenter for use.
14. Customize the Partition Template
Hosts→Templates→Partition Table
For OS FS partitions:
14. Customize the Provisioning Template:
Hosts - - Provisioning Templates - -Edit atestRHEL9.2n
15. Create the VM using Hammer command:
Logging to the connected satellite and execute below command :
#hammer host create --name "discoverytest33222" --organization Zain --location Riyadh --
hostgroup HG_Redhat9.2 --compute-profile RHEL9_MB2 --compute-resource
jdvcsaflexpod.corp.sa.zain.com --enabled true --managed true --provision-method bootdisk --ip
10.240.12.20 --compute-attributes="add_cdrom=1,boot_order=["cdrom"],start=1"