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

Re: [Xen-API] exception MEMORY_CONSTRAINT_VIOLATION


  • To: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
  • From: Marco Sinhoreli <msinhore@xxxxxxxxx>
  • Date: Wed, 25 Nov 2009 12:29:20 -0200
  • Cc: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 25 Nov 2009 06:29:21 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=NAtnb3Yr+N32kvOwgAqN5vcpfJnRvzAlFnNJbDK8qbVImWcU0BWymY7yQdtyWN4GSP +vESP9PLrysLxMSO8jWwVq/xR+mq1vxeZhVZ6/8cceLOIb/sqKTlv0Z5yIpqkQP8drsI F/AmihhlcXAmutmCJHoZ513L0x+f/pOpuSdSI=
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

Hi Jonathan,

Thanks very much for your help! The set_memory_limits not found in API
documentation, therefore I didn't used this function.

Cheers,

On Wed, Nov 25, 2009 at 9:48 AM, Jonathan Knowles
<jonathan.knowles@xxxxxxxxxxxxx> wrote:
> Marco Sinhoreli wrote:
>>
>> I'm using the python xenapi. Above the source code for setup VM memory
>> dynamic and static:
>>
>> <code>
>> [...]
>> # 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)
>> [...]
>> </code>
>
> Okay, I think I can see the problem here.
>
> XAPI rejects any API calls that would violate the following
> constraint:
>
> Â Â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:
>
>> <code>
>> [...]
>> # 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)
>> [...]
>> </code>
>
> And let me know if that works?
>
> Best wishes
>
> Jonathan Knowles
>



-- 
Marco Sinhoreli

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api


 


Rackspace

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