Obvious questions about cloud-init

Posted by lightnb11@reddit | linuxadmin | View on Reddit | 10 comments

There are pages and pages of documentation that fail to answer the most obvious questions that someone who has never used cloud-init before would have about it:

The docs say:

During boot, cloud-init identifies the cloud it is running on and initialises the system accordingly.

(1) What is booting, the new VM?

(2) Where does cloud-init run? Inside the newly created VM? On the host? On a "cloud-init server" in the data center?

(3) Is cloud-init an executable? That runs inside the vm?

(4) How does it "identif[y] the cloud it is running on"? DNS?

(5) "initialises the system accordingly"... according to what? Where does your configuration file go? On the host? Inside the vm?

(6) How does cloud-init get installed inside the vm?

(7) Does cloud-init require something external to the vm, like a "cloud-init server" that's in the data center?

OK. So let's say I have a bare metal machine with KVM/Libvirt on it. I use virt-install to make new virtual machines. How do I make cloud-init put my ssh public key on new virtual machines?