Bug 1014503
| Summary: | Allow QoS change on the fly using updateDeviceFlags | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Michal Privoznik <mprivozn> |
| Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.0 | CC: | acathrow, berrange, clalancette, dallan, dyuan, gsun, honzhang, itamar, jdenemar, jforbes, jiahu, laine, libvirt-maint, lpeer, mprivozn, veillard, virt-maint |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.1.1-9.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1014200 | Environment: | |
| Last Closed: | 2014-06-13 13:29:52 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: | 1014200 | ||
| Bug Blocks: | |||
|
Description
Michal Privoznik
2013-10-02 08:59:09 UTC
Moving to POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2013-October/msg00046.html I can reproduce it with libvirt-1.1.1-8.el7.x86_64, can not reproduce it with libvirt-1.1.1-9.el7.x86_64.
Version:
libvirt-1.1.1-9.el7.x86_64
qemu-kvm-rhev-1.5.3-9.el7.x86_64
kernel-3.10.0-34.el7.x86_64
Verifying steps:
A. Function testing(testing results are same on 'network' and 'bridge' source network.)
1. Check domain status and interface element.
[root@localhost ~]# virsh list --all
Id Name State
----------------------------------------------------
3 r6 running
[root@localhost ~]# virsh dumpxml r6 | grep interface -A8
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
...
2. Add bandwidth to nic.xml
[root@localhost ~]# cat nic.xml
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<model type='virtio'/>
<bandwidth>
<inbound average='1000' peak='5000' burst='1024'/>
<outbound average='128' peak='256' burst='256'/>
</bandwidth>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
3. Update interface of domian using update-device cmd.
[root@localhost ~]# virsh update-device r6 nic.xml
Device updated successfully
4. Check the bandwidth part in domain xml.
[root@localhost ~]# virsh dumpxml r6 | grep interface -A10
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<target dev='vnet0'/>
<model type='virtio'/>
<bandwidth>
<inbound average='1000' peak='5000' burst='1024'/>
<outbound average='128' peak='256' burst='256'/>
</bandwidth>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
...
5. Check the rules using tc command
[root@localhost ~]# tc filter show dev vnet0 parent ffff:
filter protocol ip pref 49152 u32
filter protocol ip pref 49152 u32 fh 800: ht divisor 1
filter protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid :1
match 00000000/00000000 at 12
police 0x4 rate 1024Kbit burst 256Kb mtu 64Kb action drop overhead 0b
ref 1 bind 1
[root@localhost ~]# tc class show dev vnet0
class htb 1:1 root leaf 2: prio 0 rate 8000Kbit ceil 40000Kbit burst 1Mb cburst 1600b
6. Update existing <bandwidth> using update-device
[root@localhost ~]# virsh dumpxml r6 | grep interface -A10
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<target dev='vnet0'/>
<model type='virtio'/>
<bandwidth>
<inbound average='1000' peak='5000' burst='1024'/>
<outbound average='128' peak='256' burst='256'/>
</bandwidth>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
...
[root@localhost ~]# cat nic.xml
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<model type='virtio'/>
<bandwidth>
<outbound average='128' peak='256' burst='256'/>
</bandwidth>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
[root@localhost ~]# virsh update-device r6 nic.xml
Device updated successfully
[root@localhost ~]# virsh dumpxml r6 | grep interface -A10
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<target dev='vnet0'/>
<model type='virtio'/>
<bandwidth>
<outbound average='128' peak='256' burst='256'/>
</bandwidth>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
...
[root@localhost ~]# tc filter show dev vnet0 parent ffff:
filter protocol ip pref 49152 u32
filter protocol ip pref 49152 u32 fh 800: ht divisor 1
filter protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid :1
match 00000000/00000000 at 12
police 0x5 rate 1024Kbit burst 256Kb mtu 64Kb action drop overhead 0b
ref 1 bind 1
[root@localhost ~]# tc class show dev vnet0 <=== no class for vnet0
[root@localhost ~]#
B. Negative testing
1. Negative value
[root@localhost ~]# cat nic.xml
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<model type='virtio'/>
<bandwidth>
<inbound average='-1' peak='5000' burst='1024'/>
</bandwidth>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
[root@localhost ~]# virsh update-device r6 nic.xml
error: Failed to update device from nic.xml
error: internal error: cannot set bandwidth limits on vnet0
2.huge value
[root@localhost ~]# cat nic.xml
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<model type='virtio'/>
<bandwidth>
<inbound average='10000000000000000' peak='5000' burst='1024'/>
</bandwidth>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
[root@localhost ~]# virsh update-device r6 nic.xml
error: Failed to update device from nic.xml
error: internal error: cannot set bandwidth limits on vnet0
3. remove mandatory attribute average
[root@localhost ~]# cat nic.xml
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<model type='virtio'/>
<bandwidth>
<outbound peak='5000' burst='1024'/>
</bandwidth>
...
[root@localhost ~]# virsh update-device r6 nic.xml
error: Failed to update device from nic.xml
error: Missing mandatory average or floor attributes
Existing issue:
During testing, I think libvirt should check the value range of average element in <outbound> before updating device, also the values of average element in <outbound> should be consistent with <inbound>, libvirt had better report "error: internal error: cannot set bandwidth limits on vnet0".
This issue also can reproduce on rhel6.5 with libvirt-0.10.2-29.el6.x86_64.
[root@localhost ~]# cat nic.xml
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<model type='virtio'/>
<bandwidth>
<outbound average='-1' peak='5000' burst='1024'/> <===set negative for <outbound>, same value in <inbound> will be failed. See [B. Negative testing]
</bandwidth>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
[root@localhost ~]# virsh update-device r6 nic.xml
Device updated successfully
[root@localhost ~]# virsh dumpxml r6 | grep interface -A10
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<target dev='vnet0'/>
<model type='virtio'/>
<bandwidth>
<outbound average='18446744073709551615' peak='5000' burst='1024'/> <======libvirt will convert the negative to positive number.
</bandwidth>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
...
[root@localhost ~]# cat nic.xml
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<model type='virtio'/>
<bandwidth>
<outbound average='10000000000000000' peak='5000' burst='1024'/> <===========set a huge value for average of <outbound>, same value in <inbound> will be failed. See [B. Negative testing]
</bandwidth>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
[root@localhost ~]# virsh update-device r6 nic.xml
Device updated successfully
[root@localhost ~]# virsh dumpxml r6 | grep interface -A10
<interface type='network'>
<mac address='52:54:00:90:06:7a'/>
<source network='default'/>
<target dev='vnet0'/>
<model type='virtio'/>
<bandwidth>
<outbound average='10000000000000000' peak='5000' burst='1024'/>
</bandwidth>
...
Any suggestion/update for below problem?
> Existing issue:
> During testing, I think libvirt should check the value range of average
> element in <outbound> before updating device, also the values of average
> element in <outbound> should be consistent with <inbound>, libvirt had
> better report "error: internal error: cannot set bandwidth limits on vnet0".
>
> This issue also can reproduce on rhel6.5 with libvirt-0.10.2-29.el6.x86_64.
>
> [root@localhost ~]# cat nic.xml
> <interface type='network'>
> <mac address='52:54:00:90:06:7a'/>
> <source network='default'/>
> <model type='virtio'/>
> <bandwidth>
> <outbound average='-1' peak='5000' burst='1024'/>
> <===set negative for <outbound>, same value in <inbound> will be failed. See
> [B. Negative testing]
> </bandwidth>
> <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
> function='0x0'/>
> </interface>
> [root@localhost ~]# virsh update-device r6 nic.xml
> Device updated successfully
>
> [root@localhost ~]# virsh dumpxml r6 | grep interface -A10
> <interface type='network'>
> <mac address='52:54:00:90:06:7a'/>
> <source network='default'/>
> <target dev='vnet0'/>
> <model type='virtio'/>
> <bandwidth>
> <outbound average='18446744073709551615' peak='5000' burst='1024'/>
> <======libvirt will convert the negative to positive number.
> </bandwidth>
> <alias name='net0'/>
> <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
> function='0x0'/>
> </interface>
> ...
>
> [root@localhost ~]# cat nic.xml
> <interface type='network'>
> <mac address='52:54:00:90:06:7a'/>
> <source network='default'/>
> <model type='virtio'/>
> <bandwidth>
> <outbound average='10000000000000000' peak='5000' burst='1024'/>
> <===========set a huge value for average of <outbound>, same value in
> <inbound> will be failed. See [B. Negative testing]
> </bandwidth>
> <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
> function='0x0'/>
> </interface>
> [root@localhost ~]# virsh update-device r6 nic.xml
> Device updated successfully
>
> [root@localhost ~]# virsh dumpxml r6 | grep interface -A10
> <interface type='network'>
> <mac address='52:54:00:90:06:7a'/>
> <source network='default'/>
> <target dev='vnet0'/>
> <model type='virtio'/>
> <bandwidth>
> <outbound average='10000000000000000' peak='5000' burst='1024'/>
> </bandwidth>
> ...
Okay, these are bugs. I am moving this bug back to ASSIGNED and I'll propose a patch. Actually, I think the issues will better be covered by a separate bug report as it seems not to be limited to just device-update. Hu, could you please create a new bug for these issues? Thanks for your suggestion, filed a new one, bug 1022292. This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |