kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.08k stars 366 forks source link

Automate guests deployment with cloud-init and kickstart files #1206

Open eBeagle opened 6 years ago

eBeagle commented 6 years ago

Currently the deployment of guests based on templates is quite manual. You specify the template based on the ISO you'd like to use and then need to manually install the OS in each guest.

I'd like to suggest a new feature where the user could automate the deployment of new guests using:

  1. kickstart files to specify the config when using ISO files to boot the guests
  2. cloud-init files to inject the config when using QCOW2 images currently made available by popular distros (please see #1110 for discussion of using QCOW2 images as template)

Those files could be specified as part of the templates.

Since Kimchi has been supported by oVirt maybe their implementation could be used as a reference to guide Kimchi's implementation (oVirt: Cloud-Init Integration)

doanerock commented 6 years ago

I second this statement. I used to just use a command line script which I included below to create the server and then run the kickstart file. The nice thing was when I ran the script and passed one variable to the script on the command line it also passed that one variable to the kickstart file and used it has the host name. All I had to do was log into the vm in a few minutes once it was done running the kickstart install, no further intervention necessary.

./create_vm server-name wait a few minutes ssh server-name

virt-install -n $1 -r 1024 --vcpus=1 --os-variant=rhel6 --accelerate -v --disk path=/home/vmstorage/$1.img,size=20 -l /home/vmstorage/CentOS-7-x86_64-Minimal-1708.iso --graphics vnc --initrd-inject=/home/bab/kickstart.cfg -x "ks=file:/kickstart.cfg SERVERNAME=$1"

I feel that something similar to this should be a template option, eg variables and kickstart files.

cloud init appear to be the cool new kid on the block so that could possible also work.

The big benefit to kimchi is that I can easily get a console. The old system worked great as long as I did not need a console because the only options was X11 over ssh forwarding with virt-manager.