zoukankan      html  css  js  c++  java
  • XenServer网卡Bonding

    在给XenServer配置网卡bonding时,需要在所有节点都添加到集群之后再进行,这也是来自Citrix的建议:“Citrix 

    recommends never joining a host that already has a bond configured on it to a pool”。用XenCenter连接XenServer

    集群,通过界面操作对网卡进行bonding是很easy的,而要自动化完成这个功能,可通过调用xe命令去完成,但需要

    对一些概念有了解。


    对于一个XenServer集群,各个节点看到的逻辑网络应该是一样,否则VM迁移后网络就会出问题。比如原来这个VM

    连接的是A网桥,迁移到另外的节点后没有同样的这么一个A网桥,VM就会不知所措。


    假设我需要分别对eth0和eth2做bonding,eth1和eth3做bonding,那么首先我要创建两个网络,分别为bond02和

    bond13,脚本(这些脚本都只在master节点运行)如下:


    bond02_uuid=`xe network-create name-label=bond02`

    bond13_uuid=`xe network-create name-label=bond13`


    然后获取到集群中所有节点的host uuid:


    host_uuids=`xe host-list|grep uuid|awk '{print $5}'`


    循环对每个节点做bonding:


    for host_uuid in $(echo $host_uuids | awk '{print;}')

    do

     

        # 获取到eth0和eth2 的pif uuid

        host_eth0_pif=`xe pif-list host-uuid=$host_uuid device=eth0|grep -E '^uuid'|awk '{print $5}'`
        host_eth2_pif=`xe pif-list host-uuid=$host_uuid device=eth2|grep -E '^uuid'|awk '{print $5}'`


         # 对eth0和eth2做bonding,这里的network-uuid就是上面创建网络bond02后返回的uuid,每个节点都用它

        xe bond-create network-uuid=$bond02_uuid pif-uuids=$host_eth0_pif,$host_eth2_pif mode=lacp


        # 获取到eth1和eth3 的pif uuid

        host_eth1_pif=`xe pif-list host-uuid=$host_uuid device=eth1|grep -E '^uuid'|awk '{print $5}'`
        host_eth3_pif=`xe pif-list host-uuid=$host_uuid device=eth3|grep -E '^uuid'|awk '{print $5}'`


       # 对eth1和eth3做bonding,这里的network-uuid就是上面创建网络bond13后返回的uuid,每个节点都用它

        xe bond-create network-uuid=$bond13_uuid pif-uuids=$host_eth1_pif,$host_eth3_pif mode=lacp


    done


    “xe bond-create”命令中我指定的mode是lacp,关于这个需要了解的可移步这里

  • 相关阅读:
    layui弹出层处理(获取、操作弹出层数据等)
    Unity3D判断鼠标向右或向左滑动,响应不同的事件
    (转载)李剑英的CSLight入门指南结合NGUI热更新
    Unity3D研究院之LZMA压缩文件与解压文件
    CSLight研究院之学习笔记结合NGUI(一)
    《暗黑世界GM管理后台系统》部署+功能说明文档
    Firefly卡牌手游《暗黑世界V1.5》服务器端源码+GM管理后台源码
    电信SDK Pay函数里面System.out.print 无输出消息
    WP8:在Unity中使用OpenXLive
    WP8:Unity3D之间的值传递
  • 原文地址:https://www.cnblogs.com/woshiweige/p/4518421.html
Copyright © 2011-2022 走看看