Project

General

Profile

Actions

Bug #26086

open

Unable to delete a DHCP record: 400 bad request: "XYZ is static - unable to delete" when editing PXE loader

Added by Lukas Zapletal about 5 years ago. Updated almost 5 years ago.

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

Description

I booted a physical server via discovery, provisioned it and haven't started it yet but wanted to change PXELoader. Once I hit Submit I am getting error "[E] 192.168.199.15 / 00:c0:3a:d1:01:8f is static - unable to delete".

server-duid "\000\001\000\001#\227\317\307RT\000\302\234\335";

lease 192.168.199.14 {
  starts 2 2019/02/19 13:52:33;
  ends 3 2019/02/20 01:52:33;
  cltt 2 2019/02/19 13:52:33;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 00:c0:3a:d1:01:8f;
  uid "\377:\321\001\217\000\004\312\202\015\016\203\247M\004\240\037\263zt]\317\010";
}
lease 192.168.199.15 {
  starts 2 2019/02/19 13:54:44;
  ends 3 2019/02/20 01:54:44;
  cltt 2 2019/02/19 13:54:44;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 00:c0:3a:d1:01:8f;
}
lease 192.168.199.15 {
  starts 2 2019/02/19 13:58:19;
  ends 3 2019/02/20 01:58:19;
  cltt 2 2019/02/19 13:58:19;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 00:c0:3a:d1:01:8f;
}
lease 192.168.199.15 {
  starts 2 2019/02/19 13:59:41;
  ends 3 2019/02/20 01:59:41;
  cltt 2 2019/02/19 13:59:41;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 00:c0:3a:d1:01:8f;
}
lease 192.168.199.15 {
  starts 2 2019/02/19 14:03:58;
  ends 3 2019/02/20 02:03:58;
  cltt 2 2019/02/19 14:03:58;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 00:c0:3a:d1:01:8f;
}
host mac00c03ad1018f.nat.lan {
  dynamic;
  hardware ethernet 00:c0:3a:d1:01:8f;
  fixed-address 192.168.199.15;
        supersede server.filename = "pxelinux.0";
        supersede server.next-server = c0:a8:c7:0b;
        supersede host-name = "mac00c03ad1018f.nat.lan";
}
host mac00c03ad1018f.nat.lan {
  dynamic;
  deleted;
}
host mac00c03ad1018f.nat.lan {
  dynamic;
  hardware ethernet 00:c0:3a:d1:01:8f;
  fixed-address 192.168.199.15;
        supersede server.filename = "pxelinux.0";
        supersede server.next-server = c0:a8:c7:0b;
        supersede host-name = "mac00c03ad1018f.nat.lan";
}
host mac00c03ad1018f.nat.lan {
  dynamic;
  deleted;
}
host mac00c03ad1018f.nat.lan {
  dynamic;
  hardware ethernet 00:c0:3a:d1:01:8f;
  fixed-address 192.168.199.15;
        supersede server.filename = "pxelinux.0";
        supersede server.next-server = c0:a8:c7:0b;
        supersede host-name = "mac00c03ad1018f.nat.lan";
}

It looks like lease record type breaks this - foreman-proxy thinks it's the lease I want to remove not the dynamic record:

curl --cert /etc/foreman/client_cert.pem --key /etc/foreman/client_key.pem --cacert /etc/foreman/proxy_ca.pem https://$(hostname):9090/dhcp/192.168.199.0 | json_reformat 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   884  100   884    0     0   6795      0 --:--:-- --:--:-- --:--:--  6800
{
    "reservations": [
        {
            "name": "mac00c03ad1018f.nat.lan",
            "ip": "192.168.199.15",
            "mac": "00:c0:3a:d1:01:8f",
            "subnet": "192.168.199.0/255.255.255.0",
            "type": "reservation",
            "deleteable": true,
            "hostname": "mac00c03ad1018f.nat.lan",
            "hardware_type": "ethernet",
            "filename": "pxelinux.0",
            "nextServer": "192.168.199.11" 
        }
    ],
    "leases": [
        {
            "name": "lease-00c03ad1018f",
            "ip": "192.168.199.15",
            "mac": "00:c0:3a:d1:01:8f",
            "subnet": "192.168.199.0/255.255.255.0",
            "starts": "2019-02-19 14:03:58 UTC",
            "ends": "2019-02-20 02:03:58 UTC",
            "state": "active",
            "type": "lease",
            "cltt": "2019-02-19 14:03:58 UTC",
            "next_state": "free",
            "hardware_type": "ethernet" 
        }
    ]
}

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #19634: DHCP lease removal leads to errorClosedLukas Zapletal05/23/2017Actions
Actions

Also available in: Atom PDF