0

I have a baremetal server with Xen, and Debian 9 as DOM0.

This server has libvirt, and I can happily create PV domains by using xl, virsh or remotely using virt-manager.

I want to streamline coreos VM creation, by passing them at creation time an ignition JSON so they get the proper name, network config and basic services.

So far, I managed to get SSH keys into the new coreos instances by using a config-2 partition, but that uses coreos-cloudinit which is kind of deprecated, and the network does not get configured. I have to get into the VM and create /etc/systemd/network/00-eth* files and reboot.

Could not find a proper way have the configuration for the VM be on the DOM0 at creation. Any pointers?

Pablo
  • 440
  • 2
  • 9

1 Answers1

1

I got it working by using the following settings in a libvirt-xml-config file virsh, libvirt 3.0.0-4~bpo8+1, CoreOS Stable 1409.7.0, Debian 8.8 and XEN 4.4.1.

<bootloader>/usr/lib/xen-4.4/bin/pygrub</bootloader>
<os>
  <type arch='x86_64' machine='xenpv'>linux</type>
  <kernel>/coreos/vmlinuz-a</kernel>
  <cmdline>coreos.config.url=http://<YOUR_IP>/coreos01.json coreos.first_boot=1 console=hvc0 root=LABEL=ROOT usr=PARTLABEL=USR-A</cmdline>
</os>

Then create the vm with:

virsh define "config.xml"
virsh start "vm-name"
ahla
  • 26
  • 1
  • 1
  • 2