Bug 2089456
| Summary: | Network config in kickstart's %pre section doesnt work | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Ozgur Yilmaz <yelbuke> |
| Component: | doc-Installation_Guide | Assignee: | Jana Heves <jsvarova> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Jan Stodola <jstodola> |
| Severity: | low | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.9 | CC: | jstodola, rvykydal, sdubewar |
| Target Milestone: | rc | Keywords: | Documentation |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-07-14 10:51:22 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Ozgur Yilmaz
2022-05-23 17:57:49 UTC
Below %pre fails and dracut hangs during the installation process: %include /tmp/networkconfig.txt %pre --log=/tmp/ks-pre.log sh -x IP="--ip=XXX.XXX.XXX.XXX" NODENAME="--hostname=deneme" DNS="--nameserver=XXX.XXX.XXX.XXX" MASK="--netmask=255.255.255.224" GATEWAY="--gateway=XXX.XXX.XXX.XXX" DEV="--device=ens3f1" PROTO="--bootproto=static" echo "network $IP $NODENAME $DNS $MASK $GATEWAY $DEV $PROTO" > /tmp/networkconfig.txt %end But if i dont use %pre and define the network in ks.cfg's main body, then everything works fine and the OS is installed with success: network --ip=XXX.XXX.XXX.XXX --hostname=deneme --nameserver=XXX.XXX.XXX.XXX --netmask=255.255.255.224 --gateway=XXX.XXX.XXX.XXX --device=ens3f1 --bootproto=static I've followed the procedure in the below url to build iso image: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/s1-kickstart2-putkickstarthere I've downloaded the RHEL7.9 boot image from below url: https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.9/x86_64/product-software I've tried the same procedure with also the below versions as their official boot images still downloadable on redhat.com. They all failed with network definition in %pre section. RHEL7.1, RHEL7.2, RHEL7.8, RHEL8.4 Unfortunately, network configuration defined in %pre really does not apply in stage1 / initramfs. So if you really need to configure the network already in stage1 you have to use regular network command. I am not sure why is the network needed for in inintramfs in your case, but I'd guess it is the url --url http://<base-host-ip>/path/to/folder If you need it to access just the software repositories - not the installer image which would be fetched from the iso - there is a chance that with specifying the local installer image correctlu via boot option added to the installer boot options, like: inst.stage2=hd:LABEL=RHEL-7.9 the initramfs stage can proceed without network configuration. Maybe changing the volume id (-V "RHEL-7.9") in process of regenerating of the iso (genisoimage) is the reason why it is not already picked up (matched) by the inst.stage2 option already present among the boot options. Maybe look at the isolinux.cfg of your boot.iso to see if the inst.stage2 matches the volume id of the regenerated boot.iso. Hello Radek, Thanks for the good explanation. I've finally succeed to configure a network interface. Of course couldnt do it without inst.stage2 -as you've mentioned-. So the information you've given fits the situation well. An image -that not resides on a remote location- is needed if we want to configure network with some dynamic parameters in %pre section. My goal is to build an bare metal automation that can determine the network port that is already configured on switch side with some script that can only work in %pre. My opinion is all of the official documentation is lack of describing the needs of dynamic network configuration in Anaconda. My first decision was to name this issue as a bug but now i understand there is a logic behind this scenario, the installer needs an image to start the installation. inst.stage2 and LiveOS image was enough to achieve a network configuration in %pre section. Thank you. p.s. so who should mark this issue as "not a bug"? Hello, I did think about it again, although a runtime image need seems logic, there is still a confusion about %pre. If i configure network in kickstart file's main body it works perfectly, without a runtime image. But if i want to configure that interface in %pre section -although it's said that %pre is called earlier than kickstart's main body- it doesnt work without a runtime image. I think if this's not a bug it deserves a detailed description in official documentation. Am i wrong? Thank you. %pre section of kickstart is executed at the stage of installation which happens way after the installer image (inst.stage2) is fetched. It is after switch root to the installer environment (the installer image) and after anaconda installer itself starts. Then the configuration in %pre is applied and can be used to fetch packages from installation repositories (configured for example by url in kickstart). But it can't be used to configure network to fetch the image (inst.stage2) from network. Maybe we should emphasize this aspect in https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-kickstart-syntax#sect-kickstart-preinstall ? Hi Radek, Thanks for details. Actually if i'd knew these details before trying to configure network in %pre, it could save lots of time. I also think the same about emphasizing this on official documentation. Thanks again. Have a nice weekend. Switching the bug to Documentation based on comment 8. Radku, does the same limitation with %pre section apply to RHEL-8/RHEL-9 as well? I assume the answer is yes, and in such a case also RHEL-8 and RHEL-9 documentation should be updated. (In reply to Jan Stodola from comment #10) > Switching the bug to Documentation based on comment 8. > > Radku, does the same limitation with %pre section apply to RHEL-8/RHEL-9 as > well? I assume the answer is yes, and in such a case also RHEL-8 and RHEL-9 > documentation should be updated. Yes it does. Thank you for providing us with feedback and thus helping us improve our documentation! All the three titles have been republished including the fix. RH Customer Portal links: RHEL 7: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/installation_guide/index#sect-kickstart-preinstall RHEL 8: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/performing_an_advanced_rhel_8_installation/index#pre-script-in-kickstart-file_scripts-in-kickstart-file RHEL 9: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/performing_an_advanced_rhel_9_installation/index |