I like to Rename KVM Virtul Machine for same reasons. In Linux, we have KVM Virtualisation tools that support our most of virtualisation requirements.In this post we would see How to rename KVM Virtual Machine.

It just one command process and KVM Guest Machine need to shutdown before start this procedure.

let's take an example, we have Guest machine name srv7-clone-manual that created during clone process. Let's rename it to srv7-clone, that look more meaningful to me.

Syntax

virsh domrename <Existing/old Guest Name> <New Guest Machine Name>

Example

Let's start work on terminal and see what are scenario on ground.

We have below Machines, Need to work on srv7-clone-manual
#virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     office_image                   shut off
 -     srv6                           shut off
 -     srv7                           shut off
 -     srv7-clone-manual              shut off
 -     srv7.1                         shut off
 -     ubuntu-17.04                   shut off

Let's rename srv7-clone-manual to srv7-clone

#virsh domrename srv7-clone-manual srv7-clone
Domain successfully renamed

After rename view

virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     office_image                   shut off
 -     srv6                           shut off
 -     srv7                           shut off
 -     srv7-clone                     Shut off
 -     srv7.1                         shut off
 -     ubuntu-17.04                   shut off

Hence, with Just one command we could able to rename KVM Guest Machine Name.