Libvirt Version: 0.9.8 Hi, I want to know if there is a way to rename a VM domain. The best way is API. I know a way to do this: virsh dumpxml myvm > foo.xml <edit foo.xml, change the name> virsh undefine myvm virsh define foo.xml but I don't want implement in this way. can you give me some ideas for it, like "clone, migrate actions etc." thanks.
Your way is the current workaround. This is a very old feature request that no one has bothered to code up. *** This bug has been marked as a duplicate of bug 558160 ***
Is there a old libvirt version including it? I want this function to develop.
(In reply to comment #2) > Is there a old libvirt version including it? I want this function to develop. Bug 558160 is still open as a reminder that there is no version of libvirt that yet provides this feature. If you'd like to help develop this funciton, patches are welcome, in the context of that older bug. *** This bug has been marked as a duplicate of bug 558160 ***
I am trying to use libvirt API implement. The same like virsh tools. virsh dumpxml myvm > foo.xml I used virDomainGetXMLDesc API to get xml description of domain, then convert to virDomainDef, and I changed def->name, the last I convert def back to xml. virsh undefine myvm I used virDomainUndefine. virsh define foo.xml I used virDomainDefineXML. These APIs all called successed. the domain name show on virt-manager was not changed yet,but the name show on open window was changed and details changed too. the vir-manager must reconnect, then the name is correct. use virsh tools is ok. Did I forget something?
(In reply to comment #4) > I am trying to use libvirt API implement. The same like virsh tools. > Please - rather than re-opening this bug, how about we move the conversation to the open bug 558160. There is no point sticking the information in the duplicate bug, when it is the original bug that should be tracking this. *** This bug has been marked as a duplicate of bug 558160 ***