Project

General

Profile

Actions

Bug #2347

closed

Installation media in host may be lying.

Added by Jaroslav Henner about 11 years ago. Updated about 11 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Have an installation media (IM1) assigned to OS
Create hosts using the OS and IM1
Add another IM (IM2)
Disassociate the IM1 from the OS, so only IM2 remains
Observe hosts that were using IM1. Now they appear to use IM2, which is not true.

Actions #1

Updated by Greg Sutcliffe about 11 years ago

  • Status changed from New to Feedback

Can you clarify where you are looking? Is it just the templates associated with the host?

If so, then the situation you describe is correct - the templates display the data the host will use next time it is rebuilt. It does not necessarily display realtime data about current installation sources. If you want to see that, I'd suggest writing a custom fact.

Actions #2

Updated by Jaroslav Henner about 11 years ago

Templates? I didn't say anything about any template, where did you get this term? It is "installation media" even in the DB. Anyway, I think you understood.

Actions #3

Updated by Greg Sutcliffe about 11 years ago

Ok, to reference the original ticket, you said "Observe Hosts that were using IM1" - what page are you observing?

Actions #4

Updated by Jaroslav Henner about 11 years ago

https://FOREMAN/hosts/XXX/edit, the OperatingSystem tab.

Actions #5

Updated by Greg Sutcliffe about 11 years ago

Ah right, I see. Interesting point. Are you allowed to save the host again with the now-invalid media?

Actions #6

Updated by Ohad Levy about 11 years ago

if I understand this right, this happens when the relationship between the dropdowns changes, for example:

lets say you have a RHEL6.3 OS with Media Mirror defined.
when you upgrade to 6.4 a new OS object is created, where the Mirror media is not associated.

when editing the host, the media mirror is no longer allowed (even if its still in the db) as its related to the current os, and when you click on save, its the only time that you actually change the value.

Actions #7

Updated by Jaroslav Henner about 11 years ago

@Greg Sutcliffe: Yes, I am.
@Ohad: Let me try to be more clear.

By dissociating the IM1 from OS, the current media-host association doesn't change in the DB. This means that When I want to completely delete the media, I will not be allowed, there will be errors like "Cannot do that, host blah is using medium IM1.". That's quite OK.

But I IIRC it also means that if I click BUILD now, the host will get built from the old media IM1, not from the IM2 which is shown on the hosts page.

Following the description in the very first commit, I have state:

[root@puppet ~]# psql foreman foreman <<< 'select id, name from media';
 id |         name         
----+----------------------
...
 15 | IM1
 16 | IM2
(12 rows)

We don't have the IM1 associated with the selected OS (of id 8):

[root@puppet ~]# psql foreman foreman <<< 'select * from media_operatingsystems where operatingsystem_id = 8'
 medium_id | operatingsystem_id 
-----------+--------------------
        16 |                  8

Now check what will (IIRC) be used when clicked on BUILD:

[root@puppet ~]# psql foreman foreman <<< 'SELECT hosts.id, hosts.name, media.id, media.name as mn FROM hosts JOIN media ON (hosts.medium_id = media.id);'  
 id  |                         name                         | id |         mn         
-----+------------------------------------------------------+----+--------------------
 127 | foo.xxx.redhat.com                                   | 15 | IM1

But in the Operating System, it looks like the media IM2 would be used, as it is the only media associated with the OS

Actions

Also available in: Atom PDF