Open mariusrugan opened 5 years ago
You generated an image with your custom cloud-init configuration. Can you use the default image and instead run kvm-install-vm
with -s
(Custom shell script) to set the static IP? Creating a new ISO for each static IP seems time consuming.
Not really that time consuming @eayin2.
resizing my qcow2 images from 8 (default) to 32GB takes more time than generating this iso via genisoimage.
cloud-init uses user-data, network-config & metadata files which are needed in a readable format at boot time, in the vm. that's why the ISO. cloud-init is a widely adopted standard for configuring the virtual machines (from aws to my home-lab) and this is how it works.
from kvm perspective you're attaching a "virtual" drive from which it boots and there is no such abstraction of running a script when you start the vm.
alternatively you can edit the qcow2 images as explained here https://medium.com/@farazfazli/libguestfs-cloud-init-kvm-provisioning-made-easy-17931d9ea8cf
[ Edit ] i understand your remark now better because i've looked at the -s option.
https://github.com/giovtorres/kvm-install-vm/blob/master/kvm-install-vm#L454
and if you're referring to the runcmd part of cloud-init. let's say that is ran amongst the last things cloud-init runs. The vm's networking setup, you need it it way more earlier than runcmd.
but still, this script is still packaged in the iso, look into the deep-link above.
Yep I just saw it :-)
Hi,
First of all, thanks for your work, really nice assembled, (however i'm trying master on a debian host, as a non root user, with all permissions given to libvirt, some vars fail to get assigned properly; i'll open a separate issue for that). So in the light of the above, i had to cut down to a working solution and also solve static networking.
Wrt networking:
i'm using centos-atomic which at this moment has cloud-init version 18.2 https://cloudinit.readthedocs.io/en/18.2/
I'm adding to the ISO cloud-init image the following yaml file named
network-config
which gets picked up. Be aware that in cloud-init NoCloud this should NOT be under YAML nodenetworking:
just the: version:1 config: .... works perfectly fine. Again this is Cloud-Init dependent and works fine in my ATM latest centos atomic.