The syntax to rename a KVM VM with virsh is:

# virsh domrename {domain} {new-name}

1. To rename VM from Production-A to Production-B, first shutdown the VM Production-A:

# virsh shutdown Production-A

2. Now rename the VM, using below command:

# virsh domrename Production-A Production-B
Domain successfully renamed

3. Start the VM/domain, once the rename is completed successfully:

# virsh start Production-B

Rename KVM domain with virsh and XML

1. First get domain information in XML and save it to a new file:

# virsh dumpxml Production-A > Production-B.xml

2. Edit the XML file and change the name between the <name></name>

3. Update it as follows from Production-A to Production-B:


4. Shutdown the Production-A domain/vm:

# virsh shutdown Production-A

5. You need to undefine the old VM name:

# virsh undefine Production-A

6. Finally, import the edited XML file to define the VM Production-B:

# virsh define Production-B.xml

7. Start the domain Production-B, enter:

# virsh start Production-B