Comment 0 for bug 2056324

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote : Magnum unobviosly fails to create a cluster template when more then 1 image exists

At the moment, if there're more then 1 image that match the provided name, Magnum fails to create a cluster template with:

`Cluster type (vm, None, kubernetes) not supported`

Eventually, there're multiple bugs and way forward with that incorporated. From what I do see in code, there's a verification, that only 1 resource should be returned, otherwise an exception should be raised:

https://opendev.org/openstack/magnum/src/commit/9d6eae72cc320005f0c588e65acbfd16617008c8/magnum/api/utils.py#L112-L138

This check is triggered from here:
https://opendev.org/openstack/magnum/src/commit/9d6eae72cc320005f0c588e65acbfd16617008c8/magnum/api/attr_validator.py#L36

However, the exception is highly likely suppressed on some higher level, and meaningless `luster type (vm, None, kubernetes) not supported` being raised instead.

On other note, it would make sense to always ask for latest image and avoid such confusing situations. But I can see how Magnum might want to explicitly fail on creation in such cases.

However, there is another related bug to current behaviour, which is that Magnum will fetch all images by name, even deactivated ones, which should be filtered out in a request:

In the paste below you can see, that Magnum got 2 images, one of which is deactivated, and then failed with `Cluster type (vm, None, kubernetes) not supported`:
https://paste.openstack.org/show/bAcVuwGePhihSLs7xGG0/