Project

General

Profile

Bug #5481

Foreman Proxy unable to remove DHCP reservation: "IP / mac - is static - unable to delete"

Added by Dmitry Sakun over 7 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
DHCP
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Hi Guys,

Foreman Proxy running on windows fail to delete previously created reservation. This one exists since 1.5 I believe.

native_ms module.

DHCP 'hostname' option (12) is wrongly enumerated as install_path and marks the record as NON-deletable and throw an exception (FP log):

---

D, [2014-04-28T23:04:32.519269 #2604] DEBUG -- : executing: c:\windows\sysnative\cmd.exe /c c:\Windows\System32\netsh.exe -c dhcp server \\DHCP.SERVER scope 10.8.67.0 Show ReservedOptionValue 10.8.67.25
I, [2014-04-28T23:04:33.018481 #2604]  INFO -- : Queried 10.8.67.25 options
D, [2014-04-28T23:04:33.018481 #2604] DEBUG -- : found option nextServer
D, [2014-04-28T23:04:33.018481 #2604] DEBUG -- : found option filename
D, [2014-04-28T23:04:33.018481 #2604] DEBUG -- : found option *install_path* <-- Should be hostname.
D, [2014-04-28T23:04:33.018481 #2604] DEBUG -- : {:install_path=>"hostname.domain.com", :filename=>"pxelinux.0", :nextServer=>"172.25.8.50"}
D, [2014-04-28T23:04:33.018481 #2604] DEBUG -- : {:install_path=>"hostname.domain.com", :mac=>"00:50:56:a3:3c:91", :subnet=>10.8.67.0/255.255.255.0, :nextServer=>"172.25.8.50", :filename=>"pxelinux.0", :ip=>"10.8.67.25"}
D, [2014-04-28T23:04:33.018481 #2604] DEBUG -- : Added 10.8.67.25 / 00:50:56:a3:3c:91 to 10.8.67.0/255.255.255.0
D, [2014-04-28T23:04:33.018481 #2604] DEBUG -- : Lazy loaded 10.8.67.0/255.255.255.0 records
E, [2014-04-28T23:04:33.018481 #2604] ERROR -- : 10.8.67.25 / 00:50:56:a3:3c:91 is static - unable to delete
D, [2014-04-28T23:04:33.018481 #2604] DEBUG -- : C:/Program Files (x86)/smart-proxy/bin/../lib/proxy/dhcp/server/native_ms.rb:18:in `delRecord'
C:/Program Files (x86)/smart-proxy/bin/../lib/dhcp_api.rb:109:in `DELETE /dhcp/:network/:record'

---

netsh output:

---

C:\>netsh.exe -c dhcp server \\DHCP.SERVER scope 10.8.67.0 Show ReservedOptionValue 10.8.67.25

Changed the current scope context to 10.8.67.0 scope.

Options for the Reservation Address 10.8.67.25 in the Scope 10.8.67.0 :

        DHCP Standard Options :
        General Option Values:
        OptionId : 66
        Option Value:
                Number of Option Elements = 1
                Option Element Type = STRING
                Option Element Value = 172.25.8.50
        OptionId : 60
        Option Value:
                Number of Option Elements = 1
                Option Element Type = STRING
                Option Element Value =
        OptionId : 67
        Option Value:
                Number of Option Elements = 1
                Option Element Type = STRING
                Option Element Value = pxelinux.0
        OptionId : 12
        Option Value:
                Number of Option Elements = 1
                Option Element Type = STRING
                Option Element Value = hostname.domain.com
Command completed successfully.

---

The test if the record is 'deleteable' is based on 'hostname' and it's done in native_ms.rb 'loadSubnetData' function:

---

            if opts.include? :hostname
              Proxy::DHCP::Reservation.new opts.merge({:deleteable => true})

---

Option assignment is done in dhcp.rb:

Standard = {
:hostname => {:code => 12, :kind => "String" }, # The host's name
:PXEClient => {:code => 60, :kind => "String" }, # Needs to be empty for foreman to function
:nextServer => {:code => 66, :kind => "String" }, # From where we download the pxeboot image via TFTP
:filename => {:code => 67, :kind => "String" } # The pxeboot image
}
SUNW = {
:root_server_ip => {:code => 2, :kind => "IPAddress" }, # 192.168.216.241
:root_server_hostname => {:code => 3, :kind => "String" }, # mediahost
:root_path_name => {:code => 4, :kind => "String" }, # /vol/solgi_5.10/sol10_hw0910/Solaris_10/Tools/Boot
:install_server_ip => {:code => 10, :kind => "IPAddress" }, # 192.168.216.241
:install_server_name => {:code => 11, :kind => "String" }, # mediahost
:install_path => {:code => 12, :kind => "String" }, # /vol/solgi_5.10/sol10_hw0910
:sysid_server_path => {:code => 13, :kind => "String" }, # 192.168.216.241:/vol/jumpstart/sysidcfg/sysidcfg_primary
:jumpstart_server_path => {:code => 14, :kind => "String" } # 192.168.216.241:/vol/jumpstart
}

Related issues

Related to Smart Proxy - Bug #4148: Unable to delete DHCP reservations on MS DCHP serversResolved2014-01-21
Related to Smart Proxy - Bug #13129: Intermittent failures in native MS test_records_should_have_options testsClosed2016-01-12
Has duplicate Smart Proxy - Bug #10556: Windows DHCP support Shows DHCP Entries as Leases and no HostnamesDuplicate2015-05-19

History

#1 Updated by Dominic Cleal over 7 years ago

  • Project changed from Foreman to Smart Proxy
  • Category changed from DHCP to DNS

#2 Updated by Dominic Cleal over 7 years ago

  • Category changed from DNS to DHCP

#3 Updated by Rich Chiavaroli about 7 years ago

I'm also being effected by this issue. Do we know what version this might be addressed in?

#4 Updated by Chris Pisano over 6 years ago

I am also seeing this behavior in the 1.8 release of the smart proxy. My workaround was to just comment out install_path under SUNW.

#5 Updated by Dominic Cleal over 6 years ago

  • Has duplicate Bug #10556: Windows DHCP support Shows DHCP Entries as Leases and no Hostnames added

#6 Updated by Dmitri Dolguikh almost 6 years ago

  • Related to Bug #4148: Unable to delete DHCP reservations on MS DCHP servers added

#7 Updated by Dmitri Dolguikh almost 6 years ago

  • Related to Bug #13129: Intermittent failures in native MS test_records_should_have_options tests added

#8 Updated by Dominic Cleal almost 6 years ago

  • Status changed from New to Feedback

A possible fix has been merged to the develop branch and should be in 1.10.2 as well when that's released. I'll mark this as feedback as it may resolve the issue - please let us know either way if you're able to test it.

#9 Updated by Anonymous over 4 years ago

  • Status changed from Feedback to Resolved

no reaction, closing

Also available in: Atom PDF