Inconsistent behavior while image option handling for Compute Profile between Web UI and Hammer

Using Web UI, currently user can configure an image using select dropdown on Host as well as on Compute Profile Page for their hosts. Later value gets stored inside compute-attribute.
Documentation link for reference.

On Hammer side, there is a separate --image-id option to set image value for a Host but no such option available for Compute Profile.

While GCE development, I used to pass image-id inside --compute-attributes option but with the Hammer PR-427 change it won’t display image-id under GCE’s compute-attributes on command hammer compute-profile values create --help.
So there is no option to set image-id at compute-profile level. This is inconsistent behavior with Web UI.

Considering below two points -

  1. Compute profile should describe the hardware configuration of the host like interfaces, and volumes and the OS is not relevant for compute profile
  2. There is no any place apart from compute profile where user can configure image-id for their hosts.

I think, pages may need some redesigning to make it appropriate and consistent OR hammer command needs to have an option to set image-id at Compute profile level.
Any thoughts on this?

I would like to know opinions from others to know real time use cases.

Kavita! thanks for opening this issue.

I would like to point out, that at the moment, only GCE and azure compute resources have image_id inside the compute profile AFAIK.

I believe that image_id should not be inside the compute profile currently, but we could defiantly re-think about compute profile and hostgroups.

@ezr-ondrej @Shimon_Shtein @Ori_Rabin @kgaikwad @Marek_Hulan I would love to hear what you think :slight_smile:

Please correct me if I’m wrong:
I think, there is an image selection on compute-profile form almost for every compute resource.
If no image present then this image selection gets disabled.
For Ovirt, it is disabled by default.

It is up to user whether he wants to configure that image at compute-profile level or not but no where in the documentation, it is mentioned that this is not recommended way. Since, it is showing on compute-profile page on Web UI, it is confusing.

@kgaikwad, not in all the compute resources - ovirt, kubevirt and libvirt don’t have an image id

We talked about it a bit in the office. Image is a bit problematic - it belongs to both compute resource selection and operating system selection aspects.
From my point of view, the user needs to select both compute profile and operating system before he can select an image: I would say the user story behind this is: "I want a medium machine on GCE with My app on Centos 7 on it. I want it to be installed from my predefined image". So if we want to include all three parameters in the same selection, it should be a new object that will include compute profile, compute resource, hostgroup and provisioning properties.

Yes, I agree but I am not sure whether it is good idea to add one more layer than modifying an existing ones.
Currently, image id option handling seems inconsistent between Web-UI + API and hammer. image_id removed from compute_attributes section inside help output on hammer side which might be to avoid confusion between --image-id(foreman side image id) and image_id(image uuid) in compute_attributes.
@shiramax - I am facing an issue in case of GCE and for all other CRs after this change on hammer side - Bug #28541: [Hammer] host creation using hostgroup fails - Hammer CLI - Foreman.
If we want to keep this behavior on hammer side then it would be good to fix obvious scenarios as well.