kimchi-project / kimchi

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

VM/Template Hooks #92

Open aglitke opened 11 years ago

aglitke commented 11 years ago

Today kimchi creates vm definitions automatically based on a small number of customizable parameters. This provides an easy to use solution that gets things right most of the time. Advanced users may want to customize the libvirt domain xml of their VMs to enable a feature not yet supported by kimchi or for some other reason.

VM/Template hooks are python scripts that would be installed by the host administrator into a special hooks directory. They could be enabled by a special section in the VM/Template json. A Template hook for create would be run after the xml is created but before it is sent to libvirt. A hook script would receive the json object and a copy of the generated xml. The script must return the desired xml back to kimchi. This allows the hook script to add/modify devices and perform other customizations to the config before it is created.

bingbu commented 11 years ago

May I take this?

sming56 commented 11 years ago

"A hook script would receive the json object and a copy of the generated xml". I think the json object are the additional parameters from the VM create interfaces. Right? Bingbu post a patch to modify the XML file before not merged yet, I think we can leverage the patch now.

aglitke commented 11 years ago

Go ahead Bing Bu.