Bug 911998

Summary: memtune did not live update domain xml
Product: Red Hat Enterprise Linux 7 Reporter: Wayne Sun <gsun>
Component: libvirtAssignee: Gunannan Ren <gren>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, cwei, dallan, dyuan, honzhang, lsu, mzhan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.0.4-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 911997 Environment:
Last Closed: 2014-06-13 13:22:20 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: 911997    
Bug Blocks:    

Description Wayne Sun 2013-02-17 06:44:44 UTC
this problem also on:
libvirt-1.0.2-1.el7.x86_64

+++ This bug was initially created as a clone of Bug #911997 +++

Description of problem:
When tuning memory parameters at domain shutoff, config xml is updated with <memtune> part, but when live tuning domain memory parameters, setting is done without live update domain xml. 

Version-Release number of selected component (if applicable):
libvirt-0.10.2-18.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.352.el6.x86_64
kernel-2.6.32-356.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. tuning memory parameter when domain is shut off
# virsh destroy libvirt_test_api
Domain libvirt_test_api destroyed

# virsh memtune libvirt_test_api --swap-hard-limit -1 --soft-limit -1

# virsh memtune libvirt_test_api --config
hard_limit     : 0
soft_limit     : unlimited
swap_hard_limit: unlimited

# virsh dumpxml libvirt_test_api
...
  <memtune>
    <soft_limit unit='KiB'>9007199254740991</soft_limit>
    <swap_hard_limit unit='KiB'>9007199254740991</swap_hard_limit>
  </memtune>
...

2. tuning memory parameter when domain is on
# virsh start libvirt_test_api
Domain libvirt_test_api started

# virsh memtune libvirt_test_api --live
hard_limit     : 25417216
soft_limit     : unlimited
swap_hard_limit: unlimited

# virsh memtune libvirt_test_api --swap-hard-limit 25417216000 --soft-limit 2541721600 --live

# virsh memtune libvirt_test_api --live
hard_limit     : 25417216
soft_limit     : 2541721600
swap_hard_limit: 25417216000

# virsh dumpxml libvirt_test_api
...
  <memtune>
    <soft_limit unit='KiB'>9007199254740991</soft_limit>
    <swap_hard_limit unit='KiB'>9007199254740991</swap_hard_limit>
  </memtune>
...

live update did not update the domain xml, it remains as set when domain is off. 
  
Actual results:
memtune did not live update domain xml 

Expected results:
memtune should live update domain xml 

Additional info:

Comment 2 Gunannan Ren 2013-03-05 16:22:27 UTC
Patch sent out
https://www.redhat.com/archives/libvir-list/2013-March/msg00159.html

Comment 3 Gunannan Ren 2013-03-06 03:40:29 UTC
commit 0047d5d6e86cf84e71b2503c3939fc97c3ffe8b9
Author: Guannan Ren <gren>
Date:   Wed Mar 6 00:24:57 2013 +0800

    qemu: update domain live xml for virsh memtune with --live flag
    
    virsh subcommand memtune forgot updating domain live xml
    after setting cgroup value.

Comment 4 Luwen Su 2013-04-10 09:54:04 UTC
Test on:
libvirt-1.0.4-1.el7.x86_64
qemu-kvm-1.4.0-2.el7.x86_64

same with the comment 0's step.

Before start the guest
#virsh dumpxml libvirt_test_api
.....
    <soft_limit unit='KiB'>9007199254740991</soft_limit>
    <swap_hard_limit unit='KiB'>9007199254740991</swap_hard_limit>
....
After start the guest

#virsh start libvirt_test_api
Domain libvirt_test_api started

#  virsh memtune libvirt_test_api --live
hard_limit     : 1857024
soft_limit     : unlimited
swap_hard_limit: unlimited

# virsh memtune libvirt_test_api --swap-hard-limit 25417216000 --soft-limit 2541721600 --live

#  virsh memtune libvirt_test_api --live
hard_limit     : 1857024
soft_limit     : 2541721600
swap_hard_limit: 25417216000

# virsh dumpxml libvirt_test_api
.....
    <soft_limit unit='KiB'>2541721600</soft_limit>
    <swap_hard_limit unit='KiB'>25417216000</swap_hard_limit>
....


So set it to VERIFIED

Comment 5 Ludek Smid 2014-06-13 13:22:20 UTC
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.