[libvirt] Redefining the XML of VM
jtomko at redhat.com
Wed Jan 8 13:36:22 UTC 2014
On 01/08/2014 01:56 PM, kangta123 wrote:
> I'm a newbie to Libvirt, i want to know if i can change the vm definition xml dynamically. like change cpu, network value.
You can't do that with hooks. You'll need to edit the domain definition before
you ask libvirt to start it.
> I found the hook in Libvirt, and i can get the xml from standard input. but i change it and out put to standard output, it no effect.
Libvirt only reads the standard output of the migrate hook script.
> I was try to execute “virsh define” shell command in python script on hook, but it was blocked and unabled to execute another Libvirt command.
You shouldn't call libvirt functions from your hook script, see
http://libvirt.org/hooks.html#recursive or .
> Is there create vm hook in Libvirt?
No (and it wouldn't let you change the definition anyway).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: OpenPGP digital signature
More information about the libvir-list