06-05-2018 12:53 PM
I'd like to create a host record with an unlimited lease. I've created a Fixed/Reservation DHCP template with an ulimited lease. When creating the host record, I add the MAC and check DHCP, but there is no way to associate the unlimited fixed template to the host record and it gets the inherited template charactersitcs from the subnet/grid.
The only way I can do this is to create a fixed record to which I can assign the unlimited template. I was hoping to keep consistency and make everything that is possible like this a host record, i.e. if I dump/export record:host via the API, I won't see the fixed record.. is there a reason host records with a MAC and DHCP checked can't be assigned a DHCP template? Thanks.
Solved! Go to Solution.
06-06-2018 08:22 AM
What are some of the options that are in your template that you're looking to define? In effect, a host with a MAC is "unlimited" in terms of holding the IP address but, as with any dynamically assigned address, you still want a finite lease during. This ensures the client will periodically check to ensure it has the latest DHCP assigned settings (like DNS server assignment, etc).
06-06-2018 10:02 AM
During our build process (and subsequent re-builds), the IP is given out via fixed DHCP this way, but after the host is built, the build process then makes it static on the client side so it will never check in again. This is the reason for the unlimited lease. In any case, it is interesting that a DHCP template can be assigned to a fixed address reord, but not a host record.
06-06-2018 10:53 AM
Technically speaking, a true "unlimited" lease is always a bad idea since that would mean an actual DHCP client would not check (within any reasonable time frame) for updated DHCP options. That said, if the host is statically configured, it would occupy that IP address statically now so the lease time would be unimportant.
I've seen many companies use an IP range to temporarily assign an IP to a device, complete the build process, and then essentially "move" the client to a different IP for permanent assigment. I've also seen companies that use essentially the "next available" IP address and just keep cycling through as they build out their devices. Once the host is in play with a MAC address, nothing else will acquire said IP address (it's essentially a permanent reservation to the MAC, even though the device -- when on a DHCP configuration -- will still get a realistic lease time and the options associated with the range).
When you say a template is added to the fixed address, are you referring to using the template to create the fixed address or something different? Templates are currently used to define the defaults when creating an object but they are not "linked" in a way that says an update to the template updates the object(s) created from it.
06-06-2018 11:21 AM
When I go to Data Management->IPAM->Choose a network (i.e. 10.0.2.0)-> Add->Fixed Address->IPv4, the first page allows you to "Add fixed address using Template" which I choose the one created which has the lease time overriden as "unlimited".. however if I choose to Add->Host->New Host, I can sett the MAC and check the DHCP box, but the opportunity isn't there to choose the template I want to override the inherited one from the network....
06-06-2018 11:58 AM
Yes, what you're doing when using a template is defining the Fixed Address as a "copy" of what is currently set in the template itself. The host object will inherit the DHCP settings from it's parent network container.
DHCP settings cannot be applied directly to a host object like they can be for fixed addresses (as you've seen). Instead, when you define the IP address on the host, you would edit the properties of the IP address object. That will take you to the linked fixed address network. There you can specify the appropriate settings.
One thing you can try as well is to define a host object (and maybe just sit it in some fake, disabled "template" network) and define your options there. Then when you create a host object, you create it as a copy of one of your template hosts. This should have the same effect as leveraging the DHCP template except that now you'll get other attributes included beyond just the DHCP properties.
06-06-2018 03:55 PM
Thanks. I'd like to do something like this via the WAPI. I see the "configure_for_dhcp" in record:host_ipv4addr and the "options" attribute can probably do what I need. If there is a way to only override the lease time and inherit everything else, I think that is what I need.