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
config:
  core.https_address: '[::]:8443'
  core.trust_password: somethingsecurehere
networks: []
storage_pools:
- config:
    source: /dev/md0
  description: ""
  name: ecstoragepool
  driver: zfs
profiles:
- config: {}
  description: ""
  devices:
    eth0:
      name: eth0
      nictype: macvlan
      parent: enp51s0f0np0
      type: nic
    root:
      path: /
      pool: ecstoragepool
      type: disk
  name: default
projects: []
cluster: null
EOF

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.

Thanks,

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:

regiond.log

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/defer.py”, line 700, in errback
self._startRunCallbacks(fail)
File “/usr/lib/python3/dist-packages/twisted/internet/defer.py”, line 763, in _startRunCallbacks
self._runCallbacks()
File “/usr/lib/python3/dist-packages/twisted/internet/defer.py”, line 857, in _runCallbacks
current.result = callback( # type: ignore[misc]
File “/usr/lib/python3/dist-packages/twisted/internet/defer.py”, line 1750, in gotResult
current_context.run(_inlineCallbacks, r, gen, status)
— —
File “/usr/lib/python3/dist-packages/twisted/internet/defer.py”, line 1656, in _inlineCallbacks
result = current_context.run(
File “/usr/lib/python3/dist-packages/twisted/python/failure.py”, line 489, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File “/usr/lib/python3/dist-packages/maasserver/websockets/handlers/pod.py”, line 317, in compose
form = await deferToDatabase(get_form, pod, params)
File “/usr/lib/python3/dist-packages/twisted/python/threadpool.py”, line 244, in inContext
result = inContext.theWork() # type: ignore[attr-defined]
File “/usr/lib/python3/dist-packages/twisted/python/threadpool.py”, line 260, in
inContext.theWork = lambda: context.call( # type: ignore[attr-defined]
File “/usr/lib/python3/dist-packages/twisted/python/context.py”, line 117, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File “/usr/lib/python3/dist-packages/twisted/python/context.py”, line 82, in callWithContext
return func(*args, **kw)
File “/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py”, line 856, in callInContext
return func(*args, **kwargs)
File “/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py”, line 203, in wrapper
result = func(*args, **kwargs)
File “/usr/lib/python3/dist-packages/maasserver/utils/orm.py”, line 771, in call_within_transaction
return func_outside_txn(*args, **kwargs)
File “/usr/lib/python3/dist-packages/maasserver/utils/orm.py”, line 574, in retrier
return func(*args, **kwargs)
File “/usr/lib/python3.10/contextlib.py”, line 79, in inner
return func(*args, **kwds)
File “/usr/lib/python3/dist-packages/maasserver/websockets/handlers/pod.py”, 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!