MAAS LXD VM creation issue (Ensure this value is less than or equal to 0)

Hi All,

In summary - I have an issue creating VM’s through MAAS and LXD.
The error:
Ensure this value is less than or equal to 0 for CPU and RAM.

I have the latest version of MAAS running: 3.4.0-14319-g.3ab76533f
I decided to setup an LXD host to see the integration between the two…

I installed LXD (5.19) with no issues:

cat <<EOF | sudo lxd init --preseed
  core.https_address: '[::]:8443'
  core.trust_password: somethingsecurehere
networks: []
- config:
    source: /dev/md0
  description: ""
  name: ecstoragepool
  driver: zfs
- config: {}
  description: ""
      name: eth0
      nictype: macvlan
      parent: enp51s0f0np0
      type: nic
      path: /
      pool: ecstoragepool
      type: disk
  name: default
projects: []
cluster: null

I didn’t add the MAAs link within the init as I get SSL issues due to the self signed cert. Keen to resolve this also if someone has anything useful - the machine isn’t accessible externally.

Within LXD I enabled the UI and added a vm. again with no issues.
To help, I deleted this VM before the next steps.

I then went into MAAS and added an LXD host.
No issues.

With MAAs I then try to add a vm but get errors for both CPU and RAM:
Error: Ensure this value is less than or equal to 0.

It doesn’t matter what I put in here, it won’t create.

I then added a new VM via the LXD ui and it worked fine (still).
After about 10 minutes it also showed up in MAAS saying it was commissioning (which it isn’t).
I can however delete this VM from MAAS, it can also see all the info correctly…

Any help would be great.


Hi @ec-d ,

Sounds like you’ve hit Bug #1951842 “Cannot compose VM in MAAS UI” : Bugs : MAAS

Hi @r00ta, I did see that bug, but it was raised quite a few years ago and on 3.0.
Likewise his issues a refresh resolves the issue. for me this isn’t the case.
I have check the logs and I don’t see any errors.

I’ll take another look though and submit a bug if I haven’t missed something.

the log for anyone interested:


2024-01-05 13:58:19 maasserver.websockets.protocol: [critical] Error on request (39) pod.compose: {“cores”: [“Ensure this value is less than or equal to 0.”], “memory”: [“Ensure this value is less than or equal to 0.”]}
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/twisted/internet/”, line 700, in errback
File “/usr/lib/python3/dist-packages/twisted/internet/”, line 763, in _startRunCallbacks
File “/usr/lib/python3/dist-packages/twisted/internet/”, line 857, in _runCallbacks
current.result = callback( # type: ignore[misc]
File “/usr/lib/python3/dist-packages/twisted/internet/”, line 1750, in gotResult, r, gen, status)
— —
File “/usr/lib/python3/dist-packages/twisted/internet/”, line 1656, in _inlineCallbacks
result =
File “/usr/lib/python3/dist-packages/twisted/python/”, line 489, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File “/usr/lib/python3/dist-packages/maasserver/websockets/handlers/”, line 317, in compose
form = await deferToDatabase(get_form, pod, params)
File “/usr/lib/python3/dist-packages/twisted/python/”, line 244, in inContext
result = inContext.theWork() # type: ignore[attr-defined]
File “/usr/lib/python3/dist-packages/twisted/python/”, line 260, in
inContext.theWork = lambda: # type: ignore[attr-defined]
File “/usr/lib/python3/dist-packages/twisted/python/”, line 117, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File “/usr/lib/python3/dist-packages/twisted/python/”, line 82, in callWithContext
return func(*args, **kw)
File “/usr/lib/python3/dist-packages/provisioningserver/utils/”, line 856, in callInContext
return func(*args, **kwargs)
File “/usr/lib/python3/dist-packages/provisioningserver/utils/”, line 203, in wrapper
result = func(*args, **kwargs)
File “/usr/lib/python3/dist-packages/maasserver/utils/”, line 771, in call_within_transaction
return func_outside_txn(*args, **kwargs)
File “/usr/lib/python3/dist-packages/maasserver/utils/”, line 574, in retrier
return func(*args, **kwargs)
File “/usr/lib/python3.10/”, line 79, in inner
return func(*args, **kwds)
File “/usr/lib/python3/dist-packages/maasserver/websockets/handlers/”, line 307, in get_form
raise HandlerValidationError(form.errors)
maasserver.websockets.base.HandlerValidationError: {‘cores’: [‘Ensure this value is less than or equal to 0.’], ‘memory’: [‘Ensure this value is less than or equal to 0.’]}

I created a bug: Bug #2048774 “Cannot compose VM in MAAS UI (again)” : Bugs : MAAS

because I have exact same problem.

I have created one also.

I’m marking this as solved as we will track this in the lp bug. Thanks for raising this!