Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1812686

Summary: 4.2.18 UPI bare-metal - dracut-initrd still generates ifcfg file even with coreos.no_persist_ip=1
Product: OpenShift Container Platform Reporter: Daniel Del Ciancio <ddelcian>
Component: RHCOSAssignee: Dusty Mabe <dustymabe>
Status: CLOSED ERRATA QA Contact: Michael Nguyen <mnguyen>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.zCC: bbreard, dornelas, dustymabe, imcleod, jligon, miabbott, nstielau, smilner
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 15:57:08 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:
Bug Depends On:    
Bug Blocks: 1186913    

Description Daniel Del Ciancio 2020-03-11 20:53:24 UTC
Description of problem:


Version-Release number of selected component (if applicable):
OCP 4.2.18
rhcos-4.2.18-x86_64-metal-bios.raw.gz (42.81.20200210.0)

How reproducible:


Steps to Reproduce:
1. PXEboot a VM using the following command line arguments :
LABEL ddcocp4bm-test-0
    KERNEL rhcos/rhcos-4.2.18-x86_64-installer-kernel
    APPEND rd.neednet=1 initrd=rhcos/rhcos-4.2.18-x86_64-installer-initramfs.img console=tty0 console=ttyS0 coreos.inst=yes coreos.inst.install_dev=sda coreos.i
nst.image_url=http://dell-r640-01.tamlab.brq.redhat.com/rhcos-4.2.18-x86_64-metal-bios.raw.gz coreos.inst.ignition_url=http://dell-r640-01.tamlab.brq.redhat.com
/ddcocp4bm-test-0-append.ign coreos.no_persist_ip=1

2. I have an appended ignition file containing the following:

{
  "ignition": {
    "config": {
      "append": [
        {
          "source": "http://dell-r640-01.tamlab.brq.redhat.com/ddcocp4bm-worker.ign",
          "verification": {}
        }
      ]
    },
    "security": {
      "tls": {}
    },
    "timeouts": {},
    "version": "2.2.0"
  },
  "networkd": {},
  "passwd": {},
  "storage": {
    "files": [
      {
        "filesystem": "root",
        "group": {
          "id": 0
        },
        "path": "/etc/hostname",
        "user": {
          "id": 0
        },
        "contents": {
          "source": "data:,test-0",
          "verification": {}
        },
        "mode": 420
      },
      {
        "filesystem": "root",
        "group": {
          "id": 0
        },
        "path": "/etc/sysconfig/network-scripts/ifcfg-ens192",
        "user": {
          "id": 0
        },
        "contents": {
          "source": "data:,TYPE%3DEthernet%0ABOOTPROTO%3Dnone%0ANAME%3Dens192%0ADEVICE%3Dens192%0AONBOOT%3Dyes%0AIPADDR%3D10.37.198.140%0APREFIX%3D25%0AGATEWAY%3D10.37.198.254%0ADOMAIN%3Dddcocp4bm.tamlab.brq.redhat.com%0ADNS1%3D10.37.197.1%0ADNS2%3D10.5.30.45%0A",
          "verification": {}
        },
        "mode": 420
      }
    ]
  },
  "systemd": {
    "units": [
      {
        "contents": "[Unit]\nConditionFirstBoot=yes\n[Service]\nType=idle\nExecStart=/sbin/reboot\n[Install]\nWantedBy=multi-user.target\n",
        "enabled": true,
        "name": "restart.service"
      }
    ]
  }
}


3. When the server restarts, my hostname (/etc/hostname) is set correctly but ifcfg-ens192 is overwritten with:

# Generated by dracut initrd
NAME="ens192"
DEVICE="ens192"
ONBOOT=yes
NETBOOT=yes
UUID="d2ea71dd-bb7f-45cb-b42c-8669df05ee92"
IPV6INIT=yes
BOOTPROTO=dhcp
TYPE=Ethernet


Actual results:

On firstboot, 
hostname configured,
ifcfg-ens192  static ip config file (laid down by ignition config) is overwritten with dhcp one,
system restarts

Expected results:

On firstboot,
hostname configured,
ifcfg-ens192 static ip config file (laid down by ignition config) is not overwritten and persists on boot,
system restarts

Additional info:

Comment 4 Micah Abbott 2020-05-14 17:48:00 UTC
Fixing this in all affected versions (presumably 4.2 onward) would require rebuilding and releasing updated boot images for those versions.

This is not something that is usually done, unless the BZ is particularly severe and affecting multiple users.

This BZ does not meet that criteria, so it is unlikely to see the fixes backported to all affected versions.

However, this will be fixed as part of RHCOS/OCP 4.6.

Comment 12 Michael Nguyen 2020-06-26 19:59:02 UTC
Verified on 46.82.202006260140-0 which is a part of registry.svc.ci.openshift.org/ocp/release:4.6.0-0.nightly-2020-06-26-035408.


I used the ISO installer and the raw image with ignition file that sets down the ifcfg file using kernel command line option coreos.no_persist_ip=1.  Install went fine and when the system booted up, the system had the IP address specified in /etc/sysconfig/network-scripts/ifcfg-<name>.

Comment 14 errata-xmlrpc 2020-10-27 15:57:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196