Open twtlpla opened 3 months ago
According to the comments it seems to be because there's no way to which directories are managed by libvirt, so I think we do it to be sure we're using the correct config file.
there's no way to which directories are managed by libvirt
How does ’virsh undefine‘ solve this problem? After the experiment, as long as the $OCF_RESKEY_config is configured, the domain can be started successfully regardless of whether it is in the /etc/libvirt/qemu directory.
It undefines existing configs with the name, so it will create a new one from the config file you specify (e.g. put on shared storage).
It undefines existing configs with the name, so it will create a new one from the config file you specify (e.g. put on shared storage).
Do you mean that when the configuration file of an existing domain is different from the configuration file we specified, delete the original file first, and then use the configuration file we specified to complete the startup of the domain?
Correct.
In the VirtualDomain_start function, declare to ensure that domain is undefined until creating it. What is the reason for this?
If virtualdomain is stopped, the 'virsh list --all' command cannot query the corresponding domain, and the virtual machine is considered to be deleted. Because of this, is it possible to remove the 'virsh undefine' from the virtualdomain_start function?