I am booting cirros VMs outside of an Openstack environment using libvirt. At boot, the VM checks for metadata twenty times, which adds a lot of latency to the boot time.
cirros-ds 'net' up at 6.14
checking http://169.254.169.254/2009-04-04/instance-id failed 1/20: up 6.18. request failed failed 2/20: up 18.32. request failed failed 3/20: up 30.38. request failed failed 4/20: up 42.44. request failed [snip]
I'm using cirros-0.3.3.
Can I use cloud-init or some other mechanism to disable the metadata lookup?
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.
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.
You might interested in : https://github.com/eprasad/virt-cirros . Virtualization platform friendly cirros image