Comment 7 for bug 2028284

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: vm compose fails with - This "instances" entry already exists

There are three serialization errors happening between the time the compose command was being executed and the 'instance already exist' error happened. The most likely culprit is this:

2023-07-19 22:17:41.506 UTC [2508416] maas@maasdb ERROR: could not serialize ac
cess due to concurrent update
2023-07-19 22:17:41.506 UTC [2508416] maas@maasdb STATEMENT: UPDATE "maasserver_podhints" SET "pod_id" = 1, "cores" = 20, "memory" = 131072, "cpu_speed" = 2600, "local_storage" = 0, "cluster_id" = NULL WHERE "maasserver_podhints"."id" = 1

They way the compose form works is that it creates an instance in lxd and then it updates the pod hints in the database. After that it adds a post commit hook to refresh commissioning data for the pod, which also syncs the hints to the database.

So what can happen when composing multiple vms in a row is that the pod hint sync in the form and the one in the post commit from the previous compose command will conflict.

Still trying to figure out how to solve this.