How do I disable the metadata lookup at cirros boot?

I was able to answer my own question after a few days of research. You must pass "ds=nocloud" as a kernel option to the VM.

Here's how I did it.


#!/bin/sh

export VM_NAME=cirros$$
IMAGES_BASE=/var/lib/libvirt/images
cp $IMAGES_BASE/cirros/cirros-0.3.0-i386-blank.img $IMAGES_BASE/$VM_NAME.img

virt-install -r 256 \
  -n $VM_NAME \
  --vcpus=1 \
  --import \
  --autostart \
  --memballoon virtio \
  --network bridge=virbr0 \
  --boot kernel=$IMAGES_BASE/cirros/cirros-0.3.0-i386-vmlinuz,initrd=$IMAGES_BASE/cirros/cirros-0.3.0-i386-initrd,kernel_args="console=/dev/ttyS0 ds=nocloud" \
  --disk $IMAGES_BASE/$VM_NAME.img \
  --noautoconsole

The kernel, initrd, and blank image are contained in the UEC versions of cirros on the download page.

UPDATE - Another method is to edit /etc/cirros-init/config. Change the DATASOURCE_LIST variable. This method requires updating the VM image so I prefer using the kernel args method. The file /etc/cirros-init/config exists in cirros-0.3.3 but not cirros-0.3.0. I didn't check other versions.


One option will be to start the VM -> Set DATASOURCE_LIST="nocloud" in /etc/cirros-init/config -> Stop the VM and use the new image file as a reference for future VMs to be deployed.