Project

General

Profile

Actions

Bug #9173

open

deleted hosts keep reappearing in hosts table

Added by Jorick Astrego about 9 years ago. Updated about 9 years ago.

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

Description

When I delete hosts in the foreman, they keep reappearing in the hosts table of the foreman db.

This way I cannot reuse the hostname and mac to reprovision. When I power down the host after deletion after a while the host get's removed from the table and I can reprovision.

I think the hosts table shouldn't auto populate with active dhcp leases of deleted hosts.

Actions #1

Updated by Jorick Astrego about 9 years ago

What's also annoying of this problem, is that the host doesn't reboot into discovery because of this. The MAC remains in /var/lib/tftpboot/pxelinux.cfg and the system still thinks it has been provisioned.

Actions #2

Updated by Jorick Astrego about 9 years ago

All these ghost hosts have status 12288 whatever that may imply:

    65 | gluster-test1.netbulae.test |               |                     |                 | 2015-01-28 12:16:13        | 2015-01-28 12:16:15.222642 |                | 2015-01-28 11:16:19.402211
     |                   |                                    |        |         12288 |           |                 |                    |                |           |           |           | f
         |         |      |                            |          |              |          |            | t       |                  1 | f       |           |            |      |              
          |               1 |                        |          |                 |             | Host::Managed |     |          |                    |                  |                 

    foreman=# select * from reports where host_id=65;
      id  | host_id |     reported_at     |         created_at         |         updated_at         | status |                    metrics                    
    ------+---------+---------------------+----------------------------+----------------------------+--------+------------------------------------------------
     9569 |      65 | 2015-01-28 11:46:13 | 2015-01-28 11:46:15.565636 | 2015-01-28 11:46:15.565636 |  12288 | --- !ruby/hash:ActionController::Parameters {}
                                                                                                             :
     9561 |      65 | 2015-01-28 11:16:13 | 2015-01-28 11:16:19.46055  | 2015-01-28 11:16:19.46055  |  12288 | --- !ruby/hash:ActionController::Parameters {}
                                                                                                             :
    (2 rows)

And another:

    foreman=# select * from reports where host_id=69;
      id  | host_id |     reported_at     |         created_at         |         updated_at         | status |                    metrics                    
    ------+---------+---------------------+----------------------------+----------------------------+--------+------------------------------------------------
     9575 |      69 | 2015-01-28 12:04:29 | 2015-01-28 12:04:32.780189 | 2015-01-28 12:04:32.780189 |  12288 | --- !ruby/hash:ActionController::Parameters {}
                                                                                                             :
     9567 |      69 | 2015-01-28 11:34:29 | 2015-01-28 11:34:32.695707 | 2015-01-28 11:34:32.695707 |  12288 | --- !ruby/hash:ActionController::Parameters {}
                                                                                                             :
    (2 rows)
Actions #3

Updated by Dominic Cleal about 9 years ago

  • Category changed from DHCP to Importers

Just a couple of observations: the TFTP file should be deleted from pxelinux.cfg when the host is deleted, that indicates an issue of some sort has occurred. (app/models/concerns/orchestration/tftp.rb should queue deletion.)

Perhaps Foreman Discovery should have some feature to trigger a reboot of the host on deletion, so it goes back into Discovery mode?

Actions

Also available in: Atom PDF