No cores and memory accepted when creating VM on LXD host

Trying to create VM in an LXD host. Even if there are a lot of memory and cores, it will not accept it.
Any ideas what could be wrong?
Skärmbild 2022-02-02 163836

Hi @bjornrun,

  • what version of MAAS and LXD are you using?
  • is the number of available cores and memory correct for this VM host?
  • could you please look at logs (/var/snap/maas/common/log/{maas,regiond,rackd}.log) for errors

I was on latest/edge and realised it is better to be on 3.1/stable for support. I have already switched to it. I’ll check if I get same problem on same LXD server…

The UI is different on 3.1/stable but the error is the same.
Log excerpt:

2022-02-02 17:41:45 metadataserver.api: [critical] ml36-lxd.maas(68rhbx): commissioning script ‘50-maas-01-commissioning’ failed during post-processing.
Traceback (most recent call last):
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/api.py”, line 817, in signal
target_status = process(node, request, status)
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/api.py”, line 641, in _process_commissioning
self._store_results(
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/api.py”, line 529, in _store_results
script_result.store_result(
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/models/scriptresult.py”, line 376, in store_result
signal_status = try_or_log_event(
— —
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/api.py”, line 447, in try_or_log_event
func(*args, **kwargs)
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/builtin_scripts/hooks.py”, line 956, in process_lxd_results
_process_lxd_resources(node, data)
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/builtin_scripts/hooks.py”, line 589, in _process_lxd_resources
network_devices = update_node_network_information(node, data, numa_nodes)
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/builtin_scripts/hooks.py”, line 221, in update_node_network_information
update_node_interfaces(node, data)
File “/snap/maas/18199/lib/python3.8/site-packages/provisioningserver/utils/twisted.py”, line 202, in wrapper
result = func(*args, **kwargs)
File “/snap/maas/18199/lib/python3.8/site-packages/maasserver/utils/orm.py”, line 740, in call_within_transaction
return func_within_txn(*args, **kwargs)
File “/usr/lib/python3.8/contextlib.py”, line 75, in inner
return func(*args, **kwds)
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/builtin_scripts/network.py”, line 101, in update_node_interfaces
interface = update_interface(
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/builtin_scripts/network.py”, line 168, in update_interface
return update_child_interface(node, name, network, links)
File “/snap/maas/18199/lib/python3.8/site-packages/metadataserver/builtin_scripts/network.py”, line 391, in update_child_interface
interface = child_type.objects.get_or_create_on_node(
File “/snap/maas/18199/lib/python3.8/site-packages/maasserver/models/interface.py”, line 500, in get_or_create_on_node
interface = self.create(
File “/snap/maas/18199/usr/lib/python3/dist-packages/django/db/models/manager.py”, line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File “/snap/maas/18199/usr/lib/python3/dist-packages/django/db/models/query.py”, line 422, in create
obj.save(force_insert=True, using=self.db)
File “/snap/maas/18199/lib/python3.8/site-packages/maasserver/models/interface.py”, line 1875, in save
super().save(*args, **kwargs)
File “/snap/maas/18199/lib/python3.8/site-packages/maasserver/models/interface.py”, line 1645, in save
return super().save(*args, **kwargs)
File “/snap/maas/18199/lib/python3.8/site-packages/maasserver/models/cleansave.py”, line 183, in save
self.full_clean(
File “/snap/maas/18199/usr/lib/python3/dist-packages/django/db/models/base.py”, line 1203, in full_clean
raise ValidationError(errors)
django.core.exceptions.ValidationError: {‘mac_address’: [‘This field cannot be blank.’]}

2022-02-02 17:41:45 regiond: [info] 10.8.8.184 POST /MAAS/metadata/latest/ HTTP/1.1 --> 200 OK (referrer: -; agent: Python-urllib/3.8)
2022-02-02 17:41:49 regiond: [info] 10.8.8.183 GET /MAAS/rpc/ HTTP/1.1 --> 200 OK (referrer: -; agent: provisioningserver.rpc.clusterservice.ClusterClientService)
2022-02-02 17:42:04 regiond: [info] 10.8.8.184 GET /MAAS/rpc/ HTTP/1.1 --> 200 OK (referrer: -; agent: provisioningserver.rpc.clusterservice.ClusterClientService)
2022-02-02 17:42:19 regiond: [info] 10.8.8.183 GET /MAAS/rpc/ HTTP/1.1 --> 200 OK (referrer: -; agent: provisioningserver.rpc.clusterservice.ClusterClientService)
2022-02-02 17:42:34 regiond: [info] 10.8.8.184 GET /MAAS/rpc/ HTTP/1.1 --> 200 OK (referrer: -; agent: provisioningserver.rpc.clusterservice.ClusterClientService)
2022-02-02 17:42:49 regiond: [info] 10.8.8.183 GET /MAAS/rpc/ HTTP/1.1 --> 200 OK (referrer: -; agent: provisioningserver.rpc.clusterservice.ClusterClientService)
2022-02-02 17:42:51 regiond: [info] 100.82.220.113 GET /MAAS/accounts/login/ HTTP/1.1 --> 200 OK (referrer: http://10.8.8.183:5240/MAAS/r/settings; agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.175 Safari/537.36)
2022-02-02 17:43:04 regiond: [info] 10.8.8.184 GET /MAAS/rpc/ HTTP/1.1 --> 200 OK (referrer: -; agent: provisioningserver.rpc.clusterservice.ClusterClientService)
2022-02-02 17:43:09 maasserver.websockets.protocol: [critical] Error on request (108) 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 “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/internet/defer.py”, line 501, in errback
self._startRunCallbacks(fail)
File “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/internet/defer.py”, line 568, in _startRunCallbacks
self._runCallbacks()
File “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/internet/defer.py”, line 654, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/internet/defer.py”, line 1475, in gotResult
_inlineCallbacks(r, g, status)
— —
File “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/internet/defer.py”, line 1416, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/python/failure.py”, line 491, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File “/snap/maas/18199/lib/python3.8/site-packages/maasserver/websockets/handlers/pod.py”, line 317, in compose
form = await deferToDatabase(get_form, pod, params)
File “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/python/threadpool.py”, line 250, in inContext
result = inContext.theWork()
File “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/python/threadpool.py”, line 266, in
inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
File “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/python/context.py”, line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File “/snap/maas/18199/usr/lib/python3/dist-packages/twisted/python/context.py”, line 85, in callWithContext
return func(*args,**kw)
File “/snap/maas/18199/lib/python3.8/site-packages/provisioningserver/utils/twisted.py”, line 870, in callInContext
return func(*args, **kwargs)
File “/snap/maas/18199/lib/python3.8/site-packages/provisioningserver/utils/twisted.py”, line 202, in wrapper
result = func(*args, **kwargs)
File “/snap/maas/18199/lib/python3.8/site-packages/maasserver/utils/orm.py”, line 756, in call_within_transaction
return func_outside_txn(*args, **kwargs)
File “/snap/maas/18199/lib/python3.8/site-packages/maasserver/utils/orm.py”, line 559, in retrier
return func(*args, **kwargs)
File “/usr/lib/python3.8/contextlib.py”, line 75, in inner
return func(*args, **kwds)
File “/snap/maas/18199/lib/python3.8/site-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.’]}

Not sure if it is the same problem I had, but when I saw this I had to select the “Take action” button on the problematic KVM (in the UI) and select “Refresh”. Not sure what is causing it, but it looks like the metadata gets desync’d and prevents me from being able to compose VMs / machines as I need them.

HTH

  • Bill

It seems related to how the LXD server is set up. If MAAS creates the LXD server, it just works. About to investigate the differences.

@bjornrun, what did you discover when you did the diff above?