Hi,
we provision our infrastructure via foreman, so there we get an overview over our servers (barematel, vms from vmware)
we are integrating openshift,(okd and licensed ocp) therefore we need rhel coreos/fedora coreos
we want to provision those vms the same way we provision the rest of our servers, via foreman
so i tested and googled,
i was able to get rhcos installing via foreman:
with this pxetemplate:
DEFAULT pxeboot
TIMEOUT 20
PROMPT 0
LABEL pxeboot
KERNEL boot/rhcos-4.5.6-x86_64-installer-kernel-x86_64
APPEND ip=dhcp rd.neednet=1 initrd=boot/rhcos-4.5.6-x86_64-installer-initramfs.x86_64.img coreos.autologin=yes coreos.first_boot=1 coreos.inst=yes coreos.inst.callhome_url=<%= foreman_url('provision')%> coreos.inst.install_dev=sda coreos.inst.image_url=http://foremantest71.domain.com:8089/pxeboot/rhcos/rhcos-4.5.6-x86_64-metal.x86_64.raw.gz coreos.inst.ignition_url=http://foremantest71.oeamtc.at:8089/pxeboot/rhcos/<%= @host.params['role'] %>.ign
its working with that but hangs in an installloop because ācoreos.inst=yes coreos.inst.callhome_url=<%= foreman_url(āprovisionā)%>ā seems not to be the correct thing, so foreman gets never the install success callback after the vm is provisioned, so it provisions the vm every reboot from scratch,
for this i found a workaround, just cancel the vm build after its started, it will provision and dont start a new provisioning after the vm reboots, this is not nice, but can be workarounded so it should not be a problem, this was problem 1.
problem 2 is the following:
<%#
kind: PXELinux
name: CoreOS PXELinux
model: ProvisioningTemplate
oses:
- CoreOS
- Red Hat
- Rhcos
%>
DEFAULT pxeboot
TIMEOUT 20
PROMPT 0
LABEL pxeboot
KERNEL <%= @kernel %>
APPEND ip=dhcp rd.neednet=1 initrd=<%= @initrd %> coreos.autologin=yes coreos.first_boot=1 coreos.inst=yes coreos.inst.callhome_url=<%= foreman_url('provision')%> coreos.inst.install_dev=sda coreos.inst.image_url=http://foremantest71.oeamtc.at:8089/pxeboot/rhcos/rhcos-4.5.6-x86_64-metal.x86_64.raw.gz coreos.inst.ignition_url=http://foremantest71.oeamtc.at:8089/pxeboot/rhcos/<%= @host.params['role'] %>.ign
i want to do this: with an installation media and operatings system like this and an applied foreman patch from this ticket Feature #27604: Support RedHat CoreOS and Fedora CoreOS as operating systems - Foreman
class Rhcos < Operatingsystem
PXEFILES = {:kernel => 'rhcos-installer-kernel-x86_64', :initrd => 'rhcos-installer-initramfs.x86_64.img'}
def pxe_type
'kickstart'
end
def mediumpath(medium_provider)
''
end
def pxedir
''
end
def display_family
'RHCOS'
end
def available_loaders
self.class.all_loaders
end
end
so i could dynamically set the installed openshift version via foremans rhcos os, because its possible do determine the openshift download urls from the version, this are the two urls which are needed for the pxe boot to be successful:
https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rhcos/4.5/4.5.6/rhcos-installer-kernel-x86_64
https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rhcos/4.5/4.5.6/rhcos-installer-initramfs.x86_64.img
but with this i only get this error:
There was an error rendering the RHCOS PXE template: wrong number of arguments (given 1, expected 0)
so i seem to have done something wrong but i canāt figure out what
just to explain our way:
our provisioning happens with ansible,
so we let ansible create the vmās // baremetal hosts on our foreman
we want to do this for openshift the same way
the idea is to provision the rhcos vmās via ansible on our foreman (powered off), with an extra host_var called āroleā which value can be āboostrapā,āmasterā or āworkerā
then ansible triggers the openshift install and creates the ignition files for boostrap,master,worker, uploads them to the foreman http server
then ansible powers up the rhcos vmās, they find their iginiton file, previously created by the openshift installer and which is now uploaded to the foreman http server, so they are now able to find their igniton file based on their host var value (boostrap, master or worker) and will start with that an openshift 4 install
while this is happening, ansible cancels the build on foreman, so problem 1 is not kicking in.
but if i cant figure out to solve problem 2
that would mean we have to do this in ansible:
create/update via ansible the pxetemplate according to the version with hardcoded values on foreman,
fetch the rhcos kernel/initrd via ansible
put them to the foreman pxe server via ansible
then the openshift node should install with the correct versionā¦
any thoughts or tipps on this?