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.