Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure ipxe on libvirt/QEMU with SMBIOS OEM strings #965

Open
joernheissler opened this issue Jun 4, 2023 · 3 comments
Open

Configure ipxe on libvirt/QEMU with SMBIOS OEM strings #965

joernheissler opened this issue Jun 4, 2023 · 3 comments

Comments

@joernheissler
Copy link

Hello,

ipxe provides "VMware GuestInfo" support, allowing to set arbitrary ipxe settings directly from VMware.

However, I use QEMU + libvirt, not VMware. I'd like to propose a new feature that achieves the same on QEMU, using SMBIOS OEM strings.

Example domain config for libvirt:

<domain type='kvm'>
  ...
  <os>
    ..
    <smbios mode='sysinfo'/>
  </os>
  <sysinfo type='smbios'>
    <oemStrings>
      <entry>ipxe.ip=192.168.1.8</entry>
      <entry>ipxe.scriptlet=ifopen net0 &amp;&amp; chain ${filename}</entry>
    </oemStrings>
  </sysinfo>
</domain>

libvirt turns this into a call to:
/usr/bin/qemu-system-x86_64 ... -smbios type=11,value=ipxe.ip=192.168.1.8,value=ipxe.scriptlet=ifopen net0 &amp;&amp; chain ${filename}

dmidecode in the virtual machine reports:

Handle 0x0E00, DMI type 11, 5 bytes
OEM Strings
    String 1: ipxe.ip=192.168.1.8
    String 2: ipxe.scriptlet=ifopen net0 && chain ${filename}

I attached a working (but probably very bad) patch for ipxe that loads those settings.

Would this feature be interesting for ipxe? If so, could someone who knows their way around the ipxe source code implement it properly?

ipxe-smbios-oem-strings.patch.txt

@NiKiZe
Copy link
Contributor

NiKiZe commented Jun 4, 2023

This might very well be implemented as an ipxe script using the existing smbios settings. With the challenge to cut strings properly.

Otherwise fantastic, especially the libvirt and qemu smbios examples.

@joernheissler
Copy link
Author

This might very well be implemented as an ipxe script using the existing smbios settings.

Got an example how I can see one (or all) of my variables in an inmodified ipxe?

@mcb30
Copy link
Member

mcb30 commented Jun 9, 2023

<domain type='kvm'>
  ...
  <os>
    ..
    <smbios mode='sysinfo'/>
  </os>
  <sysinfo type='smbios'>
    <oemStrings>
      <entry>ipxe.ip=192.168.1.8</entry>
      <entry>ipxe.scriptlet=ifopen net0 &amp;&amp; chain ${filename}</entry>
    </oemStrings>
  </sysinfo>
</domain>

Would this feature be interesting for ipxe? If so, could someone who knows their way around the ipxe source code implement it properly?

This would definitely be interesting. The implementation would end up sharing a lot of code with https://github.com/ipxe/ipxe/blob/master/src/arch/x86/interface/vmware/guestinfo.c, to the extent that most of guestinfo.c should be abstracted out to provide a framework for an external mechanism that allows for global and per-netdevice settings to be retrieved externally from a text-based key-value store, where the key comprises ipxe[.<network device>].<setting name>[.<setting type>].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants