[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Marco Sinhoreli wrote:
I'm using the python xenapi. Above the source code for setup VM memory
dynamic and static:

# Configuring the VM memory
memory_size = str(memory_size * 1024 * 1024)
self.master.VM.set_memory_dynamic_max(vm, memory_size)
self.master.VM.set_memory_dynamic_min(vm, memory_size)
self.master.VM.set_memory_static_max(vm, memory_size)
self.master.VM.set_memory_static_min(vm, memory_size)

Okay, I think I can see the problem here.

XAPI rejects any API calls that would violate the following

    static-min <= dynamic-min <= dynamic-max <= static-max

The section of code you've posted above makes four separate API
calls to update memory properties. XAPI will raise an exception
if any one of those four calls violate the above constraint. To
update memory properties in this way, you'd need to be careful
with the order in which you make the calls...

I recommend instead using the set-memory-limits function, which
allows you to update these four values atomically.

Marco, could you try replacing the above code with:

# Configuring the VM memory
memory_size = str(memory_size * 1024 * 1024)
self.master.VM.set_memory_limits(vm, memory_size, memory_size, memory_size, memory_size)

And let me know if that works?

Best wishes

Jonathan Knowles

xen-api mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.