Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i need to create a bridge with public ip for assigning public ip to VM. But how can i create a Network bridge,as there is a default "xenbr0" bridge exists.

Editing Xenbr0 is not permanent,how can i make it persistent against service restarts?

share|improve this question
    
Are you using Citrix XenServer, XCP, or something you built yourself? –  Nick Bastin Aug 6 '12 at 10:47
    
XCP Xen Cloud platform –  Kevin Parker Aug 6 '12 at 12:58

1 Answer 1

up vote 1 down vote accepted

So, in XCP (and XenServer), bridges are made for each one of your physical NICs (pnic). These start at xenbr0 for the first NIC and are numbered upwards from there. In the current version of XCP modifications to OVS bridges are not persisted across restarts - you will have to make your own init script to apply your modifications that is run on each restart.

This can be very simple - you just need to implement start() - stop() and restart() can just report that they are unsupported, and then use chkconfig --add my_init_script to get it integrated into the boot process. I've pasted an example init script below (which sets an openflow controller, which is probably not what you want, but you can simply replace the start() method with the commands you need:

#!/bin/bash
#
# Init file for OpenFlow configuration
#
# chkconfig: 2345 21 78
# description: OpenFlow bridge configuration
#

# source function library
. /etc/rc.d/init.d/functions

VSCTL=/usr/bin/ovs-vsctl

controller_ip=192.168.0.200

start() {
  $VSCTL set-controller xenbr0 tcp:$controller_ip:6633
}

stop() {
        echo -n $"Action not supported"
        failure $"Action not supported"
        echo
        return 1;
}

restart() {
        echo -n $"Action not supported"
        failure $"Action not supported"
        echo
        return 1;
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac
share|improve this answer
    
I need to create virtual bridge with out connecting to the actual interface.Using this bridge i wish to create an internal ip for every VM. –  Kevin Parker Aug 7 '12 at 4:33
1  
@KevinParker: That is done in XenCenter (or XAPI) by creating a server-only private Network, and then attaching each VM to it. –  Nick Bastin Aug 7 '12 at 13:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.