Go Back   ISPsystem.com Forums > VMmanager > General discussion

Notices

Reply
 
Thread Tools
Old 04-05-2017, 05:37 PM   #1
Member
 
Join Date: Sep 2016
Posts: 34
Alsaleem is on a distinguished road
Default How to rename a VM

Is there any change to rename a virtual machine in VM manager?

I need to import virtual machines with the same names. The operation just hangs and cannot be completed
Alsaleem is offline   Reply With Quote
Old 04-12-2017, 05:24 AM   #2
ISPsystem team
 
Join Date: Jun 2013
Posts: 233
fly is on a distinguished road
Default

Hello,

There are steps to renew virtual machine

1. Shut down vm.

2. Rename virtual machine's xml file:
mv /etc/libvirt/qemu/old.1118.vm.xml /etc/libvirt/qemu/new.1118.vm.xml

Change vm's name in the file new.1118.vm.xml
Delete filterref section from the file.

3. Rename vm's volume:
mv /kvm/old.1118.vm /kvm/new.1118.vm

4. Redefine vm:

virsh undefine old.1118.vm

virsh define /etc/libvirt/qemu/new.1118.vm.xml

5. Change name in the VMmanager's data base:

update vm set name='new.1118.vm', name_idn='new.1118.vm' where id=<vm id in VMmanager>;
update volume set name='new.1118.vm' where id=<volume id in VMmanager>;

6. Restart VMmanager
killall core

7. Go to VMmanager -> virtual machine, click to edit button and select checkbox "Disable anti-spoofing", click to OK. Then open form again and unselect checkbox "Disable anti-spoofing". It is necessary to make anti-spoofing rules be recreated with new vm name.

8. Power up vm
fly is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:51 AM.