New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
edit domain.xml before VM launch #791
Comments
If I were interested in hacking this in, where would be a good place to put it? |
Have a look at vagrant-libvirt/lib/vagrant-libvirt/action/create_domain.rb Lines 297 to 300 in 6929c7a
to_xml('domain') call returns the XML document as a string defining the domain.
You could wrap that with a callback to a function that calls a custom command defined by you the user to transform it and return back a suitable string. |
This has come up again recently around also packaging boxes with a domain XML definition so that custom devices maybe specified as part of the VM box instead of being needed to be implemented in every case. Essentially I think the solution would need to involve providing a callback for a function defined in the Vagrantfile that can operate on the XML tree elements during the create or start domain phases, with some validation performed and then controlled passed back to create/start the domain. |
It would be useful to have a hook in the Vagrantfile for doing arbitrary edits to the resulting domain.xml file before VM launch for those situations where there is no support for a libvirt feature in vagrant-libvirt, such as virtio-scsi support.
The text was updated successfully, but these errors were encountered: