作者:小p揪脸包918 | 来源:互联网 | 2023-01-28 21:43
两步:第一步导出XML:[root@ok~]#virshdumpxmlcentos02>12c.xml第二步磁盘文件[root@okvirhost]#
两步:
第一步导出XML:
[root@ok ~]# virsh dumpxml centos02 >12c.xml
第二步磁盘文件
[root@ok virhost]# cp centos02.img 12c.img
看看两个文件的不同:
[root@ok ~]# diff /etc/libvirt/qemu/centos02.xml ~/12c.xml
1,10c1,3
<
<
<
<centos02
<e6852c4a-c0a8-cbcc-d556-768e93d4167c
---
>
> 12c
> e6852c4a-c0a8-cbcc-d556-768e93d4168c
31c24
<
---
>
32a26
>
38a33
>
41a37
>
44a41
>
48a46
>
52a51
>
56a56
>
60c60
<
---
>
61a62,63
>
>
64a67
>
65a69
>
67c71,72
<
---
>
>
68a74
>
71c77
<
---
>
75a82
>
78a86
>
81a90,93
>
> system_u:system_r:svirt_t:s0:c355,c689
> system_u:object_r:svirt_image_t:s0:c355,c689
>
82a95
>
[root@ok ~]# virsh define 12c.xml
Domain 12c defined from 12c.xml
root@ok ~]# virsh start 12c
Domain 12c started
[root@ok ~]# virsh list
Id Name State
----------------------------------------------------
1 win7 running
2 centos02 running
3 12c running
可以把/etc/sysconfig/network-script/ifcfg-eth0里面的MAC UUID都可以删除了
#pwd
#/etc/udev/rules.d
#rm -f 70-persistent-net.rules
然后重启
[root@ok virhost]# virsh list
Id Name State
----------------------------------------------------
1 win7 running
2 centos02 running
3 12c running