WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

Re: [Xen-API] exception MEMORY_CONSTRAINT_VIOLATION

To: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
Subject: Re: [Xen-API] exception MEMORY_CONSTRAINT_VIOLATION
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3ijOOd3bZvamWtHHOh3RemD0DGxlFbFt4tdtZz7uyTM=; b=G+8A3lTyfZum1aIkLd/ZSLhW7pzapudyBOoKTcfptsAGLJOdcFNdXeu+cCNc6rCp4u tE5SXeApBWBJbMBrgBfGc774UyVudtsBDvri4HGqv6VQ1B4G/TSBCpoTapqjlhXHt7Uy kQ5IegiP3vThVId4Iy3c6I17XaxI16aYM9VD0=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4B0D198E.3060401@xxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <20fe3cf60911242144j6f684c07o2233be697eb14ebf@xxxxxxxxxxxxxx> <4B0D0470.1060402@xxxxxxxxxxxxx> <20fe3cf60911250334j1d5043d8v45ae5c2b4828e40d@xxxxxxxxxxxxxx> <4B0D198E.3060401@xxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>