找回密码
 注册
查看: 1654|回复: 1

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-11-1 11:27:34 | 显示全部楼层 |阅读模式
# virsh define centos7.9.xml
( n) \8 t$ C& G" u( Qerror: Failed to define domain from centos7.9.xml
4 @2 u8 n1 h2 h8 \/ m5 V! w2 }+ eerror: (domain_definition):140: AttValue: " or ' expected
+ s$ Z  c# w/ \) I7 h' y# K       <mac address=/>* g! o8 b' S; q+ W! x
--------------------^
: X% e3 k) y* o  x# virsh define centos7.9.xml
  Z( P% Y% [' @& C, Kerror: Failed to define domain from centos7.9.xml, ~+ Z; O6 s2 c0 C/ p
error: XML error: unable to parse mac address ' '3 H# y4 E9 F6 I. R
删除报错行1 t# |6 [) |% q4 V$ ]0 l' a: d# c
(nova-libvirt)[root@compute01 images]# vi centos7.9.xml
* s7 T, {- k; @* I5 e+ W$ k9 E0 }- l
    <interface type='bridge'>! Y5 C  j' A: h+ `" k7 Y0 r
    <mac address=''/>    ### 删除这行:
6 L! \$ {1 J3 x1 e1 Y1 s/ g       <source bridge='brq039d8d36-65'/>
" K9 ^$ p9 _( c# F1 K(nova-libvirt)[root@compute01 images]# virsh define centos7.9.xml ; _6 M2 ]/ A/ F3 R. i3 T( g
error: Failed to define domain from centos7.9.xml
! u7 n$ Y' E& D* |error: XML error: unable to parse mac address ''
' b! t; U: l- U+ n0 S2 G' Z) S3 E, z; U+ C/ i
(nova-libvirt)[root@compute01 images]# vi centos7.9.xml % b7 l9 R& q5 y# o/ L- g/ z3 I
(nova-libvirt)[root@compute01 images]# virsh define centos7.9.xml 6 L# A% B. z" m: R4 V! a
Domain centos7.9 defined from centos7.9.xml
6 u  G4 D/ P: z1 ]8 U1 e0 _2 U(nova-libvirt)[root@compute01 images]# virsh list
5 @) n" Q# k, F5 g! X4 M Id    Name                           State
! D# ?2 S( {/ T2 C5 @----------------------------------------------------& Q( j; ?5 b8 p6 [2 ~
3     instance-00000059              running4 D* b" X4 [; n& H8 T" W
(nova-libvirt)[root@compute01 images]# virsh list  --all7 N- s7 Y, W1 i+ s8 n* U% V
Id    Name                           State
, v. m9 U, H" I9 j8 ?3 ]----------------------------------------------------
2 @; v- L4 g* l# P' f 3     instance-00000059              running
* u: [( t- V1 R -     centos7.9                      shut off
  B+ g$ |/ F, W$ l5 M* ?$ _0 M3 L
% r- t3 B/ t' x* a: ~问题解决。+ W% P$ y4 K6 f' {' H

# C! Z, h. y+ |( L

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-1 11:28:01 | 显示全部楼层
http://www.bbs168x.cn/forum.php? ... 2&highlight=xml   创建步骤可以参考此出。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:42 , Processed in 0.016027 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表