Open lukemarsden opened 3 years ago
I've seen similar states (ambiguous kernel, and ambiguous image) emerge from concurrent commands with v0.7.1 (I haven't updated to 0.8.0 yet). I would be very grateful if this behavior was fixed, because it was causing me some grief!
Thanks for reporting this issue. This is a known issue and a limitation of ignite's client only model. In the past, we discussed about this issue in the weekly dev calls. For other concurrency related issues, for example, where a resource that's required to create VM is busy, we create a lock file to coordinate multiple VM creation processes. But in case of images, if we follow the same model, we'll have to create a lock file for every unique image to avoid multiple processes pulling the same image. The current ignite image store has some drawbacks and we are looking for a good solution to solve such problems. One possible solution could be a client-server model. Once we have a server/daemon component that handles most of the ignite back-end work, such problems will go away.
Related issue: https://github.com/weaveworks/ignite/issues/559
Just to state things clearly, the current workaround for this is to import all dependent OS and kernel images before you start your concurrent workloads.
ex:
ignite kernel import quay.io/testfaster/ignite-kernel:latest
ignite image import weaveworks/ignite-ubuntu:20.04
ignite run weaveworks/ignite-ubuntu:20.04 --name vm-1 --kernel-image quay.io/testfaster/ignite-kernel:latest &
ignite run weaveworks/ignite-ubuntu:20.04 --name vm-2 --kernel-image quay.io/testfaster/ignite-kernel:latest &
ignite run weaveworks/ignite-ubuntu:20.04 --name vm-3 --kernel-image quay.io/testfaster/ignite-kernel:latest &
ignite run weaveworks/ignite-ubuntu:20.04 --name vm-4 --kernel-image quay.io/testfaster/ignite-kernel:latest &
My ignite host got into this state just by starting some VMs concurrently when the kernel image hadn't been downloaded yet:
Then of course no VMs can start because of this error:
Ignite really shouldn't allow multiple kernels to be created with the same name, nor images, even if they are being downloaded/injected simultaneously (overlapping/in parallel with eachother).