admin 发表于 2021-11-1 11:27:34

virsh define 虚机报错:error: Failed to define domain from centos7.9.xml error: XML e

# virsh define centos7.9.xml
error: Failed to define domain from centos7.9.xml
error: (domain_definition):140: AttValue: " or ' expected
       <mac address=/>
--------------------^
# virsh define centos7.9.xml
error: Failed to define domain from centos7.9.xml
error: XML error: unable to parse mac address ' '
删除报错行
(nova-libvirt)# vi centos7.9.xml

    <interface type='bridge'>
    <mac address=''/>    ### 删除这行:
       <source bridge='brq039d8d36-65'/>
(nova-libvirt)# virsh define centos7.9.xml
error: Failed to define domain from centos7.9.xml
error: XML error: unable to parse mac address ''

(nova-libvirt)# vi centos7.9.xml
(nova-libvirt)# virsh define centos7.9.xml
Domain centos7.9 defined from centos7.9.xml
(nova-libvirt)# virsh list
Id    Name                           State
----------------------------------------------------
3   instance-00000059            running
(nova-libvirt)# virsh list--all
Id    Name                           State
----------------------------------------------------
3   instance-00000059            running
-   centos7.9                      shut off

问题解决。

admin 发表于 2021-11-1 11:28:01

http://www.bbs168x.cn/forum.php?mod=viewthread&tid=1362&highlight=xml   创建步骤可以参考此出。
页: [1]
查看完整版本: virsh define 虚机报错:error: Failed to define domain from centos7.9.xml error: XML e