How to set reserved lease via omshell

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to set reserved lease via omshell

Frank Price
After the recent discussion of reserved leases, I decided to try this out in our environment and do a test with omshell.  To my chagrin, I've played with this all night and am no further along than I was.  I'm running isc-dhcpd-4.2.5, by the way.

Here's what I'm doing:

 - enter omshell; give a server and key and connect.
 - new lease
    - set ip-address = 10.199.67.214
    - open

At this point I get the object attributes, which include state = 00:00:00:02 (meaning it's an active lease).  I should be able to mark this as reserved, right?  But how do I actually do that?

The man page for dhcpd, under LEASES, says:
       Leases have the following attributes:

       state integer lookup, examine
            1 = free
            2 = active
            3 = expired
            4 = released
            5 = abandoned
            6 = reset
            7 = backup
            8 = reserved
            9 = bootp
 
This makes me think that reserved is an attribute of state, thus:
  - set state = 9 ; update
  - set state = 00:00:00:09 ; update

But I just get "can't update object: invalid argument" when I try to update.  

A desperate bit of googling led me to https://lists.isc.org/pipermail/dhcp-users/2008-June/006519.html, so I tried 
  - set flags = 04:00:00:00
but that just crashed dhcpd for me.

I'm clearly missing something and I'm sure it's obvious, but right now I'm at sea.  Anyone actually done this?

-Frank
--


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: How to set reserved lease via omshell

Simon Hobson
Frank Price <[hidden email]> wrote:

>             8 = reserved


>   - set state = 9 ; update

Is that a typo or a copy&paste error ?

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: How to set reserved lease via omshell

Frank Price

On Wed, Mar 2, 2016 at 2:55 AM, Simon Hobson <[hidden email]> wrote:
Frank Price <[hidden email]> wrote:

>             8 = reserved


>   - set state = 9 ; update

Is that a typo or a copy&paste error ?


I thought for a moment it was me being stupid and bleary eyed, but retrying with either
   set state = 8 
   set state = 00:00:00:08

results in an error

> update
can't update object: invalid argument
obj: lease
client-hostname = "Demo"
ip-address = 0x:cx:dx:fx
state = 00:00:00:08


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: How to set reserved lease via omshell

glenn.satchell
Hi Frank

There is the infinite-is-reserved setting, so if that is set to true then
in omshell set the lease expiry time to infinite and it will become
reserved. I'm not familiar enough with omshell to know how to do that.
Maybe a value of ff:ff:ff:ff ?

regards,
-glenn

On Thu, March 3, 2016 12:55 am, Frank Price wrote:

> On Wed, Mar 2, 2016 at 2:55 AM, Simon Hobson <[hidden email]>
> wrote:
>
>> Frank Price <[hidden email]> wrote:
>>
>> >             8 = reserved
>>
>>
>> >   - set state = 9 ; update
>>
>> Is that a typo or a copy&paste error ?
>>
>>
> I thought for a moment it was me being stupid and bleary eyed, but
> retrying
> with either
>    set state = 8
>    set state = 00:00:00:08
>
> results in an error
>
>> update
> can't update object: invalid argument
> obj: lease
> client-hostname = "Demo"
> ip-address = 0x:cx:dx:fx
> state = 00:00:00:08
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: How to set reserved lease via omshell

Shawn Routhier
We recently found and fixed some bugs in the infinite-is-reserved
and reserved functionality.  You should wait until the next release
(which will be out pretty soon) before trying to use them.

Part of the release note for this about reserved and OMAPI is:

  In addition, corrections
  were made to the server to allow a lease's flags field to be set via omapi.
  Prior to this, the server, depending on the host architecture,  would
  incorrectly parse the new flags value from the omapi message.
  [ISC-Bugs #31179]

regards,
Shawn

On Mar 2, 2016, at 8:34 AM, Glenn Satchell <[hidden email]> wrote:

Hi Frank

There is the infinite-is-reserved setting, so if that is set to true then
in omshell set the lease expiry time to infinite and it will become
reserved. I'm not familiar enough with omshell to know how to do that.
Maybe a value of ff:ff:ff:ff ?

regards,
-glenn

On Thu, March 3, 2016 12:55 am, Frank Price wrote:
On Wed, Mar 2, 2016 at 2:55 AM, Simon Hobson <[hidden email]>
wrote:

Frank Price <[hidden email]> wrote:

           8 = reserved


 - set state = 9 ; update

Is that a typo or a copy&paste error ?


I thought for a moment it was me being stupid and bleary eyed, but
retrying
with either
  set state = 8
  set state = 00:00:00:08

results in an error

update
can't update object: invalid argument
obj: lease
client-hostname = "Demo"
ip-address = 0x:cx:dx:fx
state = 00:00:00:08
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: How to set reserved lease via omshell

Frank Price
On Wed, Mar 2, 2016 at 12:06 PM, Shawn Routhier <[hidden email]> wrote:
We recently found and fixed some bugs in the infinite-is-reserved
and reserved functionality.  You should wait until the next release
(which will be out pretty soon) before trying to use them.

Part of the release note for this about reserved and OMAPI is:

  In addition, corrections
  were made to the server to allow a lease's flags field to be set via omapi.
  Prior to this, the server, depending on the host architecture,  would
  incorrectly parse the new flags value from the omapi message.
  [ISC-Bugs #31179]


That's good to know, thanks Shawn.  So then is flags the right attribute to set, and not state?
 


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users