Bug 700424 - virDomainSetMaxMemory doesn't work
Summary: virDomainSetMaxMemory doesn't work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-28 11:19 UTC by Preethi Ramesh
Modified: 2011-04-28 16:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-28 15:57:20 UTC


Attachments (Terms of Use)

Description Preethi Ramesh 2011-04-28 11:19:25 UTC
Description of problem:
libvirt.libvirtError: this function is not supported by the connection driver: virDomainSetMaxMemory

Version-Release number of selected component (if applicable):
0.8.3

How reproducible:
Easy

Steps to Reproduce:
1.Execute the python attachment with the name of a VM and the new maximum memory as input parameters 
  
Actual results:
pre@pre-Inspiron-N4010:~/pyth code$ python edit-vm-conf-dyn.py hda3 256000
524288
libvir: error : this function is not supported by the connection driver: virDomainSetMaxMemory
Traceback (most recent call last):
  File "edit-vm-conf-dyn.py", line 11, in <module>
    dom.setMaxMemory(maxMemory)
  File "/usr/lib/python2.6/dist-packages/libvirt.py", line 627, in setMaxMemory
    if ret == -1: raise libvirtError ('virDomainSetMaxMemory() failed', dom=self)
libvirt.libvirtError: this function is not supported by the connection driver: virDomainSetMaxMemory


Expected results:
Change the VM Memory configuration while VM is running

Additional info:

Comment 1 Cole Robinson 2011-04-28 15:57:20 UTC
That API is for changing the max memory value of a running VM, which requires hypervisor support, which isn't available in KVM.

If you want to change the max memory value of the guest on it's next boot, you have to edit the guest XML and call conn.define_domain(newxml)

Comment 2 Eric Blake 2011-04-28 16:32:34 UTC
Also, upstream libvirt 0.9.1 will be adding virDomainSetMemoryFlags, which can be used as an alternative to hand-editing the XML for modifying the persistent settings of both current and maximum memory, even while a domain is running.  However, even with the new API, you cannot modify maximum memory of a running KVM guest, only the persistent settings which affect the next boot of the guest.


Note You need to log in before you can comment on or make changes to this bug.