remove unused files

This commit is contained in:
Anthony Xu 2010-11-18 01:15:26 -08:00
parent 1fa2df99cc
commit f62d9ae9c9
4 changed files with 1 additions and 244 deletions

View File

@ -233,8 +233,6 @@ import com.cloud.vm.VirtualMachineName;
public class LibvirtComputingResource extends ServerResourceBase implements ServerResource {
private static final Logger s_logger = Logger.getLogger(LibvirtComputingResource.class);
private String _createvnetPath;
private String _vnetcleanupPath;
private String _modifyVlanPath;
private String _versionstringpath;
private String _patchdomrPath;
@ -590,17 +588,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
}
_clusterId = (String) params.get("cluster");
_createvnetPath = Script.findScript(networkScriptsDir, "createvnet.sh");
if(_createvnetPath == null) {
throw new ConfigurationException("Unable to find createvnet.sh");
}
_vnetcleanupPath = Script.findScript(networkScriptsDir, "vnetcleanup.sh");
if(_vnetcleanupPath == null) {
throw new ConfigurationException("Unable to find createvnet.sh");
}
_modifyVlanPath = Script.findScript(networkScriptsDir, "modifyvlan.sh");
if (_modifyVlanPath == null) {
throw new ConfigurationException("Unable to find modifyvlan.sh");

View File

@ -1,30 +0,0 @@
#!/usr/bin/env bash
# $Id: bridge.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/vm/network/vnet/bridge.sh $
#
# bridge.sh
#
# Brings down the bridges so that vms can not go out to the network.
#
usage() {
printf "Usage: %s (up|down) \n" $(basename $0) >&2
}
#set -x
if [ "$1" == "up" -o "$1" == "down" ]
then
for bridge in `brctl show | grep vnbr | awk '{print $1}'`
do
ifconfig $bridge $1
echo "Bring $1 $bridge"
done
ifconfig xenbr1 > /dev/null 2>&1
if [ $? -eq 0 ]
then
ifconfig xenbr1 $1
fi
else
usage
exit 1
fi

View File

@ -1,125 +0,0 @@
#!/usr/bin/env bash
# $Id: createvnet.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/vm/network/vnet/createvnet.sh $
# runvm.sh -- start a vm from a directory containing the kernel and os images
# iscsi mode
#
usage() {
printf "Usage: %s: -v <vnet-id>\n" $(basename $0) >&2
}
VNETD=cloud-vnetd
check_vnetd_running() {
/sbin/lsmod | grep vnet_module > /dev/null
local module_loaded=$?
if [[ ( -z $(pidof $VNETD) ) && ( $module_loaded -ne 0 ) ]]
then
# Try to auto load vnet
service $VNETD start &> /dev/null
if [ $? -gt 0 ]
then
printf 'vnet: Neither userspace daemon running nor kernel module loaded!, not starting vm '"$vmname\n" >&2
exit 2
fi
fi
}
create_vnet () {
local vnetid=$1
vnetid=$(echo $vnetid | tr '[A-Z]' '[a-z]')
local bridgeid="vnbr""$vnetid"
local vnifid="vnif""$vnetid"
local longvnetid="0000:0000:0000:0000:0000:0000:0000:""$vnetid"
local br_exist=0
ifconfig $bridgeid &> /dev/null
br_exist=$?
# Create the vnet even if it already exists. /usr/sbin/vn operation is
# idempotent
nice -n -1 $VN vnet-create -b ${bridgeid} ${longvnetid} &> /dev/null
sleep 0.5
ifconfig ${bridgeid} &> /dev/null
if [ $? -gt 0 ]
then
local succ=0
for i in 1 2 3
do
nice -n -1 $VN vnet-create -b ${bridgeid} ${longvnetid} &> /dev/null
sleep $i
ifconfig ${bridgeid} &> /dev/null
if [ $? -eq 0 ]
then
succ=1
break;
fi
done
if [ $succ -eq 0 ]
then
echo "failed to create bridge"
exit 1
fi
fi
ifconfig ${vnifid} &> /dev/null
if [ $? -gt 0 ]
then
echo "failed to create vnif"
exit 2
fi
#echo $bridgeid $vnifid $longvnetid
if [ $br_exist -gt 0 ]
then
sleep 0.5
ifconfig $vnifid down
sleep 0.5
ifconfig $vnifid up
fi
iptables-save | grep $bridgeid > /dev/null
if [ $? -gt 0 ]
then
iptables -I FORWARD -i $bridgeid -o $bridgeid -j ACCEPT
fi
return 0
}
#set -x
vflag=
while getopts 'v:' OPTION
do
case $OPTION in
v) vflag=1
vnetid="$OPTARG"
;;
?) usage
exit 2
;;
esac
done
if [ "$vflag" != "1" ]
then
usage
exit 2
fi
VN=cloud-vn
#make sure vnetd is running
check_vnetd_running
# Create the vnet locally if not already created
if ! create_vnet "$vnetid" ; then
printf "Failed to create vnet, exiting\n" >&2
exit 5
fi
exit 0

View File

@ -1,76 +0,0 @@
#!/usr/bin/env bash
# $Id: vnetcleanup.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/vm/network/vnet/vnetcleanup.sh $
# vnetcleanup.sh -- clean up vnet artifacts (mainly bridges)
#
usage() {
printf "Usage: %s: <-a|-v vnet>\n" $(basename $0) >&2
}
#set -x
delete_all_vnbrs() {
for brs in `brctl show | grep vnbr`;
do
case $brs in vnbr*)
ifconfig $brs down;
brctl delbr $brs;
iptables -D FORWARD -i $brs -o $brs -j ACCEPT
;;
*)
;;
esac;
done
}
vflag=
aflag=
vnetid=""
while getopts 'v:a' OPTION
do
case $OPTION in
v) vflag=1
vnetid="$OPTARG"
;;
a) aflag=1
;;
?) usage
exit 2
;;
esac
done
#either all or only 1
if [ "$aflag$vflag" != "1" ]
then
usage
exit 2
fi
VN=cloud-vn
if [ "$aflag" == "1" ]
then
for i in `vn vnets -a | grep id | cut -d' ' -f6|cut -d')' -f1`
do
$VN vnet-delete -b $i &> /dev/null
done
delete_all_vnbrs
exit 0
fi
if [ "$vflag" == "1" ]
then
bridgeid="vnbr""$vnetid"
longvnetid="0000:0000:0000:0000:0000:0000:0000:""$vnetid"
if ! $VN vnet-delete -b $longvnetid &> /dev/null
then
ifconfig $bridgeid down;
brctl delbr $bridgeid;
fi
iptables -D FORWARD -i $bridgeid -o $bridgeid -j ACCEPT
exit 0
fi
exit 0