Howto rename a xen vm “domain” using xl and xm
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:
- Stay Connected to: Facebook | Twitter | Google+
- Support us via PayPal Donation
- Subscribe to our email newsletters.
- Tell other sysadmins / friends about Us - Share and Like our posts and services
We are thankful for your never ending support.
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.
Thanks for your positive comment, but may I ask which option worked with you?
Actually, this will help me update this post.
Regards