[2.5, 2.4] Errors about over commit ratios unclear

Bug #1783913 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Andres Rodriguez

Bug Description

I saw the following traceback when trying to create a VM with more resources (memory) than the ratio allowed me to. Instead of such a nasty error, and an unclear message, MAAS should:

1. Tell which pod is the VM failing to create.
2. Tell what resources have been requested, what's available and what the over commit ratio is set.
3. Suggest to increase over commit ratio.

e.g. "Unable to compose machine on pod 'XYZ'. Amount of memory requested is 11111, the current available memory is 00000111. The over commit ratio is set to. If you would like to create VM's, please increase the over commit ratio."

2018-07-27 00:46:14 provisioningserver.rpc.common: [debug] [RPC -> responding] AmpBox({b'_answer': b'30f'})
2018-07-27 00:46:14 maasserver: [error] ################################ Exception: Memory over commit ratio is 1.0 and there are 1820 available resources. ################################
2018-07-27 00:46:14 maasserver: [error] Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line 277, in view_atomic_with_post_commit_savepoint
    return view_atomic(*args, **kwargs)
  File "/usr/lib/python3.6/contextlib.py", line 52, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 70, in __call__
    response = upcall(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/views/decorators/vary.py", line 21, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 190, in __call__
    result = self.error_handler(e, request, meth, em_format)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 188, in __call__
    result = meth(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 310, in dispatch
    return function(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 173, in wrapper
    return func(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/api/pods.py", line 245, in compose
    machine = form.compose()
  File "/usr/lib/python3/dist-packages/maasserver/forms/pods.py", line 517, in compose
    name=self.pod.name).wait(timeout)
  File "/usr/lib/python3/dist-packages/crochet/_eventloop.py", line 231, in wait
    result.raiseException()
  File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 385, in raiseException
    raise self.value.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
    result = inContext.theWork()
  File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 884, in callInContext
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 233, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 756, in call_within_transaction
    return func_outside_txn(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 563, in retrier
    return func(*args, **kwargs)
  File "/usr/lib/python3.6/contextlib.py", line 52, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/maasserver/forms/pods.py", line 455, in check_over_commit_ratios
    raise PodProblem(over_commit_message)
maasserver.exceptions.PodProblem: Memory over commit ratio is 1.0 and there are 1820 available resources.

Tags: pod sprint track

Related branches

Changed in maas:
importance: Undecided → High
status: New → Triaged
tags: added: pod
Changed in maas:
milestone: none → 2.5.0alpha2
description: updated
Changed in maas:
milestone: 2.5.0alpha2 → 2.5.0beta1
Changed in maas:
assignee: nobody → Newell Jensen (newell-jensen)
Changed in maas:
milestone: 2.5.0beta1 → 2.5.0beta2
tags: added: sprint track
Changed in maas:
assignee: Newell Jensen (newell-jensen) → Andres Rodriguez (andreserl)
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.