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: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
Date: Wed, 25 Nov 2009 10:55:18 +0000
Cc: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 25 Nov 2009 02:55:22 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4B0D0470.1060402@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>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Hi Marco

Jonathan Knowles wrote:
XAPI raises a MEMORY_CONSTRAINT_VIOLATION exception (during an API call) if it believes that carrying out the call would violate the following memory constraint for any VM:

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

Here's some further information.

When you first install a VM, XAPI initializes the new VM's
memory fields according to:

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

The "static-min" and "static-max" fields define /hard/ limits
on the size of a running VM. For example, "static-max" acts
as an upper bound for the size of a running VM - the VM can
never grow to exceed the static maximum size. Once you've
started a VM, XAPI will prevent you from changing either of
these static limits.

The "dynamic-min" and "dynamic-max" fields define /soft/ limits
on the size of a running VM. These limits constitute a "dynamic
memory range". Unlike the static fields, XAPI /will/ let you
change the dynamic fields at any time after a VM has started.

XAPI will at all times try to keep your VM within its dynamic
memory limits. However, to achieve this, it relies completely
on co-operation from a balloon driver running within the guest
operating system. (If your guest doesn't have a balloon driver
installed, then it will consume memory equal to static-max.)

If you only want to change a VM's size, and are not interested
in using dynamic memory control, or if your VM does not have a
balloon driver installed, then it's best to make sure that its
memory fields satisfy:

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

Probably the easiest way to do this is to use the following
function, remembering to keep the last three values the same:

    xe vm-memory-limits-set     \
        static-min=<value>      \
        dynamic-min=<value>     \
        dynamic-max=<value>     \
        static-max=<value>

Let me know if you have any further questions, and I'll try
to help :).

Best wishes

Jonathan Knowles

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