Bug 956994
Summary: | iface-start/destroy should add checkpoint of interface's status before execute | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | EricLee <bili> | |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> | |
Status: | CLOSED NOTABUG | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 7.0 | CC: | acathrow, bili, cwei, dallan, dyuan, honzhang, laine, mzhan | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 956995 (view as bug list) | Environment: | ||
Last Closed: | 2014-01-29 14:01:35 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: | 956995 |
Description
EricLee
2013-04-26 07:26:57 UTC
Patches proposed upstream: https://www.redhat.com/archives/libvir-list/2013-December/msg00611.html Patches were reject upstream. I mean, it's no longer true that one can't ifup an active interface. In fact, it's desired to ifup an active interface as the interface can re-request DHCP (and other stuff) without need to bring the interface down and thus losing connectivity. Hence I'm tentative to close this one. Eric, what's your opinion? (In reply to Michal Privoznik from comment #4) > Patches were reject upstream. I mean, it's no longer true that one can't > ifup an active interface. In fact, it's desired to ifup an active interface > as the interface can re-request DHCP (and other stuff) without need to bring > the interface down and thus losing connectivity. Hence I'm tentative to > close this one. Eric, what's your opinion? Hi Michal, I understand your words: it's desired to ifup an active interface as the interface can re-request DHCP (and other stuff) without need to bring the interface down and thus losing connectivity, and we can drop that. However, the other problem what I mentioned in "Additional info" still should be fixed: Even more, iface-define also *need do some checkpoint for existing interface* to modify the ifcfg-* file carelessly: # virsh iface-list --all Name State MAC Address -------------------------------------------- eth0 active d83:85:7e:61:9b eth1 active 00:1b:21:39:8b:18 lo active 00:00:00:00:00:00 define a static IP interface named eth0 will also successfully without any prompt. # cat net-static-eth0.xml <interface type='ethernet' name='eth0'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='10.66.4.54' prefix='23'/> </protocol> <protocol family='ipv6'> <ip address='3ffe::200' prefix='64'/> </protocol> </interface> # virsh iface-define net-static-eth0.xml Interface eth0 defined from net-static-eth0.xml That will change ifcfg-eth0 file: # cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=none IPADDR=10.66.4.54 NETMASK=255.255.254.0 IPV6INIT=yes IPV6_AUTOCONF=no DHCPV6=no IPV6ADDR=3ffe::200/64 And start eth0 again: # virsh iface-start eth0 Interface eth0 started that will cause iface-dumpxml get un-coincident xml info with ifconfig eth0: # virsh iface-dumpxml eth0 <interface type='ethernet' name='eth0'> <mac address='d83:85:7e:61:9b'/> <protocol family='ipv4'> <ip address='10.66.5.8' prefix='22'/> <ip address='10.66.4.54' prefix='23'/> --- will cause the interface have two ip addr </protocol> <protocol family='ipv6'> <ip address='3ffe::200' prefix='64'/> --- and also for ipv6 <ip address='fe80:ad3:85ff:fe7e:619b' prefix='64'/> </protocol> </interface> # ifconfig eth0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.66.5.8 netmask 255.255.252.0 broadcast 10.66.7.255 inet6 3ffe::200 prefixlen 64 scopeid 0x0<global> inet6 fe80:ad3:85ff:fe7e:619b prefixlen 64 scopeid 0x20<link> ether d83:85:7e:61:9b txqueuelen 1000 (Ethernet) RX packets 94448 bytes 8385061 (7.9 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2192 bytes 632688 (617.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 17 Thanks, EricLee virsh iface-define is no more careless than virsh define or virsh net-define - none of them checks for an existing domain/network/interface of the same name prior to making the new definition, as re-defining something existing is equivalent to editing it. As is normal with a powerful tool, it is easy to shoot yourself in the foot. What *does* already exist, is a method of taking a snapshot of the network configuration state prior to making any modifications: virsh iface-begin will save a copy of all the ifcfg-* files in /etc/sysconfig/network-scripts. You can then do all of the virsh iface-define/undefine you like, and the results will be made directly into /etc/sysconfig/network-scripts. But if you decide you don't want those changes, you can run: virsh iface-rollback and the original ifcfg-* files will be put back in place. Once you are certain that the configuration is as you want it, you run: virsh iface-commit to make the changes permanent. If you reboot the system before running virsh iface-commit, all network config changes that you made after the virsh iface-begin will be automatically rolled back. This seems to me to be about as much of a safeguard as can be added without changing the basic API in a non-compatible way. Based on that, I'm closing this as NOTABUG. If you disagree, feel free to re-open. |