<div dir="ltr"><div dir="ltr"><div><span style="font-family:arial,sans-serif">Specify the MAC address as part of the domain XML for the bootstrap node.  See <a href="https://libvirt.org/formatdomain.html#elementsNICS">https://libvirt.org/formatdomain.html#elementsNICS</a>.</span></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">If using virt-install, set it as part of the --network option: "<tt>--network NETWORK,mac=12:34..."</tt></span></div><div><span style="font-family:arial,sans-serif"><tt><br></tt></span></div><span style="font-family:arial,sans-serif"><tt><span style="font-family:arial,sans-serif">- Peter</span><br></tt></span>

</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 12 Jun 2020 at 18:07, Ian Pilcher <<a href="mailto:arequipeno@gmail.com">arequipeno@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Is it possible to configure libvirt to generate "predictable" MAC<br>
addresses for virtual NICS?  (A configuration which accomplishes this<br>
by limiting the pool of available addresses would be acceptable for<br>
my use case.)<br>
<br>
Read on for why I want to do this ...<br>
<br>
I have a somewhat unusual use case.  I am working with the OpenShift<br>
bare metal "IPI" installation process, which is documented here:<br>
<br>
  <a href="https://openshift-kni.github.io/baremetal-deploy/4.4/Deployment.html" rel="noreferrer" target="_blank">https://openshift-kni.github.io/baremetal-deploy/4.4/Deployment.html</a><br>
<br>
At a high level, the installation process goes like this:<br>
<br>
1. Install RHEL 8 on the "provisioner" node.<br>
<br>
2. Configure a couple of bridges on the provisioner node, which will be<br>
    used by the "bootstrap VM" (see below).<br>
<br>
3. Create a configuration file & do various other things.<br>
<br>
4. Run the installer<br>
<br>
    a. Installer creates a "bootstrap VM" on the provisioning node, which<br>
       does the actual work of kicking off the OpenShift installation.<br>
       The bootstrap VM runs Red Hat Enterprise Linux CoreOS (RHCOS).<br>
<br>
    b. Bootstrap VM requests an IP address via DHCP.   <====== ******<br>
<br>
Step 4b is problematic in this environment.  Because of routing and<br>
firewall rules, I really need the bootstrap VM to have a predictable IP<br>
address.<br>
<br>
It is possible to configure a static IP address on the bootstrap VM via<br>
the CoreOS ignition file, and we've successfully done this, but ...<br>
<br>
RHCOS requests an IP address via DHCP *before* it processes the ignition<br>
file.  If this fails, it appears to simply give up.  So we need to have<br>
our DHCP server provide an address to the bootstrap VM, even if it isn't<br>
ever used.  And of course, we're not allowed to configure the DHCP<br>
server to respond to any old MAC address that comes along; we're only<br>
allowed to respond to known MAC addresses.<br>
<br>
Hopefully this all makes sense, and hopefully it explains why being<br>
able to configure libvirt's MAC pool/sequence would allow things to work<br>
in this environment.<br>
<br>
Thanks!<br>
<br>
-- <br>
========================================================================<br>
                  In Soviet Russia, Google searches you!<br>
========================================================================<br>
<br>
</blockquote></div></div>