Running multiple instances of a package

Hi,

I create a package with my executable. I am able to run one instance of the package in my qemu-kvm Linux host but when I whish to create a second instance with a different config file it says

qemu-system-aarch64: -device virtio-blk-pci,drive=hd0: Failed to get "write" lock
Is another process using the image [/home/axo/.ops/images/axonet-router]?

For my application purpose, I need to run multiple dozens of the same executable but with differents configs (using different network ports) on the same qemu host. Its also planned to have thousands of hosts, each running multiple dozens of the same code (with different configs).

Is that possibility planned to be feasible in future releases or do I need to create a unique image for each instance?

Thank you,
Francois

Hi Francois,

In the past we’ve been naming the images differently with ‘-i ’. This is accessible for both ‘pkg load’ and ‘image create’. If you are changing the config in most cases you’ll be changing the actual contents of the image itself so you’ll need a copy regardless.

This typically isn’t an issue if you are deploying to the cloud or some other hosted provider cause they copy the images for you but if you are just using ops locally to do the hosting then you are right that you’ll need a copy.

We could add some sort of ‘copy image on boot’ type of option for ‘instance create’ although you still need a different config per image.

One thing to consider is that if you are using a bridged ip you wouldn’t need different ports but if you are handing out different ports it sounds like you would know about those before hand and if that’s the case perhaps the cloud_init might come in handy?

Thank you for your answer. I will then create multiple named images. It works fine this way.
Also thanks for the bridge networking suggestion.

Francois