Howto rename a xen vm “domain” using xl and xm

undefined

In this mini post I’ll show you how to rename a xen virtual machine “domain” using either xl or xm management tools. suppose for any reason you want to rename a xen vm from ABC to DEF, we have two options to rename a xen domain “VM”.

Option 1: Using the rename sub-command with either xl or xm management tools.

Xen provides a rename sub-command that we can use to rename a domain, according to your current version of xen you are using run one of the following commands after save shutdown of the vm “domain”:

# xl -vf rename  ABC DEF

OR

# xm rename ABC DEF

Now, your new domain is ready, start it using one of the following commands:

# xl create /etc/xen/DEF.cfg

OR

# xm create /etc/xen/DEF.cfg

What if the above commands not worked fine, in this case use option 2 “which worked fine with me”.

Option 2: Renaming the domain “VM” config file.

First thing do to is save power off for your domain “vm”. Now move to the /etc/xen directory and rename the domain config file, run the following commands:

# cd /etc/xen
# mv ABC.cfg DEF.cfg

Then you need replace the existing old domain name in DEF.cfg config file with the new domain name DEF, run the following commands:

# vim /etc/xen/DEF.cfg

Then  only replace  name = ‘ABC’ with name = ‘DEF’ , save and exit.

Now, your new domain is ready, start it using one of the following commands:

# xl create /etc/xen/DEF.cfg

OR

# xm create /etc/xen/DEF.cfg

At this point, you can safely rename a xen domain using any of our two options.

Hint:
 1. In option 2, we only renamed the domain name in the config file, we did not do any extra changes, so the new domain name will use the old domain name devices, and settings. It'll use the old disk devices and networking.

If You Appreciate What We Do Here On Mimastech, You Should Consider:

  1. Stay Connected to: Facebook | Twitter | Google+
  2. Support us via PayPal Donation
  3. Subscribe to our email newsletters.
  4. Tell other sysadmins / friends about Us - Share and Like our posts and services

We are thankful for your never ending support.

2 Comments to Howto rename a xen vm “domain” using xl and xm

  1. It is truly a great and useful piece of info. I’m happy that you shared
    this useful info with us. Please stay us up to date like this.

    Thanks for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *