首页 > 其他 > 详细

KVM虚拟机加入物理机网络的方法(可用于应急)

时间:2015-05-29 18:23:16      阅读:341      评论:0      收藏:0      [点我收藏+]


安装vnc和xauth:

yum install -y tigervnc xauth


增加一块网卡,直接连接到br-ex  

virsh edit instance-00000002

增加一块网卡,

    <interface type=‘bridge‘>

      <mac address=‘fa:16:3e:cd:82:1f‘/>

      <source bridge=‘qbr317a0ffe-56‘/>

      <target dev=‘tap317a0ffe-56‘/>

      <model type=‘virtio‘/>

      <driver name=‘qemu‘/>

      <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x03‘ function=‘0x0‘/>

    </interface>

      <interface type=‘bridge‘>

      <source bridge=‘br-ex‘/>

      <virtualport type=‘openvswitch‘>

      </virtualport>

    </interface>


(具体xml格式可以参考:http://libvirt.org/formatdomain.html#elementsNICSVirtual)


关闭虚拟机电源:

virsh destroy instance-00000002

启动虚拟机:

virsh start instance-00000002

使用virsh和vnc连接虚拟机:

virsh vncdisplay instance-00000002

:0

vncviewer :0


进入虚拟机,将第二块网卡的地址改为业务地址



虚拟机恢复:

将虚拟机内部网络设置复原


virsh edit instance-00000002

将临时增加的interface部分去掉。


通过管理界面启动虚拟机


   


本文出自 “yuweibing的技术博客” 博客,请务必保留此出处http://yuweibing.blog.51cto.com/3879355/1656459

KVM虚拟机加入物理机网络的方法(可用于应急)

原文:http://yuweibing.blog.51cto.com/3879355/1656459

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!