Aligning instance names with the model name

When Juju gets instances from a substrate, it often has the option to give them a name, and it uses juju-xxxxxxx-y where I think xxxxxx is a model code and y is the machine number in that model.

Wouldn’t it be nicer to replace juju- with the model name? So then we would see instances in the cloud which are much easier to relate to actual functionality.

hadoop-334534-0
hadoop-334534-n

With many models, this would clean up my dashboards nicely.

Thoughts?

2 Likes

This seems like a very useful change. Should be cleaner on our dashboard and cloud dashboard/consoles also. Would enable filtering much more easily.

The only irritant would be the “default” model. “default” isn’t the best name for an instance prefix.

Yes indeed, that’s why I wanted to change the behaviour in a Juju 3.x to have no default model created at bootstrap. We would also have no model selected so you would need to either ‘juju switch’ to the controller model, or ‘juju add-model’ to get a new one. We missed that trick when we went multi-model in 2.0 iirc.

$ juju bootstrap

$ juju deploy foo
Error - no model selected. ‘switch’ to an existing model or ‘add-model’ for a new one.

1 Like

I think we’d definitely need to have some way to shorten the model name if necessary to keep the instance ids short. Not all models have short names.

Yes. The cloud-specific provisioning code would know what the limitations are for that substrate, and could safely truncate the model name since there is still the model uuid in the instance name.