kvm主机重命名

一、查看虚拟机运行状态以及配置文件centos

[root@KVM-01 ~]# cd /etc/libvirt/qemu
[root@KVM-01 qemu]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 10    centos65                       running
 11    centos65_clone                 running
[root@KVM-01 qemu]# ls
autostart  centos65_clone.xml  centos65.xml  networks


二、修改配置文件信息:bash

[root@KVM-01 qemu]# cp centos65_clone.xml centos65_clone.xml.bk
[root@KVM-01 qemu]# virsh dumpxml centos65_clone>a2.xml
[root@KVM-01 qemu]# vi a2.xml
[root@KVM-01 qemu]# virsh undefine centos65_clone
Domain centos65_clone has been undefined


三、加载配置文件,并启动虚拟机ide

[root@KVM-01 qemu]# virsh define a2.xml
Domain a2 defined from a2.xml
[root@KVM-01 qemu]# virsh start a2
Domain a2 started

四、观察虚拟机状态spa

[root@KVM-01 qemu]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 10    centos65                       running
 12    a2                             running
相关文章
相关标签/搜索