Action Hooks
From SolusVM
Slave Action Hooks
Xen Virtual Server Configuration File
This action hook will allow you to make custom changes to a xen virtual server configuration file. The action hook is run directly after SolusVM writes or rewrites the configuration file for a virtual server. The action hook must be placed in:
/home/xen/vm<ID>/hooks/hook_config.sh
Heres an example hook that removes the vif line from a configuration file and replaces it with a custom vif line:
#!/bin/sh grep -Ev 'vif' /home/xen/vm101/vm101.cfg > /home/xen/vm101/vm101.cfg.tmp mv /home/xen/vm101/vm101.cfg.tmp /home/xen/vm101/vm101.cfg echo "vif = ['ip=123.123.123.123, vifname=vifvm101.0, mac=00:16:3e:95:a1:b3, rate=128KB/s']" >> /home/xen/vm101/vm101.cfg
There are also plenty of other ways to manipulate the configuration files i.e sed and awk.
Ebtables Hook
Pre hook that runs at the start of each vif cycle:
/usr/local/solusvm/data/hooks/ebtables-pre.sh
Variables passed:
$1 - Interface (vif)
Ip loop hook that adds entries to each vif while looping through each ip:
/usr/local/solusvm/data/hooks/ebtables-iploop.sh
Variables passed:
$1 - Interface (vif) $2 - Ipaddress
Post hook that runs at the end of each vif cycle:
/usr/local/solusvm/data/hooks/ebtables-post.sh
Variables passed:
$1 - Interface (vif)
