OpenFlowVMS:Tweaking the Configuration

From OpenFlow Wiki

Jump to: navigation, search

Contents


This page documents the bits and pieces of how to tweak the configuration file.

More Configuration

Changing the location of my controller

You can redirect your simulated OpenFlow network to connect to a different controller using the XML tag of_controller and of_port. For example,

<of_controller>noxrepo.org</of_controller>
<of_port>6633</of_port>

connects to the controller at noxrepo.org using port 6633.

Giving the OpenFlow switches more memory

You can specify more memory per OpenFlow switches using the of_mem tag, e.g.,

<of_mem>128</of_mem>

gives the OpenFlow switch 128 MB of memory.

Running script during startup of VM

The VM disk image has been configured to execute /cdrom/runapp, which is an ISO image generated by the configuration. This allows user defined scripts to be run for VMs.

Note that /cdrom/runme is automatically generated for the hosts.

Assigning IP address to host

To assign IP address to host, use the <ip> tag. For example,

<ip><static>192.168.0.10</static></ip>

sets the IP statically, while

<ip><dynamic /></ip>

assigns a IP starting from 192.168.0.1 and increment by 1 through the number of host that has dynamic IP assignment.

Changing Disk Image

Running non-snapshot copy of qemu to modify disk image

To run the disk image in non-snapshot mode, execute

vms-qemu-run.py -a <disk image name>

After the qemu VM completes booting, login as root/root. You can exit the qemu image by running

poweroff

in the VM.

Copying file through SSH to disk image

Run the image in non-snapshot mode (see this howto). The host machine can be accessed at 10.0.2.2.

scp 10.0.2.2:<some files> .

will work just fine.

Copying file via CD mount to disk image

A way to copy files into the disk image is to mount the files as a CD in qemu and then copy it over to the disk per se. Execute the following commands

mkdir -p qemu-run
cp <some files> qemu-run/.
vms-qemu-run.py -c <disk image name>

In the qemu VM,

cp /cdrom/<some files> <destination>

You can poweroff as usual to save the files in the disk image.

Runtime Manipulation

Manipulating OpenFlow switch during runtime

You can bring up the screen running the OpenFlow software reference switch by executing

screen -r <switch name>

where the switch name is as defined in the XML configuration. The username/password is root/root. You can disconnect the switch by killing secchan or remove ports from the OpenFlow switch using dpctl.

Manipulating VDE switch during runtime

You can use unixterm to configure the VDE switch during runtime, via the management UNIX socket in vde/ctl<VDE switch name>. This feature is provided in VDE natively.

Manipulating wirefilter during runtime

To change the configuraiton of wirefilters, you can also use unixterm as described previously. The socket name is usually vde/wiremgmt<end1><end2> . However, for scripting, you may use vms-wirefilter_set.py to set the parameters. The parameters are discussed on the VDE page.

Detaching qemu VM

Qemu VMs are run in screen and ^A-d does not detach them. To detach the VM, run

screen -d <name>

just as screen -r <name> brings them up.

Miscellaneous

Running the virtual network remotely

The vms-start.py script output a bash script to generate the network. You can then run the network remotely using this bash script with the files required (i.e., kernel and disk images, with OpenFlow binaries and whatever defined as needed in the configuration).