[libvirt] [PATCH] virsh: Implement command to rename domain

Philipp Hahn hahn at univention.de
Mon Sep 1 08:31:24 UTC 2014


Hello Tomas,

On 01.09.2014 01:51, Tomas Meszaros wrote:
> I've recently worked with rather large number of virtual machines
> and needed to rename all domains. I couldn't find better way how
> to rename domain other than:
> 
>     virsh dumpxml domain > domain.xml
>     (change domain name in domain.xml)
>     virsh undefine domain
>     virsh define domain.xml
> 
> This is rather pain to do every time I want to rename domain.
> I think there should be simple way to change domain name.

This has been requested in the past already (even by me ;-)
Renaming is not that simple, as there are several more things to do:
1. Rename log files (this was somehow controversial last time it was
discussed, especially combined with external programs like logrotate)
2. Fix domain config for suspended VMs.
3. Keep existing snapshots
3.1 Fix domain config in snapshots.

Especially the last thing does very bad things if you revert a renamed
VM, as the UUID is then no longer unique.

Philipp "sorry, no patch" Hahn




More information about the libvir-list mailing list