Bug 1439373 - cloud_init re-runs on appliance reboot, static networking configuration lost
Summary: cloud_init re-runs on appliance reboot, static networking configuration lost
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.0
Assignee: Joe Vlcek
QA Contact: luke couzens
URL:
Whiteboard: black:appliance
Depends On:
Blocks: 1441328 1442877
TreeView+ depends on / blocked
 
Reported: 2017-04-05 20:18 UTC by Ian Tewksbury
Modified: 2021-06-10 12:09 UTC (History)
16 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1441328 1442877 (view as bug list)
Environment:
Last Closed: 2018-03-06 14:52:56 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ian Tewksbury 2017-04-05 20:18:54 UTC
Description of problem:
If you configure static networking via the appliance_console and then reboot the appliacne cloud_init runs again and resets the network configuration back to DHCP.


Version-Release number of selected component (if applicable):
5.8.0.9-alpha2.20170404195944_1d7ece4

How reproducible:
Always

Steps to Reproduce:
1. Create a new appliance from template in RHV
2. use appliance_console to configure static network
3. reboot the VM

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


Expected results:
cloud_init should not be running again and the static networking configuration should not be being overwritten.


Additional info:
This was found during 5.8 test-a-thon

Comment 2 Joe Vlcek 2017-04-05 21:05:09 UTC
cloud-init used to use a "marker" file that it created on initial execution. If that "marker" file existed it would not rerun on reboot. Perhaps cloud-init is broken.

I'll investigate.

JoeV

Comment 4 Ian Tewksbury 2017-04-06 17:45:20 UTC
Confirmed this as a problem on vcenter appliance as well.

Comment 5 Joe Vlcek 2017-04-06 18:13:37 UTC
The fix will be to disable cloud-init's network configuration in the 
appliance_console as one of the steps done to configure static network.

A PR is pending.

A work around can be to execute the following command after configuring
the static network the the appliance_console.


echo "network: {config: disabled}" >> /etc/cloud/cloud.cfg.d/10_miq_cloud.cfg 

JoeV

Comment 6 Joe Vlcek 2017-04-06 18:13:37 UTC
The fix will be to disable cloud-init's network configuration in the 
appliance_console as one of the steps done to configure static network.

A PR is pending.

A work around can be to execute the following command after configuring
the static network the the appliance_console.


echo "network: {config: disabled}" >> /etc/cloud/cloud.cfg.d/10_miq_cloud.cfg 

JoeV

Comment 8 CFME Bot 2017-04-07 21:18:33 UTC
New commit detected on ManageIQ/manageiq-gems-pending/master:
https://github.com/ManageIQ/manageiq-gems-pending/commit/ee87f97ff0c2ebe6628e6093d8fc6f2daac64a0e

commit ee87f97ff0c2ebe6628e6093d8fc6f2daac64a0e
Author:     Joe VLcek <jvlcek>
AuthorDate: Fri Apr 7 15:30:42 2017 -0400
Commit:     Joe VLcek <jvlcek>
CommitDate: Fri Apr 7 15:44:23 2017 -0400

    Disable cloud-init network re-config on network updates
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1439373

 lib/gems/pending/appliance_console.rb | 5 +++++
 1 file changed, 5 insertions(+)

Comment 11 Reartes Guillermo 2017-05-22 16:04:18 UTC
Hi,

With CFME 5.7.2.1-1 (on VMWare):
 * On first-boot, 'network' service fails.
 * I had to use the workaround in comment #5 in order to configure static network.
 
But with CFME 5.7.1-3 configuring static network worked out of the box. And also network does not fail on first-boot.

Cheers.

Comment 12 Joe Vlcek 2017-05-22 17:12:30 UTC
(In reply to Reartes Guillermo from comment #11)
> Hi,
> 
> With CFME 5.7.2.1-1 (on VMWare):
>  * On first-boot, 'network' service fails.
>  * I had to use the workaround in comment #5 in order to configure static
> network.
>  
> But with CFME 5.7.1-3 configuring static network worked out of the box. And
> also network does not fail on first-boot.
> 
> Cheers.

Hi Reartes,

  It's not clear to me what you are saying. Are you saying that this fix
did work on 5.7.1-3 but failes on 5.7.2.1-1 ?

  This BZ if for the 5.9 release. If you are seeing issues with the 5.7.z
releases please provide clarification comments on the 5.7.z clong BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1442877

Thank you JoeV

Comment 13 luke couzens 2017-10-18 11:11:31 UTC
Verified in 5.9.0.2

Comment 17 bzhou1 2018-02-27 18:11:51 UTC
I am having exact the same issue with cfme-rhevm-5.9.0.18-1.x86_64.qcow2.
After the CFME VM reboot, cloud-init reset my network configuration for static IP (/etc/sysconfig/network-scripts/) back to dhcp. Can you please confirm if it is fixed with 5.9.0.18 build?

Comment 18 Joe Vlcek 2018-02-27 19:28:42 UTC
(In reply to bzhou1 from comment #17)
> I am having exact the same issue with cfme-rhevm-5.9.0.18-1.x86_64.qcow2.
> After the CFME VM reboot, cloud-init reset my network configuration for
> static IP (/etc/sysconfig/network-scripts/) back to dhcp. Can you please
> confirm if it is fixed with 5.9.0.18 build?

This was verified in 5.9.0.2.

How did you configure your network? Did you use the appliance_console?

The appliance_console will create file "/etc/cloud/cloud.cfg.d/99_miq_disable_network_config.cfg"
With the content: "network: {config: disabled}"

Can you confirm if your appliance has this file with the described content
and if you configured with the appliance console?

Thank you. JoeV

Comment 19 bzhou1 2018-02-27 19:41:56 UTC
Hi JoeV,

Thanks a lot for the response.
The static IP configured was not configured through appliance_console. After applied the static IP configure using appliance_console, I do see new file 99_miq_disable_network_config.cfg generated. I also confirmed the static IP is persistent against reboot. 
Sorry about the false alarm.
Bin

Comment 20 bzhou1 2018-02-27 19:42:33 UTC
Hi JoeV,

Thanks a lot for the response.
The static IP configured was not configured through appliance_console. After applied the static IP configure using appliance_console, I do see new file 99_miq_disable_network_config.cfg generated. I also confirmed the static IP is persistent against reboot. 
Sorry about the false alarm.
Bin

Comment 21 Joe Vlcek 2018-02-27 21:57:24 UTC
(In reply to bzhou1 from comment #20)
> Hi JoeV,
> 
> Thanks a lot for the response.
> The static IP configured was not configured through appliance_console. After
> applied the static IP configure using appliance_console, I do see new file
> 99_miq_disable_network_config.cfg generated. I also confirmed the static IP
> is persistent against reboot. 
> Sorry about the false alarm.
> Bin

NP Bin! Glad you got it working!

JoeV


Note You need to log in before you can comment on or make changes to this bug.