I've used ubuntu-cloud template as LXC containers, and they all worked fine. Recently I switched to use libvirt-lxc
, and followed instructions in Ubuntu document, but the image initialized differently from LXC:
Tried to connect to AWS's meta-data server and got errors:
2013-02-05 00:55:48,209 - util.py[WARNING]: 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [50/120s]: url error [timed out]
Default password didn't work. I need to enable password by modifying the rootfs'
/etc/shadow
because the default password of "ubuntu" account had been banned.
I think LXC pre-handle the cloud-init
issues and feed it some user-data and meta-data. I tried to find how to do this manually, but the cloud-init
document page didn't help, because it's examples are all for euca-tools
.
And I also noticed that lxc-start
has an option -C
:"The -C option will create a cloud container, configured for use with a metadata service." But I just didn't know how to map this option and it's all related settings to libvirt_lxc
.
How can I init the image/rootfs correctly ?