Bug 1680465

Summary: cloud_init re-runs on VM reboot, static networking configuration lost
Product: Red Hat Enterprise Linux 7 Reporter: Dong <dfu>
Component: cloud-initAssignee: Eduardo Otubo <eterrell>
Status: CLOSED DUPLICATE QA Contact: Vratislav Hutsky <vhutsky>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.3CC: cww, jgreguske
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-21 20:13:42 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:
Attachments:
Description Flags
One sosreport in test machine none

Description Dong 2019-02-25 06:22:02 UTC
Created attachment 1538309 [details]
One sosreport in test machine

Description of problem:
 If you configure static networking via the Administration Portal when create the VM from tempalte and then reboot the VM cloud_init runs again and resets the network configuration back to DHCP since 0.7.9-24 version.

Version-Release number of selected component (if applicable):
 0.7.6-2  <=== No issue
 0.7.9-24 <=== Has issue
 18.2-1   <=== Has issue
 RHEL 7.x VM in RHV 4.1

How reproducible:
 Upgrade cloud-init to 0.7.9-24 or higher version. 

Steps to Reproduce:
1. Create test machine a through the abnormal rhel7.3 template, restart test machine a, and configure ip without exception. Cloud-init version: 0.7.6-2

2. Execute yum update to upgrade test machine a to rhel7.5. After restarting the server, the static ip is lost. The network configuration file is rewritten into dhcp configuration by cloud-init. Cloud-init version: 0.7.9-24

3. Clone test machine a generates test machine b, configure static ip in test machine b, upgrade cloud-init to 18.2-1, restart, static still loses.

4. Create a template from the test machine b, then create a test machine c through the template and start it with cloud-init. The hostname can be imported normally. In the network interface configuration file, the IPADDR, NETMASK, and GATEWAY fields are normally passed in, but ONBOOT will set to no( "ONBOOT=no" ). At the same time, the problem of restarting the server static ip to dhcp still exists.

Actual results:
 cloud_init runs again and resets the network configuration back to DHCP.

Expected results:
 Cloud-init will set the network to the specified configuration.

Additional info:
 I found same issue in CloudForms in BZ#1439373, BZ#1441328, BZ#1442877 。
 
 Now we can run following command to disable network after system first reboot to avoid this issue :
~~~
echo "network: {config: disabled}" >> /etc/cloud/cloud.cfg.d/10_miq_cloud.cfg
~~

Comment 4 Chris Williams 2019-06-21 20:13:42 UTC

*** This bug has been marked as a duplicate of bug 1593010 ***