Hide Forgot
Description of problem: Could define an interface while the same name interface already exists, and then, it causes confusion Version-Release number of selected component (if applicable): - kernel-2.6.32-117.el6.x86_64 - netcf-0.1.7-1.el6.x86_64 How reproducible: always Steps to Reproduce: 1. Prepare eth0-modified.xml which has different mac address with eth0 # cat eth0-modified.xml <interface type="ethernet" name="eth0"> <start mode="onboot"/> <mac address="00:25:64:A7:1F:4F"/> <protocol family="ipv4"> <dhcp/> </protocol> </interface> 2. # ncftool ncftool> list eth0 lo ncftool> dumpxml eth0 <?xml version="1.0"?> <interface type="ethernet" name="eth0"> <start mode="onboot"/> <mac address="00:25:64:A7:1F:4D"/> <protocol family="ipv4"> <dhcp/> </protocol> </interface> ncftool> define eth0-modified.xml Defined interface eth0 ncftool> dumpxml eth0 <?xml version="1.0"?> <interface type="ethernet" name="eth0"> <start mode="onboot"/> <mac address="00:25:64:A7:1F:4F"/> <protocol family="ipv4"> <dhcp/> </protocol> </interface> ncftool> Actual results: the 2nd eth0 still can defined successfully while eth0 already exists and active. after 2 eth0 exist, the dumpxml command displays the 2nd interface's xml info and it certainly causes confusion. Expected results: Do pre-check before defining interface and only one same name interface is allowed to be defined. Additional info:
This is expected behavior - when you define an interface with the same name as an existing interface, the new definition will replace the old definition. Is that what you see?
from ncftool > dumpxml eth0, the new definition replaces old definition but from # ifconfig eth0 and /etc/sysconfig/network-scripts/ifcfg-eth0 it is still old definition, is that expected ? I think it is a little confusing users
The output of "ifconfig eth0" (ie the "live" status of the interface) doesn't change until you do an ifdown / ifup of the interface. This is similar to the way that changing the config of a virtual guest doesn't take effect until you stop and restart the guest. Are you sure about the contents of ifcfg-eth0? The output of "dumpxml eth0" is directly derived from ifcfg-eth0 every time it is called, so it seems unlikely that they wouldn't match. Please re-check this part.
Sorry, I rechecked the result, and found that both ncftool>dumpxml eth0 and ifcfg-eth0 is replaced as new definition. 'ifconfig eth0' is still old definition. Seems that is expected result.