Project

General

Profile

Actions

Bug #30386

open

Fixing the location mismatch of a provisioning template may cause hosts to assign to the wrong provisioning template.

Added by Dominik Matoulek almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Organizations and Locations
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1768331

Description of problem:
Foreman fixes the location mismatch by adding the missing location (lets say Sydney) to the provisioning template. This may cause all Hosts in "Sydney" location to resolve the incorrect template. Since the "find template" query is sorted by name, the first one found get assigned to the host.

How reproducible:
This bug will happen when following conditions are met:
- A hostgroup (with multiple locations) is associated to multiple provisioning templates. Web UI > Provisioning Template -> Edit a provisioning template -> Association -> Valid Host Group and Environment Combinations
Have multiple provisioning templates that organized by locations but not all their locations are matching the associated hostgroup.

Steps to Reproduce:
1. Create "Brisbane" and "Sydney" locations.
2. Create a Host Group (called "HG_A") and then associate "Brisbane" and "Sydney" locations to it. Select "RHEL 7.6" Operating system for it.
3. Create a host (called "Host_A").
- a. Click "Manage Host" button.
- b. Assign it to "HG_A" hostgroup
- c. Assign it to "Brisbane" location.
5. Clone the "Kickstart Default" provisioning template:
- a. Rename it as "Kicstart Default for Brisbane".
- b. Select all applicable Operating systems.
- c. Associate "HG_A" host group to it.
6. Edit "Kicstart Default for Brisbane", ensure the location is set to "Brisbane" ONLY.
7. Clone the "Kickstart Default" provisioning template again:
- a. Rename it as "Kicstart Default for Sydney".
- b. Select all applicable Operating systems.
- c. Associate "HG_A" host group to it.
8. Edit "Kicstart Default for Sydney", ensure the location is set to "Sydney" ONLY.
9. Go to Web UI -> Manage Locations -> Edit Brisbane -> Provisioning templates:
- a. Uncheck "All provisioning templates" option.
- b. Deselect "Kicstart Default for Sydney".
- c. Click Submit.
10. Go to Web UI -> Manage Locations -> Edit Sydney -> Provisioning templates:
- a. Uncheck "All provisioning templates" option.
- b. Deselect "Kicstart Default for Brisbane".
- c. Click Submit.
11. In the Web UI, Change current location to "Brisbane"
12. Edit the "Host_A" created in Step 2. Go to -> Operating System Tab -> Click "Resolve" button.

Notice that "Provisioning Template: Kicstart Default for Brisbane" is resolved. This is correct.

13. Go to All Hosts -> select "Host_A" -> Assign Location -> Select "Sydney" -> Select "Fix on mismatch".
14. In the Web UI, Change current location to "Sydny"
15. Edit the "Host_A" again. Go to -> Operating System Tab -> Click "Resolve" button.

Actual results:
It is still resolving "Kicstart Default for Brisbane"

Expected results:
"Kicstart Default for Sydney" to be resolved.

16. To make Foreman to resolve the correct provisioning Template. We need to go to Web UI -> Hosts -> Provisioning Templates -> "Kicstart Default for Brisbane" -> Locations -> Deselect "Sydney" location.

No data to display

Actions

Also available in: Atom PDF