Bug 643373 (QMPNetCard)

Summary: RFE: Add ability to control link up/down state of guest NICs via XML & on the fly.
Product: Red Hat Enterprise Linux 6 Reporter: Luiz Capitulino <lcapitulino>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: berrange, bsarathy, bugzilla.redhat, dallan, dyuan, eblake, gcosta, gsun, jyang, llim, mkenneth, mzhan, rwu, szhou, tburke, virt-maint, xen-maint, xtian, ydu, yupzhang, zhpeng
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.9-1.el6 Doc Type: Enhancement
Doc Text:
Controlling up/down link states libvirt is now capable of controlling the state (up or down) of a link of the guest virtual network interfaces. This allows users to perform testing and simulation as though though plugging and unplugging the network cable from the interface. This feature also lets users isolate guests in case any issues arise.
Story Points: ---
Clone Of: 625681 Environment:
Last Closed: 2012-06-20 06:25:34 UTC Type: ---
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: 625681    
Bug Blocks: 580953, 644849, 655920    

Comment 12 Peter Krempa 2011-09-06 10:21:49 UTC
Feature added with a series of upstream commits:

dc675f3 link-state: virsh: Add wrapper commands for changing link state
e0a07bb link-state: qemu: Add net intf modification to virUpdateDeviceFlags
8277c15 link-state: qemu: Add monitor handling for link state modification
edd1295 link-state: conf: Add element to XML for controling link state
c246b02 link-state: util: Add equality comparison functions for structures

Comment 14 zhpeng 2012-01-10 06:21:55 UTC
Test with:
libvirt-0.9.9-1.el6.x86_64


VIA XML:
# virsh update-device kvm22 iface.xml 
Device updated successfully


<interface type='network'>
<mac address='52:54:00:43:ff:6b'/>
<source network='default'/>
<target dev='vnet1'/>
<model type='virtio'/>
<link state='up'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>

the link state 'up' 'down' works well.

On-the-fly:
# virsh domif-setlink kvm22 52:54:00:43:ff:6b up
Device updated successfully
# virsh domif-setlink kvm22 52:54:00:43:ff:6b down
Device updated successfully

The guest interface is under control.

Comment 15 zhpeng 2012-01-10 06:34:08 UTC
When update device to 'down'
guest can't ping to other hosts

When update device to 'up'
guest can ping to other hosts

Comment 16 Peter Krempa 2012-05-02 13:44:26 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Libvirt added a feature to control link state of the guest virtual network interfaces. This allows to perform testing and simulation as though the user would plug and unplug the network cable from the interface. This also allows isolation of the guest in case of problems.

Comment 17 Martin Prpič 2012-05-09 10:53:21 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1,3 @@
-Libvirt added a feature to control link state of the guest virtual network interfaces. This allows to perform testing and simulation as though the user would plug and unplug the network cable from the interface. This also allows isolation of the guest in case of problems.+Controlling up/down link states
+
+libvirt is now capable of controlling the state (up or down) of a link of the guest virtual network interfaces. This allows users to perform testing and simulation as though though plugging and unplugging the network cable from the interface. This feature also lets users isolate guests in case any issues arise.

Comment 19 errata-xmlrpc 2012-06-20 06:25:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html