Bug 664629
| Summary: | Can't start guest with "disallow-dhcp-server" network filter | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | xhu | ||||
| Component: | libvirt | Assignee: | Laine Stump <laine> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 6.0 | CC: | dallan, dyuan, eblake, gren, hjiang, jyang, llim, xen-maint | ||||
| Target Milestone: | rc | Keywords: | Reopened | ||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | libvirt-0.9.3-1.el6 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 773561 (view as bug list) | Environment: | |||||
| Last Closed: | 2011-12-06 10:53:00 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: | |||||||
| Bug Blocks: | 773561 | ||||||
| Attachments: |
|
||||||
xhu, coud you provide more info, e.g. the guest log(/var/log/libvirt/qemu/$guest.log), and libvirtd log(/var/log/messages)? Since RHEL 6.1 External Beta has begun, and this bug remains unresolved, it has been rejected as it is not proposed as exception or blocker. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. Created attachment 509677 [details]
log info collection
Could reproduce this bug on the following components, So set the bug status as "assign".
Version-Release number of selected component (if applicable):
kernel-2.6.32-160.el6.x86_64
libvirt-0.9.2-1.el6.x86_64
qemu-kvm-0.12.1.2-2.165.el6.x86_64
Steps:
1. # cat disallow-dhcp-server.xml
<filter name='disallow-dhcp-server' chain='ipv4'>
<rule action='accept' direction='out' priority='100'>
<ip srcipaddr='0.0.0.0' dstipaddr='255.255.255.255' protocol='udp' srcportstart='68' dstportstart='67'/>
</rule>
<rule action='drop' direction='in' priority='100'>
<ip srcipaddr='$DHCPSERVER' protocol='udp' srcportstart='67' dstportstart='68'/>
</rule>
</filter>
2. # virsh nwfilter-define disallow-dhcp-server.xml
Network filter disallow-dhcp-server defined from disallow-dhcp-server.xml
3. define a guest with "<filterref filter='disallow-dhcp-server'/>" in interface section
# virsh dumpxml rh6
...
<interface type='network'>
<mac address='52:54:00:6c:73:8c'/>
<source network='default'/>
<model type='virtio'/>
<filterref filter='disallow-dhcp-server'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
...
4. # virsh start rh6
error: Failed to start domain rh6
error: An error occurred, but the cause is unknown
No useful info could be found in the three log files. See the attachment in comment 3.
Without getting into the usefulness of the filter you're creating (it disallows one particular DHCP server but allows all others), the reason for the failure is that you've specified a variable in the filter definition, but haven't provided it as a parameter when you reference the filter.
Rather than this:
<filterref filter='disallow-dhcp-server'/>
You need to do this:
<filterref filter='disallow-dhcp-server'>
<parameter name='DHCPSERVER' value='192.168.122.1'/>
</filterref>
for example.
The error message that's produced is rather vague, though, so I'm leaving the bug open as a request to get that fixed. (I've notified the person who wrote this code).
The missing error message has been added to libvirt upstream in the following commit, and will be in the next rebase of libvirt for RHEL6:
commit ecfbf79541c76a884b25af6b022b601570f39b25
Author: Stefan Berger <stefanb.com>
Date: Mon Jun 27 12:53:59 2011 -0400
nwfilter: Return error message about unresolvable variables
This is in response to bugzilla 664629
https://bugzilla.redhat.com/show_bug.cgi?id=664629
The patch below returns an appropriate error message if the chain of
nwfilters is found to contain unresolvable variables and therefore
cannot be instantiated.
Example: The following XMl added to a domain:
<interface type='bridge'>
<mac address='52:54:00:9f:80:45'/>
<source bridge='virbr0'/>
<model type='virtio'/>
<filterref filter='test'/>
</interface>
that references the following filter
<filter name='test' chain='root'>
<filterref filter='clean-traffic'/>
<filterref filter='allow-dhcp-server'/>
</filter>
now displays upon 'virsh start mydomain'
error: Failed to start domain mydomain
error: internal error Cannot instantiate filter due to unresolvable variable: DHCPSERVER
'DHPCSERVER' is contained in allow-dhcp-server.
(In reply to comment #4) > Could reproduce this bug on the following components, So set the bug status as > "assign". > > Version-Release number of selected component (if applicable): > kernel-2.6.32-160.el6.x86_64 > libvirt-0.9.2-1.el6.x86_64 > qemu-kvm-0.12.1.2-2.165.el6.x86_64 > > Steps: > 1. # cat disallow-dhcp-server.xml > <filter name='disallow-dhcp-server' chain='ipv4'> > <rule action='accept' direction='out' priority='100'> > <ip srcipaddr='0.0.0.0' dstipaddr='255.255.255.255' protocol='udp' > srcportstart='68' dstportstart='67'/> > </rule> > <rule action='drop' direction='in' priority='100'> > <ip srcipaddr='$DHCPSERVER' protocol='udp' srcportstart='67' > dstportstart='68'/> > </rule> > </filter> > > 2. # virsh nwfilter-define disallow-dhcp-server.xml > Network filter disallow-dhcp-server defined from disallow-dhcp-server.xml > > 3. define a guest with "<filterref filter='disallow-dhcp-server'/>" in > interface section > # virsh dumpxml rh6 > ... > <interface type='network'> > <mac address='52:54:00:6c:73:8c'/> > <source network='default'/> > <model type='virtio'/> > <filterref filter='disallow-dhcp-server'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x03' > function='0x0'/> > </interface> > ... > 4. # virsh start rh6 > error: Failed to start domain rh6 > error: An error occurred, but the cause is unknown > > No useful info could be found in the three log files. See the attachment in > comment 3. As comment 5 told, redo comment 4, change step 3 as: # virsh dumpxml rh6 ... <interface type='network'> <mac address='52:54:00:e4:e3:45'/> <source network='default'/> <filterref filter='disallow-dhcp-server'> <parameter name='DHCPSERVER' value='10.66.3.215'/> </filterref> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> ... #virsh start rh6 Domain rh started It is ok. (In reply to comment #8) > (In reply to comment #4) > > Could reproduce this bug on the following components, So set the bug status as > > "assign". > > > > Version-Release number of selected component (if applicable): > > kernel-2.6.32-160.el6.x86_64 > > libvirt-0.9.2-1.el6.x86_64 > > qemu-kvm-0.12.1.2-2.165.el6.x86_64 > > > > Steps: > > 1. # cat disallow-dhcp-server.xml > > <filter name='disallow-dhcp-server' chain='ipv4'> > > <rule action='accept' direction='out' priority='100'> > > <ip srcipaddr='0.0.0.0' dstipaddr='255.255.255.255' protocol='udp' > > srcportstart='68' dstportstart='67'/> > > </rule> > > <rule action='drop' direction='in' priority='100'> > > <ip srcipaddr='$DHCPSERVER' protocol='udp' srcportstart='67' > > dstportstart='68'/> > > </rule> > > </filter> > > > > 2. # virsh nwfilter-define disallow-dhcp-server.xml > > Network filter disallow-dhcp-server defined from disallow-dhcp-server.xml > > > > 3. define a guest with "<filterref filter='disallow-dhcp-server'/>" in > > interface section > > # virsh dumpxml rh6 > > ... > > <interface type='network'> > > <mac address='52:54:00:6c:73:8c'/> > > <source network='default'/> > > <model type='virtio'/> > > <filterref filter='disallow-dhcp-server'/> > > <address type='pci' domain='0x0000' bus='0x00' slot='0x03' > > function='0x0'/> > > </interface> > > ... > > 4. # virsh start rh6 > > error: Failed to start domain rh6 > > error: An error occurred, but the cause is unknown > > > > No useful info could be found in the three log files. See the attachment in > > comment 3. > > As comment 5 told, redo comment 4, change step 3 as: > # virsh dumpxml rh6 > ... > <interface type='network'> > <mac address='52:54:00:e4:e3:45'/> > <source network='default'/> > <filterref filter='disallow-dhcp-server'> > <parameter name='DHCPSERVER' value='10.66.3.215'/> > </filterref> > <address type='pci' domain='0x0000' bus='0x00' slot='0x03' > function='0x0'/> > </interface> > ... > #virsh start rh6 > Domain rh started > > It is ok. Can the guest get ip and visit the public network? The guest with the filter 'disallow-dhcp-server' could not get ip and could not visit the public network. 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/RHBA-2011-1513.html |
Description of problem: Can't start guest with "disallow-dhcp-server" network filter Version-Release number of selected component (if applicable): kernel-2.6.32-71.el6.x86_64 libvirt-0.8.1-27.el6.x86_64 qemu-kvm-0.12.1.2-2.113.el6.x86_64 How reproducible: everytimes Steps to Reproduce: 1. define a guest with "<filterref filter='disallow-dhcp-server'/>" in interface section <interface type='network'> <mac address='52:54:00:0a:ba:19'/> <source network='default'/> <target dev='vnet0'/> <model type='virtio'/> <filterref filter='disallow-dhcp-server'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> 2. start the guest # virsh start demo error: Failed to start domain rhel6 error: Unknown failure Actual results: After step 2, errors occure Expected results: the guest can be started successfully without errors Additional info: