Bug 1370617

Summary: os-net-config does not remove previous configuration when using a different configuration
Product: Red Hat OpenStack Reporter: Jaison Raju <jraju>
Component: os-net-configAssignee: RHOS Maint <rhos-maint>
Status: CLOSED NOTABUG QA Contact: Shai Revivo <srevivo>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 7.0 (Kilo)CC: hbrock, jraju, jslagle, mburns, rhel-osp-director-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-27 08:28:21 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:

Description Jaison Raju 2016-08-26 19:24:44 UTC
Description of problem:
When manually running os-net-config on a node with modified os-net-config ,
os-net-config does not remove the previous ifcfg configuration .

Version-Release number of selected component (if applicable):
RHOS 7/8

How reproducible:
Always

Steps to Reproduce:
1. Deploy an environment with multiple vlan networks on bond .
2. Modify node network layout & remove bond & configure vlan network on one of the previous slave nic .
3. If stack-update does not apply new configuration , run os-net-config manually on the nodes 

Actual results:
It is noticed that the previous bond config still remains 

Expected results:
Every time os-net-config is called , it should configure purely based on the new config file & remove all previous ifcfg files .

Additional info:

Comment 3 Jaison Raju 2016-08-27 08:28:21 UTC
Dan has suggested --cleanup will remove the old config .

I tested this again & noticed the following.
Environment
Previous:
nic1 - Provisioning
bridge - bond - nic2  |-> couple of vlan networks
                nic3  |
After:
nic1 - Provisioning
bridge - nic2  |-> couple of vlan networks
         nic3  |
stack update succeeds , but i dont find the /etc/os-net-config/config.json updated on the nodes . 
So i manually modify the config to 'After' state .

--cleanup removes ifcfg files & the unwanted interfaces .

Closing this Bug & will raise an RFE to have director do it while stack update .