<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi John<br>
    <br>
    Thanks. Packer is a tool to automatically bring up and configure a
    virtual machine for the first time. It is like installing, for
    example an ubuntu, machine from an iso image: The installer runs and
    after completion the new machine makes a reboot and you can continue
    to configure the new machine. So, I do not know the MAC address in
    advance to make a reservation. <br>
    <br>
    The challenge I think I face is to make sure that the IP address
    after the reboot is the same like during first power up when the os
    installer is running.<br>
    I think I have to create a configuration where kea issues the same
    IP for the above scenario. I tried this to make sure that the MAC
    address and the hostname are the same. I also configured networking
    of the new machine to send 'dhcp-identifier: mac'. But that is
    obviously not enough. <br>
    <br>
    Thanks to your answer I see the following things I can try. But may
    be you have even a better, simpler idea.<br>
    - Create a MAC address by hand and make a reservation<br>
    - Try to play around with the lease time for the first DHCP request.<br>
    - Use static IP but in this case I don't want to do that if I can
    avoid it.<br>
    - Configure kea to use only "host-reservation-identifiers":
    ["hw-address"] but not sure if this would help.<br>
    <br>
    Best Roland<br>
    <br>
    <pre class="moz-quote-pre" wrap="">192.168.178.<b>251</b>,00:50:56:92:07:82,01:00:50:56:92:07:82,0   ,1609062019,1,1,1,ubuntu-server,0,
192.168.178.<b>252</b>,00:50:56:92:07:82,01:00:50:56:92:07:82,4000,1609066573,1,1,1,ubuntu-server,0,
</pre>
    <br>
    <br>
    <div class="moz-signature">
      <div style="font-family: Verdana, sans-serif;font-size:
        11px;color: #333; padding: 0px; margin: 0px"><a style="border:
          0" href="http://www.exasoft.ch"><img moz-do-not-send="false"
            style="border: 0px"
            src="file:///home/rb/.thunderbird/logo.jpg"
            alt="www.exasoft.ch"></a>
      </div>
    </div>
    <div class="moz-cite-prefix">On 12/27/20 12:06 PM, Gibbins, John
      (IM&T, Black Mountain) wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:SYCPR01MB35023AC7A9A787EA3DA6D06BF3DA0@SYCPR01MB3502.ausprd01.prod.outlook.com">
      <pre class="moz-quote-pre" wrap="">Hi Roland,

If the client does not request the same IP as it had before you probably need to assign a fixed IP to the device.

I'm assuming you have a config which includes your subnet.  Something like:
...
    "subnet4": [
      {
        "subnet": "192.168.178.0/24",
        ...
      }
    ]
...

To ensure that you always get the same IP you need to create a reservation which maps the MAC to the desired IP.  Such as:
...
    "subnet4": [
      {
        "subnet": "192.168.178.0/24",
        ...
        "reservations": [
          {
            "hw-address": "00:50:56:92:07:82",
            "ip-address": "192.168.178.251"
          }
        ]
      }
    ]
...

You may want to check out the "reservation-mode" attribute if you have both pools and reservations on the same subnet.

Regards
johng
-----Original Message-----
From: Kea-users <a class="moz-txt-link-rfc2396E" href="mailto:kea-users-bounces@lists.isc.org"><kea-users-bounces@lists.isc.org></a> On Behalf Of rondal
Sent: Sunday, 27 December 2020 9:23 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:kea-users@lists.isc.org">kea-users@lists.isc.org</a>
Subject: [Kea-users] Lease same IP for same MAC

Hi, I try to deploy an ubuntu server to vsphere with packer. After
installation has finished the machine reboots an gets an other IP address.
Packer can not complete its work because it is still trying to connect to
the old ip address.

>From the kea log I see the following:

192.168.178.*251*,00:50:56:92:07:82,01:00:50:56:92:07:82,0  
,1609062019,1,1,1,ubuntu-server,0,
192.168.178.*252*,00:50:56:92:07:82,01:00:50:56:92:07:82,4000,1609066573,1,1,1,ubuntu-server,0,

In the client I configure networking (netplan) with dhcp-identifier: mac

- Any ideas how I can tell kea to lease the same ip, in this case *.251,
again?


Best Roland



--
Sent from: <a class="moz-txt-link-freetext" href="http://kea-users.7364.n8.nabble.com/">http://kea-users.7364.n8.nabble.com/</a>
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at <a class="moz-txt-link-freetext" href="https://www.isc.org/contact/">https://www.isc.org/contact/</a> for more information.

To unsubscribe visit <a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</a>.

Kea-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kea-users@lists.isc.org">Kea-users@lists.isc.org</a>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>