You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2012/08/02 16:15:19 UTC
[3/3] Removing the obsolete scripts directory from agent-simulator
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/__old__/setup_sg.sh
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/__old__/setup_sg.sh b/agent-simulator/scripts/zucchini/__old__/setup_sg.sh
deleted file mode 100755
index 94884d9..0000000
--- a/agent-simulator/scripts/zucchini/__old__/setup_sg.sh
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# zucchini uses local storage, before setting up make sure
-# * xen.public.network.device is set
-# * use.local.storage and systemvm.use.local.storage are true
-# * optionally turn off stats collectors
-# * expunge.delay and expunge.interval are 60s
-# * ping.interval is around 3m
-# * turn off dns updates to entire zone, network.dns.basiczone.update=pod
-# * capacity.skipcounting.hours=0
-# * direct.agent.load.size=1000
-# * security groups are enabled
-
-# This script will only setup an approximate number of hosts. To achieve the ratio
-# by 13. So if 4000 hosts are added, you might see only 3900 come up
-# 10 hosts per pod @ 1 host per cluster in a single zone
-# Each pod has a /25, so 128 addresses. I think we reserved 5 IP addresses for system VMs in each pod.
-# Then we had something like 60 addresses for hosts and 60 addresses for VMs.
-
-#Environment
-#1. Approximately 10 hosts per pod.
-#2. Only 3 host tags.
-#3. With in each pod, the host tags are the same. Homogenous Pods
-#5. In simulator.properties, workers=1
-
-usage() {
- printf "Setup Zucchini Like Environment\nUsage: %s: -h management-server -z zoneid [-d delay] -n numberofhosts [-g numberof security groups]\n" $(basename $0) >&2
-}
-
-a=1 #CIDR - 16bytes
-b=2 #CIDR - 8 bytes
-
-#options
-hflag=1
-zflag=
-dflag=1
-nflag=1
-gflag=1
-
-host="127.0.0.1" #default localhost
-zoneid=
-delay=300 #default 5 minutes
-numberofhosts=1300 #default 1300 hosts
-numberofgroups=130 #default 130 groups
-tag1="TAG1"
-tag2="TAG2"
-tag3="TAG3"
-
-while getopts 'h:z:d:n:g:' OPTION
-do
- case $OPTION in
- h) hflag=1
- host="$OPTARG"
- ;;
- z) zflag=1
- zoneid="$OPTARG"
- ;;
- d) dflag=1
- delay="$OPTARG"
- ;;
- n) nflag=1
- numberofhosts="$OPTARG"
- ;;
- g) gflag=1
- numberofgroups="$OPTARG"
- ;;
- ?) usage
- exit 2
- ;;
- esac
-done
-
-if [ $zflag$nflag != "11" ]
-then
- usage
- exit 2
-fi
-
-numberofpods=$(($numberofhosts/10)) #10 hosts per pod
-tag_one_range=$(($numberofpods*5/13))
-tag_two_range=$(($numberofpods*2/13))
-tag_three_range=$(($numberofpods-$tag_one_range-$tag_two_range))
-
-clusters_per_pod=10 #each cluster has one host
-hosts_per_pod=10
-
-
-declare -a pod_array
-declare -a cluster_array
-
-echo "Split Ratio :: " $tag_one_range":"$tag_two_range":"$tag_three_range
-
-#create the zone
-zone_query="GET http://$host/client/?command=createZone&networktype=Basic&securitygroupenabled=true&name=Zucchini&dns1=4.2.2.2&internaldns1=4.2.2.2 HTTP/1.0\n\n"
-echo -e $zone_query | nc -v -w $delay $host 8096
-
-#Add Secondary Storage
-sstor_query="GET http://$host/client/?command=addSecondaryStorage&zoneid=$zoneid&url=nfs://172.16.15.32/export/share/secondary HTTP/1.0\n\n"
-echo -e $sstor_query | nc -v -w $delay $host 8096
-
-let x=a
-let y=b
-
-echo "[DEBUG] $(date) Starting Creation of $numberofpods Pods"
-for ((name=1;name<=$numberofpods;name++))
-do
- echo "[DEBUG] $(date) Creating pod[POD$name]"
- pod_query="GET http://$host/client/?command=createPod&zoneId=$zoneid&name=POD$name&netmask=255.255.255.128&startIp=172.$x.$y.130&endIp=172.$x.$y.189&gateway=172.$x.$y.129 HTTP/1.0\n\n"
- pod_out=$(echo -e $pod_query | nc -v -w $delay $host 8096)
- pod_id=$(echo $pod_out | sed 's/\(.*<id>\)\([0-9]*\)\(.*\)/\2/g')
- if ! [[ "$pod_id" =~ ^[0-9]+$ ]] ; then
- exec >&2; echo "[ERROR] $(date) pod [POD$name] creation failed"; continue
- fi
- echo "[DEBUG] $(date) Created pod["$pod_id":POD"$name"]"
- pod_array[$name]=$pod_id
-
- echo "[DEBUG] $(date) Creating vlan for pod[POD$name]"
- vlan_query="GET http://$host/client/?command=createVlanIpRange&vlan=untagged&zoneid=$zoneid&podId=$pod_id&forVirtualNetwork=false&gateway=172.$x.$y.129&netmask=255.255.255.128&startip=172.$x.$y.190&endip=172.$x.$y.249 HTTP/1.0\n\n"
- vlan_out=$(echo -e $vlan_query | nc -v -w $delay $host 8096)
- vlan_id=$(echo $vlan_out | sed 's/\(.*<id>\)\([0-9]*\)\(.*\)/\2/g')
- if ! [[ "$vlan_id" =~ ^[0-9]+$ ]] ; then
- let y+=1
- if [ "$y" -eq 256 ]
- then
- let x+=1
- y=1
- fi
- exec >&2; echo "[ERROR] $(date) vlan creation for pod[POD$name] failed"; continue
- fi
- echo "[DEBUG] $(date) Created vlan for pod[POD$name]"
-
- #add clusters
- echo "[DEBUG] $(date) Starting Creation of $clusters_per_pod clusters for pod[POD$name]"
- for ((cluster=1;cluster<=$clusters_per_pod;cluster++))
- do
- echo "[DEBUG] $(date) Creating cluster[POD$name-CLUSTER$cluster] for pod[POD$name]"
- cluster_query="GET http://$host/client/?command=addCluster&hypervisor=Simulator&clustertype=CloudManaged&zoneId=$zoneid&podId=$pod_id&clustername=POD$name-CLUSTER$cluster HTTP/1.0\n\n"
- cluster_out=$(echo -e $cluster_query | nc -v -w $delay $host 8096)
- cluster_id=$(echo $cluster_out | sed 's/\(.*<id>\)\([0-9]*\)\(.*\)/\2/g')
- if ! [[ "$cluster_id" =~ ^[0-9]+$ ]] ; then
- exec >&2; echo "[ERROR] $(date) cluster[POD$name-CLUSTER$cluster] creation for pod[POD$name] failed"; continue
- fi
- echo "[DEBUG] $(date) Created cluster["$cluster_id":POD"$name"-CLUSTER"$cluster"]"
- cluster_array[$(($name*$clusters_per_pod + $cluster))]=$cluster_id
- done
- echo "[DEBUG] $(date) Finished Creating clusters for pod[POD$name]"
- let y+=1
- if [ "$y" -eq 256 ]
- then
- let x+=1
- y=1
- fi
-done
-echo "[DEBUG] $(date) Finished Creating $numberofpods Pods"
-
-#echo "DEBUG:Pods and Clusters"
-#echo "PODS:("${#pod_array[@]}")" ${pod_array[@]}
-#echo "CLUSTERS:("${#cluster_array[@]}")" ${cluster_array[@]}
-echo
-echo
-
-
-echo "[DEBUG] $(date) Creating $numberofgroups security groups"
-for ((sg=1;sg<=$numberofgroups;sg++))
-do
- sg_create_query="GET http://$host/client/?command=createSecurityGroup&name=zGroup$sg&description=zGroup$sg&domainid=1&account=admin HTTP/1.0\n\n"
- sg_create_out=$(echo -e $sg_create_query | nc -v -w $delay $host 8096)
- sg_id=$(echo $sg_create_out | sed 's/\(.*<id>\)\([0-9]*\)\(.*\)/\2/g')
- if ! [[ "$sg_id" =~ ^[0-9]+$ ]] ; then
- exec >&2; echo "[ERROR] $(date) security group[zGroup$sg] creation failed"; continue
- fi
- echo "[DEBUG] $(date) Created security group[$sg_id:zGroup$sg]"
-
- echo "[DEBUG] $(date) Adding ingress rule start,end=$((2000 + $sg)), $((2000 + $sg)) to security group[$sg_id:zGroup$sg]"
- sg_auth_query="GET http://$host/client/?command=authorizeSecurityGroupIngress&domainid=1&account=admin&securitygroupid=$sg_id&protocol=TCP&startport=$((2000 + $sg))&endport=$((2000 + $sg))&usersecuritygrouplist[0].account=admin&usersecuritygrouplist[0].group=zGroup$sg HTTP/1.0\n\n"
- sg_auth_out=$(echo -e $sg_auth_query | nc -v -w $delay $host 8096)
-done
-echo "[DEBUG] $(date) Finished Creating security groups"
-
-#Add hosts
-#TAG1
-for ((i=1;i<=$tag_one_range;i++))
-do
- podid=${pod_array[$i]}
- for ((j=1;j<=$hosts_per_pod;j++))
- do
- clusterid=${cluster_array[$(($i*$clusters_per_pod + $j))]}
- host_query="GET http://$host/client/?command=addHost&zoneId=$zoneid&podId=$podid&username=sim&password=sim&clusterid=$clusterid&url=http%3A%2F%2Fsim&hypervisor=Simulator&clustertype=CloudManaged&hosttags=$tag1 HTTP/1.0\n\n"
- host_out=$(echo -e $host_query | nc -v -w $delay $host 8096)
- host_id=$(echo $host_out | sed 's/\(.*<id>\)\([0-9]*\)\(.*\)/\2/g')
- if ! [[ "$host_id" =~ ^[0-9]+$ ]] ; then
- exec >&2; echo "[ERROR] $(date) host addition failed in [pod:$podid,cluster:$clusterid]"; continue
- fi
- host_name=$(echo $host_out | sed 's/\(.*<name>\)\(SimulatedAgent.[-0-9a-zA-Z]*\)\(.*\)/\2/g')
- echo "[DEBUG] $date added host [$host_id:$host_name] to [pod:$podid,cluster:$clusterid] for TAG1"
- done
-done
-
-#TAG2
-for ((i=$(($tag_one_range + 1));i<=$(($tag_one_range + $tag_two_range));i++))
-do
- podid=${pod_array[$i]}
- for ((j=1;j<=$hosts_per_pod;j++))
- do
- clusterid=${cluster_array[$(($i*$clusters_per_pod + $j))]}
- host_query="GET http://$host/client/?command=addHost&zoneId=$zoneid&podId=$podid&username=sim&password=sim&clusterid=$clusterid&url=http%3A%2F%2Fsim&hypervisor=Simulator&clustertype=CloudManaged&hosttags=$tag2 HTTP/1.0\n\n"
- host_out=$(echo -e $host_query | nc -v -w $delay $host 8096)
- host_id=$(echo $host_out | sed 's/\(.*<id>\)\([0-9]*\)\(.*\)/\2/g')
- if ! [[ "$host_id" =~ ^[0-9]+$ ]] ; then
- exec >&2; echo "[ERROR] $(date) host addition failed in [pod:$podid,cluster:$clusterid]"; continue
- fi
- host_name=$(echo $host_out | sed 's/\(.*<name>\)\(SimulatedAgent.[-0-9a-zA-Z]*\)\(.*\)/\2/g')
- echo "[DEBUG] $date added host [$host_id:$host_name] to [pod:$podid,cluster:$clusterid] for TAG2"
- done
-done
-
-#TAG3
-for ((i=$(($tag_two_range + $tag_one_range + 1));i<=$(($tag_three_range + $tag_two_range + $tag_one_range));i++))
-do
- podid=${pod_array[$i]}
- for ((j=1;j<=$hosts_per_pod;j++))
- do
- clusterid=${cluster_array[$(($i*$clusters_per_pod + $j))]}
- host_query="GET http://$host/client/?command=addHost&zoneId=$zoneid&podId=$podid&username=sim&password=sim&clusterid=$clusterid&url=http%3A%2F%2Fsim&hypervisor=Simulator&clustertype=CloudManaged&hosttags=$tag3 HTTP/1.0\n\n"
- host_out=$(echo -e $host_query | nc -v -w $delay $host 8096)
- host_id=$(echo $host_out | sed 's/\(.*<id>\)\([0-9]*\)\(.*\)/\2/g')
- if ! [[ "$host_id" =~ ^[0-9]+$ ]] ; then
- exec >&2; echo "[ERROR] $(date) host addition failed in [pod:$podid,cluster:$clusterid]"; continue
- fi
- host_name=$(echo $host_out | sed 's/\(.*<name>\)\(SimulatedAgent.[-0-9a-zA-Z]*\)\(.*\)/\2/g')
- echo "[DEBUG] $date added host [$host_id:$host_name] to [pod:$podid,cluster:$clusterid] for TAG3"
- done
-done
-
-echo "Setup complete"
-exit 0
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/__old__/small.sh
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/__old__/small.sh b/agent-simulator/scripts/zucchini/__old__/small.sh
deleted file mode 100755
index 429cdd0..0000000
--- a/agent-simulator/scripts/zucchini/__old__/small.sh
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# zucchini uses local storage, before setting up make sure
-# * xen.public.network.device is set
-# * use.local.storage and systemvm.use.local.storage are true
-# * optionally turn off stats collector
-# * expunge.delay and expunge.interval are 60s
-# * capacity.skipcounting.hours=0
-
-#Environment
-#1. Small setup for zucchini : 13, 26, 39, 52 hosts only
-#2. Only 3 host tags.
-#5. simulator.properties, workers=1
-
-usage() {
- printf "Setup Zucchini Like Environment\nUsage: %s: -h management-server -z zoneid [-d delay] -n numberofhosts\n" $(basename $0) >&2
-}
-
-a=1 #CIDR - 16bytes
-b=2 #CIDR - 8 bytes
-
-#options
-hflag=1
-zflag=1
-dflag=1
-nflag=1
-
-host="127.0.0.1" #default localhost
-zoneid=
-delay=300 #default 5 minutes
-numberofhosts=13 #default 13 hosts
-tag1="TAG1"
-tag2="TAG2"
-tag3="TAG3"
-
-while getopts 'h:z:d:n:' OPTION
-do
- case $OPTION in
- h) hflag=1
- host="$OPTARG"
- ;;
- z) zflag=1
- zoneid="$OPTARG"
- ;;
- d) dflag=1
- delay="$OPTARG"
- ;;
- n) nflag=1
- numberofhosts="$OPTARG"
- ;;
- ?) usage
- exit 2
- ;;
- esac
-done
-
-if [ $hflag$zflag$dflag$nflag != "1111" ]
-then
- usage
- exit 2
-fi
-
-if [ $numberofhosts -gt 52 ]
-then
- echo "Can't exceed 52 hosts"
- exit 130
-fi
-
-numberofpods=3 #130 hosts per pod. So need only 3. each pod is homogenous
-tag_one_range=$(($numberofhosts*5/13))
-tag_two_range=$(($numberofhosts*2/13))
-tag_three_range=$(($numberofhosts-$tag_one_range-$tag_two_range))
-
-#create the zone
-zone_query="GET http://$host/client/?command=createZone&networktype=Basic&securitygroupenabled=true&name=Zucchini&dns1=4.2.2.2&internaldns1=4.2.2.2 HTTP/1.0\n\n"
-echo -e $zone_query | nc -v -w $delay $host 8096
-
-sstor_query="GET http://$host/client/?command=addSecondaryStorage&zoneid=$zoneid&url=nfs://172.16.15.32/export/share/secondary HTTP/1.0\n\n"
-echo -e $sstor_query | nc -v -w $delay $host 8096
-
-let x=a
-let y=b
-for name in `seq 1 $numberofpods`
-do
- pod_query="GET http://$host/client/?command=createPod&zoneId=$zoneid&name=POD$name&netmask=255.255.255.0&startIp=172.$x.$y.2&endIp=172.$x.$y.131&gateway=172.$x.$y.1 HTTP/1.0\n\n"
- vlan_query="GET http://$host/client/?command=createVlanIpRange&vlan=untagged&zoneid=$zoneid&podId=$name&forVirtualNetwork=false&gateway=172.$y.$x.1&netmask=255.255.255.0&startip=172.$y.$x.2&endip=172.$y.$x.131 HTTP/1.0\n\n"
- echo -e $pod_query | nc -v -w $delay $host 8096
- echo -e $vlan_query | nc -v -w $delay $host 8096
-
- let x+=1
- let y+=1
-done
-
-#add clusters -
-#for i in `seq 1 10`
-# cluster_query="GET http://$host/client/?command=addCluster&hypervisor=Simulator&clustertype=CloudManaged&zoneId=$zoneid&podId=$podid&clustername=POD$podid-CLUSTER$cluster HTTP/1.0\n\n"
-# echo -e $cluster_query | nc -v -w $delay $host 8096
-#do
-
-clusterid=1
-#TAG1
-for cluster in `seq 1 $tag_one_range`
-do
- cluster_query="GET http://$host/client/?command=addCluster&hypervisor=Simulator&clustertype=CloudManaged&zoneId=$zoneid&podId=1&clustername=POD1-CLUSTER$cluster HTTP/1.0\n\n"
- echo -e $cluster_query | nc -v -w $delay $host 8096
- host_query="GET http://$host/client/?command=addHost&zoneId=$zoneid&podId=1&username=sim&password=sim&clusterid=$clusterid&url=http%3A%2F%2Fsim&hypervisor=Simulator&clustertype=CloudManaged&hosttags=$tag1 HTTP/1.0\n\n"
- echo -e $host_query | nc -v -w $delay $host 8096
- let clusterid+=1
-done
-
-#TAG2
-for cluster in `seq $(($tag_one_range + 1)) $(($tag_one_range + $tag_two_range))`
-do
- cluster_query="GET http://$host/client/?command=addCluster&hypervisor=Simulator&clustertype=CloudManaged&zoneId=$zoneid&podId=2&clustername=POD2-CLUSTER$cluster HTTP/1.0\n\n"
- echo -e $cluster_query | nc -v -w $delay $host 8096
- host_query="GET http://$host/client/?command=addHost&zoneId=$zoneid&podId=2&username=sim&password=sim&clusterid=$clusterid&url=http%3A%2F%2Fsim&hypervisor=Simulator&clustertype=CloudManaged&hosttags=$tag2 HTTP/1.0\n\n"
- echo -e $host_query | nc -v -w $delay $host 8096
- let clusterid+=1
-done
-
-#TAG3
-for cluster in `seq $(($tag_two_range + $tag_one_range + 1)) $(($tag_three_range + $tag_two_range + $tag_one_range))`
-do
- cluster_query="GET http://$host/client/?command=addCluster&hypervisor=Simulator&clustertype=CloudManaged&zoneId=$zoneid&podId=3&clustername=POD3-CLUSTER$cluster HTTP/1.0\n\n"
- echo -e $cluster_query | nc -v -w $delay $host 8096
- host_query="GET http://$host/client/?command=addHost&zoneId=$zoneid&podId=3&username=sim&password=sim&clusterid=$clusterid&url=http%3A%2F%2Fsim&hypervisor=Simulator&clustertype=CloudManaged&hosttags=$tag3 HTTP/1.0\n\n"
- echo -e $host_query | nc -v -w $delay $host 8096
- let clusterid+=1
-
-done
-
-for i in {1..60}
-do
- sg_create_query="GET http://$host/client/?command=createSecurityGroup&name=TestGroup1&description=Test HTTP/1.0\n\n"
- echo -e $sg_create_query | nc -v -w $delay $host 8096
-
- sg_auth_query="GET http://$host/client/?command=authorizeSecurityGroupIngress&domainid=1&account=admin&securitygroupid=$((i+2))&protocol=TCP&startport=2002&endport=2002&usersecuritygrouplist[0].account=admin&usersecuritygrouplist[0].group=TestGroup1 HTTP/1.0\n\n"
- echo -e $sg_create_query | nc -v -w $delay $host 8096
-done
-
-echo "Setup complete"
-exit 0
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/__old__/so_setup.sh
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/__old__/so_setup.sh b/agent-simulator/scripts/zucchini/__old__/so_setup.sh
deleted file mode 100755
index ffdd243..0000000
--- a/agent-simulator/scripts/zucchini/__old__/so_setup.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-./setupServiceOffering.sh -h $host -i T1 -l -m 7168 -c 1024 -n 1 -g TAG1
-./setupServiceOffering.sh -h $host -i T2 -l -m 7168 -c 1024 -n 1 -g TAG2
-./setupServiceOffering.sh -h $host -i T3 -l -m 7168 -c 1024 -n 1 -g TAG3
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/__old__/startRouter.sh
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/__old__/startRouter.sh b/agent-simulator/scripts/zucchini/__old__/startRouter.sh
deleted file mode 100755
index 8f36d65..0000000
--- a/agent-simulator/scripts/zucchini/__old__/startRouter.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-x=$1
-
-start_router="GET http://10.91.30.226:8096/client/?command=startRouter&id=$x HTTP/1.0\n\n"
-
-
-echo -e $start_router | nc -v -q 60 10.91.30.226 8096
-
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/__old__/startVirtualMachine.sh
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/__old__/startVirtualMachine.sh b/agent-simulator/scripts/zucchini/__old__/startVirtualMachine.sh
deleted file mode 100755
index d25cd49..0000000
--- a/agent-simulator/scripts/zucchini/__old__/startVirtualMachine.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-x=$1
-
-start_vm="GET http://10.91.30.226:8096/client/?command=startVirtualMachine&id=$x HTTP/1.0\n\n"
-
-
-echo -e $start_vm | nc -v -q 60 10.91.30.226 8096
-
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/__old__/stopRouter.sh
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/__old__/stopRouter.sh b/agent-simulator/scripts/zucchini/__old__/stopRouter.sh
deleted file mode 100755
index c933b7d..0000000
--- a/agent-simulator/scripts/zucchini/__old__/stopRouter.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-usage() {
- printf "Stop Router: %s: -h management-server -i vmid\n" $(basename $0) >&2
-}
-
-iflag=
-hflag=
-
-host="127.0.0.1" #defaults to localhost
-vmid=
-
-while getopts 'h:i:' OPTION
-do
- case $OPTION in
- h) hflag=1
- host="$OPTARG"
- ;;
- i) iflag=1
- vmid="$OPTARG"
- ;;
- ?) usage
- exit 2
- ;;
- esac
-done
-
-if [[ $iflag != "1" ]]
-then
- usage
- exit 2
-fi
-stop_vm="GET http://$host:8096/client/?command=stopRouter&id=$vmid HTTP/1.0\n\n"
-echo -e $stop_vm | nc -v -w 60 $host 8096
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/__old__/stopVirtualMachine.sh
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/__old__/stopVirtualMachine.sh b/agent-simulator/scripts/zucchini/__old__/stopVirtualMachine.sh
deleted file mode 100755
index 1ed1106..0000000
--- a/agent-simulator/scripts/zucchini/__old__/stopVirtualMachine.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-usage() {
- printf "Stop Virtual Machine: %s: -h management-server -i vmid\n" $(basename $0) >&2
-}
-
-iflag=
-hflag=
-
-host="127.0.0.1" #defaults to localhost
-vmid=
-
-while getopts 'h:i:' OPTION
-do
- case $OPTION in
- h) hflag=1
- host="$OPTARG"
- ;;
- i) iflag=1
- vmid="$OPTARG"
- ;;
- ?) usage
- exit 2
- ;;
- esac
-done
-
-if [[ $iflag != "1" ]]
-then
- usage
- exit 2
-fi
-stop_vm="GET http://$host:8096/client/?command=stopVirtualMachine&id=$vmid HTTP/1.0\n\n"
-echo -e $stop_vm | nc -v -w 60 $host 8096
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/__old__/zucchini219.sh
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/__old__/zucchini219.sh b/agent-simulator/scripts/zucchini/__old__/zucchini219.sh
deleted file mode 100755
index ca54e5c..0000000
--- a/agent-simulator/scripts/zucchini/__old__/zucchini219.sh
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-
-
-
-#1. Approximately 10 hosts per pod.
-#2. Only 3 host tags.
-
-a=$1 #CIDR - 16bytes
-b=$2 #CIDR - 8 bytes
-host=$3 #MSHOST
-zone=$4
-
-zone_query="GET http://$host/client/?command=createZone&name=Zucchini&dns1=4.2.2.2&internaldns1=4.2.2.2&vlan=10-4000&guestcidraddress=10.1.1.0%2F24 HTTP/1.0\n\n"
-echo -e $zone_query | nc -v -w 120 $host 8096
-
-# Pod Ratio: 38:15:47
-let x=a
-let y=b
-for name in `seq 1 152`
-do
- pod_query="GET http://$host/client/?command=createPod&zoneId=$zone&name=POD$name&cidr=172.$x.$y.0%2F24&startIp=172.$x.$y.2&endIp=172.$x.$y.252&gateway=172.$x.$y.1 HTTP/1.0\n\n"
- vlan_query="GET http://$host/client/?command=createVlanIpRange&vlan=untagged&zoneid=$zone&podId=$name&forVirtualNetwork=false&gateway=172.$y.$x.1&netmask=255.255.255.0&startip=172.$y.$x.2&endip=172.$y.$x.252 HTTP/1.0\n\n"
- echo -e $pod_query | nc -v -w 20 $host 8096
- echo -e $vlan_query | nc -v -w 20 $host 8096
-
- let x+=1
- let y+=1
-done
-
-
-let x=a
-let y=b
-for name in `seq 153 212`
-do
- pod_query="GET http://$host/client/?command=createPod&zoneId=$zone&name=POD$name&cidr=182.$x.$y.0%2F24&startIp=182.$x.$y.2&endIp=182.$x.$y.252&gateway=182.$x.$y.1 HTTP/1.0\n\n"
- vlan_query="GET http://$host/client/?command=createVlanIpRange&vlan=untagged&zoneid=$zone&podId=$name&forVirtualNetwork=false&gateway=182.$y.$x.1&netmask=255.255.255.0&startip=182.$y.$x.2&endip=182.$y.$x.252 HTTP/1.0\n\n"
- echo -e $pod_query | nc -v -w 20 $host 8096
- echo -e $vlan_query | nc -v -w 20 $host 8096
-
- let x+=1
- let y+=1
-done
-
-let x=a
-let y=b
-for name in `seq 213 400`
-do
-
- pod_query="GET http://$host/client/?command=createPod&zoneId=$zone&name=POD$name&cidr=192.$x.$y.0%2F24&startIp=192.$x.$y.2&endIp=192.$x.$y.252&gateway=192.$x.$y.1 HTTP/1.0\n\n"
- vlan_query="GET http://$host/client/?command=createVlanIpRange&vlan=untagged&zoneid=$zone&podId=$name&forVirtualNetwork=false&gateway=192.$y.$x.1&netmask=255.255.255.0&startip=192.$y.$x.2&endip=192.$y.$x.252 HTTP/1.0\n\n"
- echo -e $pod_query | nc -v -w 20 $host 8096
- echo -e $vlan_query | nc -v -w 20 $host 8096
-
- let x+=1
- let y+=1
-done
-
-#add clusters
-#for name in `seq 1 400`
-#do
-# for cluster in `seq 1 10`
-# do
-# cluster_query="GET http://$host/client/?command=addCluster&hypervisor=Simulator&clustertype=CloudManaged&zoneId=$zone&podId=$name&clustername=POD$name-CLUSTER$cluster HTTP/1.0\n\n"
-# echo -e $cluster_query | nc -v -w 120 $host 8096
-# done
-#done
-
-# @ 10 hosts per pod @ 10 clusters per pod
-clusterid=1
-#TAG1
-for podid in `seq 58 152`
-do
- for i in `seq 1 10`
- do
- host_query="GET http://$host/client/?command=addHost&zoneId=$zone&podId=$podid&username=sim&password=sim&clustername=CLUSTER$clusterid&hosttags=TAG1&url=http%3A%2F%2Fsim HTTP/1.0\n\n"
- echo -e $host_query | nc -v -w 6000 $host 8096
- done
- let clusterid+=1
-done
-
-#TAG2
-for podid in `seq 153 212`
-do
- for i in `seq 1 10`
- do
- host_query="GET http://$host/client/?command=addHost&zoneId=$zone&podId=$podid&username=sim&password=sim&clustername=CLUSTER$clusterid&hosttags=TAG2&url=http%3A%2F%2Fsim HTTP/1.0\n\n"
- echo -e $host_query | nc -v -w 6000 $host 8096
- done
- let clusterid+=1
-done
-
-#TAG3
-for podid in `seq 213 400`
-do
- for i in `seq 1 10`
- do
- host_query="GET http://$host/client/?command=addHost&zoneId=$zone&podId=$podid&username=sim&password=sim&cluster=CLUSTER$clusterid&hosttags=TAG3&url=http%3A%2F%2Fsim HTTP/1.0\n\n"
- echo -e $host_query | nc -v -w 6000 $host 8096
- done
- let clusterid+=1
-done
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/setup.py
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/setup.py b/agent-simulator/scripts/zucchini/setup.py
deleted file mode 100644
index 6624f06..0000000
--- a/agent-simulator/scripts/zucchini/setup.py
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/usr/bin/env python
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-'''
-# zucchini uses local storage, before setting up make sure
-# * xen.public.network.device is set
-# * use.local.storage and systemvm.use.local.storage are true
-# * optionally turn off stats collectors
-# * expunge.delay and expunge.interval are 60s
-# * ping.interval is around 3m
-# * turn off dns updates to entire zone, network.dns.basiczone.update=pod
-# * capacity.skipcounting.hours=0
-# * direct.agent.load.size=1000
-# * security groups are enabled
-# This script will only setup an approximate number of hosts. To achieve the ratio
-# by 13. So if 4000 hosts are added, you might see only 3900 come up
-# 10 hosts per pod @ 1 host per cluster in a single zone
-# Each pod has a /25, so 128 addresses. I think we reserved 5 IP addresses for system VMs in each pod.
-# Then we had something like 60 addresses for hosts and 60 addresses for VMs.
-
-#Environment
-#1. Approximately 10 hosts per pod.
-#2. Only 3 host tags.
-#3. With in each pod, the host tags are the same. Homogenous Pods
-#5. In simulator.properties, workers=1
-'''
-
-from optparse import OptionParser
-from configGenerator import *
-import random
-
-def getGlobalSettings():
- global_settings = {'expunge.delay': '60',
- 'expunge.interval': '60',
- 'expunge.workers': '3',
- 'workers': '10',
- 'network.dns.basiczone.updates':'pod',
- 'use.user.concentrated.pod.allocation':'false',
- 'vm.allocation.algorithm':'firstfit',
- 'capacity.check.period':'0',
-# 'host.stats.interval':'-1',
-# 'vm.stats.interval':'-1',
-# 'storage.stats.interval':'-1',
-# 'router.stats.interval':'-1',
- 'vm.op.wait.interval':'5',
- 'xen.public.network.device':'10.10.10.10', #only a dummy for the simulator
- 'guest.domain.suffix':'zucchini.simulator',
- 'instance.name':'ZIM',
- 'direct.agent.load.size':'1000',
- 'default.page.size':'10000',
- 'linkLocalIp.nums':'4',
- 'system.vm.use.local.storage':'true',
- 'use.local.storage':'true',
- 'check.pod.cidrs':'false',
- }
- for k,v in global_settings.iteritems():
- cfg=configuration()
- cfg.name=k
- cfg.value=v
- yield cfg
-
-def podIpRangeGenerator():
- x=1
- y=2
- while 1:
- if y == 255:
- x=x+1
- if x == 255:
- x=1
- break
- y=1
- y=y+1
- #pod mangement network
- yield ('172.'+str(x)+'.'+str(y)+'.129', '172.'+str(x)+'.'+str(y)+'.130', '172.'+str(x)+'.'+str(y)+'.189')
-
-
-def vlanIpRangeGenerator():
- x=1
- y=2
- while 1:
- if y == 255:
- x=x+1
- if x==255:
- x=1
- break
- y=1
- y=y+1
- #vlan ip range
- yield ('172.'+str(x)+'.'+str(y)+'.129', '172.'+str(x)+'.'+str(y)+'.190', '172.'+str(x)+'.'+str(y)+'.249')
-
-
-def describeZucchiniResources(numberOfAgents=1300, dbnode='localhost', mshost='localhost', randomize=False, sgenabled=False):
- zs=cloudstackConfiguration()
- numberofpods=numberOfAgents/10
- tagOneHosts = numberOfAgents*5/13
- tagTwoHosts = numberOfAgents*2/13
- tagThreeHosts = numberOfAgents-tagOneHosts-tagTwoHosts
-
- clustersPerPod=10
- hostsPerPod=10
-
- z = zone()
- z.dns1 = '4.2.2.2'
- z.dns2 = '192.168.110.254'
- z.internaldns1 = '10.91.28.6'
- z.internaldns2 = '192.168.110.254'
- z.name = 'Zucchini'
- z.networktype = 'Basic'
- z.securitygroupenabled = sgenabled
-
- hosttags=['TAG1' for x in range(tagOneHosts)] + ['TAG2' for x in range(tagTwoHosts)] + ['TAG3' for x in range(tagThreeHosts)]
- curhost=0
- curpod=0
- if randomize:
- random.shuffle(hosttags) #randomize the host distribution
-
- for podRange,vlanRange in zip(podIpRangeGenerator(), vlanIpRangeGenerator()):
- p = pod()
- curpod=curpod+1
- p.name = 'POD'+str(curpod)
- p.gateway=podRange[0]
- p.startip=podRange[1]
- p.endip=podRange[2]
- p.netmask='255.255.255.128'
-
- v = iprange()
- v.gateway=vlanRange[0]
- v.startip=vlanRange[1]
- v.endip=vlanRange[2]
- v.netmask="255.255.255.128"
- p.guestIpRanges.append(v)
-
- for i in range(1,clustersPerPod+1):
- c = cluster()
- c.clustername = 'POD'+str(curpod)+'-CLUSTER'+str(i)
- c.hypervisor = 'Simulator'
- c.clustertype = 'CloudManaged'
-
- try:
- h = host()
- h.username = 'root'
- h.password = 'password'
- h.url = "http://sim/test-%d"%(curhost)
- h.hosttags = hosttags.pop()
- c.hosts.append(h)
- curhost=curhost+1
- p.clusters.append(c)
- except IndexError:
- break
- #end clusters
- z.pods.append(p)
- if curpod == numberofpods or curhost == numberOfAgents:
- break
- #end pods
- secondary = secondaryStorage()
- secondary.url = 'nfs://172.16.25.32/secondary/path'
- z.secondaryStorages.append(secondary)
- zs.zones.append(z)
-
- '''Add mgt server'''
- mgt = managementServer()
- mgt.mgtSvrIp = mshost #could be the LB balancing the cluster of management server as well
- zs.mgtSvr.append(mgt)
-
- '''Add a database'''
- db = dbServer()
- db.dbSvr = opts.dbnode
- zs.dbSvr = db
-
- '''Add some configuration'''
- [zs.globalConfig.append(cfg) for cfg in getGlobalSettings()]
-
- ''''add loggers'''
- testClientLogger = logger()
- testClientLogger.name = "TestClient"
- testClientLogger.file = "/var/log/testclient.log"
-
- testCaseLogger = logger()
- testCaseLogger.name = "TestCase"
- testCaseLogger.file = "/var/log/testcase.log"
-
- zs.logger.append(testClientLogger)
- zs.logger.append(testCaseLogger)
- return zs
-
-if __name__=="__main__":
- parser = OptionParser()
- # parser.add_option('-h','--host',dest='host',help='location of management server(s) or load-balancer')
- parser.add_option('-n', '--number-of-agents', action='store', dest='agents', help='number of agents in the deployment')
- parser.add_option('-g', '--enable-security-groups', dest='sgenabled', help='specify if security groups are to be enabled', default=False, action='store_true')
- parser.add_option('-o', '--output', action='store', default='./z.cfg', dest='output', help='the path where the json config file generated')
- parser.add_option('-d', '--dbnode', dest='dbnode', help='hostname/ip of the database node', action='store')
- parser.add_option('-m', '--mshost', dest='mshost', help='hostname/ip of management server', action='store')
- parser.add_option('-r', '--randomize', dest='randomize', help='randomize the distribution of tags (hetergenous clusters)', action='store_true', default=False)
-
- (opts, args) = parser.parse_args()
- mandatories = ['agents']
- for m in mandatories:
- if not opts.__dict__[m]:
- print 'mandatory option missing'
-
- cfg = describeZucchiniResources(int(opts.agents), opts.dbnode, opts.mshost, opts.randomize, opts.sgenabled)
- generate_setup_config(cfg, opts.output)
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/tests/testListVm.py
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/tests/testListVm.py b/agent-simulator/scripts/zucchini/tests/testListVm.py
deleted file mode 100644
index ca72bfd..0000000
--- a/agent-simulator/scripts/zucchini/tests/testListVm.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
- import unittest2 as unittest
-except ImportError:
- import unittest
-
-import timeit
-import random
-from cloudstackAPI import *
-from cloudstackTestCase import *
-
-
-class ListVmTests(cloudstackTestCase):
- '''
- List Virtual Machine tests
- '''
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def listAllVm(self):
- numVms = 0
- api = self.testClient.getApiClient()
- listVmCmd = listVirtualMachines.listVirtualMachinesCmd()
- listVmCmd.account = 'admin'
- listVmCmd.zoneid = 1
- listVmCmd.domainid = 1
- listVmResponse = api.listVirtualMachines(listVmCmd)
- if listVmResponse is not None:
- numVms = len(listVmResponse)
-
- @unittest.skip("skipping")
- def test_timeListVm(self):
- t = timeit.Timer(self.listAllVm)
- l = t.repeat(50, 50)
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/tests/testProvision.py
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/tests/testProvision.py b/agent-simulator/scripts/zucchini/tests/testProvision.py
deleted file mode 100644
index 01c1e1d..0000000
--- a/agent-simulator/scripts/zucchini/tests/testProvision.py
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/usr/bin/env python
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
- import unittest2 as unittest
-except ImportError:
- import unittest
-import random
-from cloudstackAPI import *
-from cloudstackTestCase import *
-
-class Provision(cloudstackTestCase):
- '''
- This should test basic provisioning of virtual machines
- 1. Deploy a no-frills VM
- 2. Deploy with tags - hosttags
- 3. Deploy with/without security groups
- '''
-
- solist = {}
- sgid = []
-
- def setUp(self):
- pass
-
-
- def tearDown(self):
- pass
-
-
- def test_0_createServiceOfferings(self):
- for tag in ['TAG1', 'TAG2', 'TAG3']:
- csocmd = createServiceOffering.createServiceOfferingCmd()
- csocmd.cpunumber = 1
- csocmd.cpuspeed = 2048
- csocmd.displaytext = tag
- csocmd.memory = 7168
- csocmd.name = tag
- csocmd.hosttags = tag
- csocmd.storagetype = 'local'
- csoresponse = self.testClient.getApiClient().createServiceOffering(csocmd)
- self.debug(csoresponse)
- self.solist[tag]=csoresponse.id
-
-
- def test_1_createSecurityGroupAndRules(self):
- apiClient = self.testClient.getApiClient()
- sgCmd=createSecurityGroup.createSecurityGroupCmd()
- sgCmd.description='default-ps'
- sgCmd.name='default-ps'
- sgCmd.account='admin'
- sgCmd.domainid='1'
- sgRes = apiClient.createSecurityGroup(sgCmd)
- self.sgid.append(sgRes.id)
-
- ruleCmd=authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
- ruleCmd.cidrlist = '172.1.0.0/12'
- ruleCmd.startport = '1'
- ruleCmd.endport = '65535'
- ruleCmd.protocol = 'TCP'
- ruleCmd.securitygroupid = sgRes.id
- ruleCmd.account='admin'
- ruleCmd.domainid='1'
- sgIngressresponse=apiClient.authorizeSecurityGroupIngress(ruleCmd)
-
- ruleCmd=authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
- ruleCmd.cidrlist = '172.1.0.0/12'
- ruleCmd.startport = '22'
- ruleCmd.endport = '22'
- ruleCmd.protocol = 'TCP'
- ruleCmd.securitygroupid = sgRes.id
- ruleCmd.account='admin'
- ruleCmd.domainid='1'
- sgIngressresponse=apiClient.authorizeSecurityGroupIngress(ruleCmd)
-
- ruleCmd=authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
- ruleCmd.cidrlist = '10.0.0.0/8'
- ruleCmd.startport = '80'
- ruleCmd.endport = '80'
- ruleCmd.protocol = 'TCP'
- ruleCmd.securitygroupid = sgRes.id
- ruleCmd.account='admin'
- ruleCmd.domainid='1'
- sgIngressresponse=apiClient.authorizeSecurityGroupIngress(ruleCmd)
- self.debug("Security group created with id: %d"%sgRes.id)
-
-
-
- @unittest.skip("needs fixing")
- def test_2_DeployVMWithHostTags(self):
- '''
- Deploy 3 virtual machines one with each hosttag
- '''
- for k,v in self.solist:
- deployVmCmd = deployVirtualMachine.deployVirtualMachineCmd()
- deployVmCmd.zoneid = 1
- deployVmCmd.hypervisor='Simulator'
- deployVmCmd.serviceofferingid=v
- deployVmCmd.account='admin'
- deployVmCmd.domainid=1
- deployVmCmd.templateid=10
- deployVmResponse = self.testClient.getApiClient().deployVirtualMachine(deployVmCmd)
- self.debug("Deployed VM :%d in job: %d"%(deployVmResponse[0].id, deployVmResponse[0].jobid))
-
-
- def deployCmd(self, tag, sgid):
- deployVmCmd = deployVirtualMachine.deployVirtualMachineCmd()
- deployVmCmd.zoneid = 1
- deployVmCmd.hypervisor='Simulator'
- deployVmCmd.serviceofferingid=self.solist[tag]
- deployVmCmd.account='admin'
- deployVmCmd.domainid=1
- deployVmCmd.templateid=10
- deployVmCmd.securitygroupids=sgid
- return deployVmCmd
-
-
- def listVmsInAccountCmd(self, acct='admin'):
- api = self.testClient.getApiClient()
- listVmCmd = listVirtualMachines.listVirtualMachinesCmd()
- listVmCmd.account = acct
- listVmCmd.zoneid = 1
- listVmCmd.domainid = 1
- listVmResponse = api.listVirtualMachines(listVmCmd)
- return listVmResponse
-
-
- def destroyCmd(self, vmid):
- destroyVmCmd = destroyVirtualMachine.destroyVirtualMachineCmd()
- destroyVmCmd.zoneid=1
- destroyVmCmd.id=vmid
- self.testClient.getApiClient().destroyVirtualMachine(destroyVmCmd)
-
-
- def deployN(self,nargs=300,batchsize=0):
- '''
- Deploy Nargs number of VMs concurrently in batches of size {batchsize}.
- When batchsize is 0 all Vms are deployed in one batch
- VMs will be deployed in 5:2:6 ratio
- '''
- tag1=nargs*5/13
- tag2=nargs*2/13
- tag3=nargs-tag1-tag2
-
- cmds = []
- [cmds.append(self.deployCmd('TAG1', self.sgid[0])) for i in range(tag1)]
- [cmds.append(self.deployCmd('TAG2', self.sgid[0])) for i in range(tag2)]
- [cmds.append(self.deployCmd('TAG3', self.sgid[0])) for i in range(tag3)]
- random.shuffle(cmds) #with mix-and-match of Tags
-
- if batchsize == 0:
- self.testClient.submitCmdsAndWait(cmds)
- else:
- while len(cmds) > 0:
- try:
- newbatch = [cmds.pop() for b in range(batchsize)] #pop batchsize items
- self.testClient.submitCmdsAndWait(newbatch)
- except IndexError:
- break
-
-
- def test_3_bulkDeploy(self):
- self.deployN(nargs=500,batchsize=100)
-
-
- def test_4_bulkDestroy(self):
- api = self.testClient.getApiClient()
- for vm in self.listVmsInAccountCmd('admin'):
- if vm is not None:
- self.destroyCmd(vm.id)
-
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1a18d5ca/agent-simulator/scripts/zucchini/zucchini.configuration.sql
----------------------------------------------------------------------
diff --git a/agent-simulator/scripts/zucchini/zucchini.configuration.sql b/agent-simulator/scripts/zucchini/zucchini.configuration.sql
deleted file mode 100644
index 34e135d..0000000
--- a/agent-simulator/scripts/zucchini/zucchini.configuration.sql
+++ /dev/null
@@ -1,46 +0,0 @@
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements. See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership. The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License. You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing,
--- software distributed under the License is distributed on an
--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
--- KIND, either express or implied. See the License for the
--- specific language governing permissions and limitations
--- under the License.
-
-update configuration set value='pod' where name='network.dns.basiczone.updates';
-
-update configuration set value='false' where name='use.user.concentrated.pod.allocation';
-update configuration set value='firstfit' where name='vm.allocation.algorithm';
-
-update configuration set value='60' where name='expunge.delay';
-update configuration set value='60' where name='expunge.interval';
-update configuration set value='3' where name='expunge.workers';
-update configuration set value='10' where name='workers';
-
-update configuration set value='0' where name='capacity.check.period';
-update configuration set value='-1' where name='host.stats.interval';
-update configuration set value='-1' where name='vm.stats.interval';
-update configuration set value='-1' where name='storage.stats.interval';
-update configuration set value='-1' where name='router.stats.interval';
-update configuration set value='5' where name like 'vm.op.wait.interval';
-
-update configuration set value='10.10.10.10' where name='xen.public.network.device';
-update configuration set value='zcloud.simulator' where name='guest.domain.suffix';
-update configuration set value='ZIM' where name='instance.name';
-
-update configuration set value='1000' where name='direct.agent.load.size';
-update configuration set value='10000' where name='default.page.size';
-update configuration set value='4' where name='linkLocalIp.nums';
-update configuration set value='true' where name like '%local.storage%';
-update configuration set value='false' where name like '%check.pod.cidr%';
-
-update configuration set value='100' where name like '%network.security%pool%';
-update configuration set value='120' where name like 'network.securitygroups.work.cleanup.interval';