diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java b/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java index 61d8b6a28b9..9cdd8634f20 100755 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java @@ -239,7 +239,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements private String _createTmplPath; private String _heartBeatPath; private String _securityGroupPath; - private String _networkUsagePath; + private String _routerProxyPath; private String _host; private String _dcId; private String _pod; @@ -543,11 +543,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements "Unable to find the security_group.py"); } - _networkUsagePath = Script.findScript("scripts/network/domr/", - "networkUsage.sh"); - if (_networkUsagePath == null) { + _routerProxyPath = Script.findScript("scripts/network/domr/", + "routerProxy.sh"); + if (_routerProxyPath == null) { throw new ConfigurationException( - "Unable to find the networkUsage.sh"); + "Unable to find the routerProxy.sh"); } String value = (String) params.get("developer"); @@ -2181,7 +2181,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements protected String networkUsage(final String privateIpAddress, final String option, final String vif) { - Script getUsage = new Script(_networkUsagePath, s_logger); + Script getUsage = new Script(_routerProxyPath, s_logger); + getUsage.add("netusage.sh"); + getUsage.add(privateIpAddress); if (option.equals("get")) { getUsage.add("-g"); } else if (option.equals("create")) { @@ -2194,7 +2196,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements getUsage.add("-d", vif); } - getUsage.add("-i", privateIpAddress); + final OutputInterpreter.OneLineParser usageParser = new OutputInterpreter.OneLineParser(); String result = getUsage.execute(usageParser); if (result != null) { diff --git a/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index f4771b8fc2a..fe4ec441435 100755 --- a/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -1022,7 +1022,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa protected Answer execute(CheckRouterCommand cmd) { if (s_logger.isDebugEnabled()) { s_logger.debug("Executing resource CheckRouterCommand: " + _gson.toJson(cmd)); - s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/checkrouter.sh "); + s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /opt/cloud/bin/checkrouter.sh "); } Pair result; diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java b/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java index ff0c5d7b87c..264cee52c15 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java +++ b/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java @@ -142,7 +142,7 @@ public class XenServer56Resource extends CitrixResourceBase { @Override protected String networkUsage(Connection conn, final String privateIpAddress, final String option, final String vif) { - String args = null; + String args = "netusage.sh " + privateIpAddress + " "; if (option.equals("get")) { args = "-g"; } else if (option.equals("create")) { @@ -157,9 +157,7 @@ public class XenServer56Resource extends CitrixResourceBase { args += vif; } - args += " -i "; - args += privateIpAddress; - return callHostPlugin(conn, "vmops", "networkUsage", "args", args); + return callHostPlugin(conn, "vmops", "routerProxy", "args", args); } protected NetworkUsageAnswer execute(NetworkUsageCommand cmd) { diff --git a/patches/systemvm/debian/config/root/guestnw.sh b/patches/systemvm/debian/config/opt/cloud/bin/guestnw.sh similarity index 100% rename from patches/systemvm/debian/config/root/guestnw.sh rename to patches/systemvm/debian/config/opt/cloud/bin/guestnw.sh diff --git a/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh b/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh old mode 100644 new mode 100755 diff --git a/patches/systemvm/debian/config/root/netusage.sh b/patches/systemvm/debian/config/opt/cloud/bin/netusage.sh old mode 100644 new mode 100755 similarity index 100% rename from patches/systemvm/debian/config/root/netusage.sh rename to patches/systemvm/debian/config/opt/cloud/bin/netusage.sh diff --git a/scripts/network/domr/networkUsage.sh b/scripts/network/domr/networkUsage.sh deleted file mode 100755 index 3b1450ad902..00000000000 --- a/scripts/network/domr/networkUsage.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - - - - -# $Id: networkUsage.sh 9879 2010-06-24 02:41:46Z anthony $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/vm/hypervisor/xenserver/networkUsage.sh $ -# networkUsage.sh -- create iptable rules to gather network stats -usage() { - printf "Usage: %s -[c|g|r] -i [-[a|d] ]\n" $(basename $0) >&2 -} - -check_gw() { - ping -c 1 -n -q $1 > /dev/null - if [ $? -gt 0 ] - then - sleep 1 - ping -c 1 -n -q $1 > /dev/null - fi - return $?; -} - -cert="/root/.ssh/id_rsa.cloud" - -while getopts 'cgri:a:d:' OPTION -do - case $OPTION in - i) iflag=1 - domRIp="$OPTARG" - ;; - esac -done - -if ! check_gw "$domRIp" -then - printf "Unable to ping the routing domain, exiting\n" >&2 - exit 3 -fi - -ssh -p 3922 -q -o StrictHostKeyChecking=no -i $cert root@$domRIp "/root/netusage.sh $*" -exit $? diff --git a/scripts/vm/hypervisor/xenserver/vmops b/scripts/vm/hypervisor/xenserver/vmops index daf07a037a1..2718f1e0a9f 100755 --- a/scripts/vm/hypervisor/xenserver/vmops +++ b/scripts/vm/hypervisor/xenserver/vmops @@ -372,19 +372,6 @@ def deleteFile(session, args): return txt -@echo -def networkUsage(session, args): - sargs = args['args'] - cmd = sargs.split(' ') - cmd.insert(0, "/opt/xensource/bin/networkUsage.sh") - cmd.insert(0, "/bin/bash") - try: - txt = util.pread2(cmd) - except: - util.SMlog(" network usage error " ) - txt = '' - - return txt def get_private_nic(session, args): vms = session.xenapi.VM.get_all() @@ -1442,7 +1429,7 @@ if __name__ == "__main__": "vm_data": vm_data, "savePassword": savePassword, "saveDhcpEntry": saveDhcpEntry, "setFirewallRule": setFirewallRule, "routerProxy": routerProxy, "setLoadBalancerRule": setLoadBalancerRule, "createFile": createFile, "deleteFile": deleteFile, - "networkUsage": networkUsage, "network_rules":network_rules, + "network_rules":network_rules, "can_bridge_firewall":can_bridge_firewall, "default_network_rules":default_network_rules, "destroy_network_rules_for_vm":destroy_network_rules_for_vm, "default_network_rules_systemvm":default_network_rules_systemvm, diff --git a/scripts/vm/hypervisor/xenserver/xcpserver/patch b/scripts/vm/hypervisor/xenserver/xcpserver/patch index 6e9603baa0d..b26bd31d633 100644 --- a/scripts/vm/hypervisor/xenserver/xcpserver/patch +++ b/scripts/vm/hypervisor/xenserver/xcpserver/patch @@ -26,7 +26,6 @@ dhcp_entry.sh=../../../../network/domr/,0755,/opt/xensource/bin router_proxy.sh=../../../../network/domr/,0755,/opt/xensource/bin vm_data.sh=../../../../network/domr/,0755,/opt/xensource/bin save_password_to_domr.sh=../../../../network/domr/,0755,/opt/xensource/bin -networkUsage.sh=../../../../network/domr/,0755,/opt/xensource/bin call_firewall.sh=../../../../network/domr/,0755,/opt/xensource/bin call_loadbalancer.sh=../../../../network/domr/,0755,/opt/xensource/bin l2tp_vpn.sh=../../../../network/domr/,0755,/opt/xensource/bin diff --git a/scripts/vm/hypervisor/xenserver/xenserver56/patch b/scripts/vm/hypervisor/xenserver/xenserver56/patch index 82f16a93834..23c87611591 100644 --- a/scripts/vm/hypervisor/xenserver/xenserver56/patch +++ b/scripts/vm/hypervisor/xenserver/xenserver56/patch @@ -24,7 +24,6 @@ pingtest.sh=../../..,0755,/opt/xensource/bin dhcp_entry.sh=../../../../network/domr/,0755,/opt/xensource/bin vm_data.sh=../../../../network/domr/,0755,/opt/xensource/bin save_password_to_domr.sh=../../../../network/domr/,0755,/opt/xensource/bin -networkUsage.sh=../../../../network/domr/,0755,/opt/xensource/bin call_firewall.sh=../../../../network/domr/,0755,/opt/xensource/bin call_loadbalancer.sh=../../../../network/domr/,0755,/opt/xensource/bin router_proxy.sh=../../../../network/domr/,0755,/opt/xensource/bin diff --git a/scripts/vm/hypervisor/xenserver/xenserver56fp1/patch b/scripts/vm/hypervisor/xenserver/xenserver56fp1/patch index 345868ef7b8..c979c43a136 100644 --- a/scripts/vm/hypervisor/xenserver/xenserver56fp1/patch +++ b/scripts/vm/hypervisor/xenserver/xenserver56fp1/patch @@ -23,7 +23,6 @@ pingtest.sh=../../..,0755,/opt/xensource/bin dhcp_entry.sh=../../../../network/domr/,0755,/opt/xensource/bin vm_data.sh=../../../../network/domr/,0755,/opt/xensource/bin save_password_to_domr.sh=../../../../network/domr/,0755,/opt/xensource/bin -networkUsage.sh=../../../../network/domr/,0755,/opt/xensource/bin call_firewall.sh=../../../../network/domr/,0755,/opt/xensource/bin call_loadbalancer.sh=../../../../network/domr/,0755,/opt/xensource/bin router_proxy.sh=../../../../network/domr/,0755,/opt/xensource/bin diff --git a/scripts/vm/hypervisor/xenserver/xenserver60/patch b/scripts/vm/hypervisor/xenserver/xenserver60/patch index 4d6e97131f8..a7212e8ec1a 100644 --- a/scripts/vm/hypervisor/xenserver/xenserver60/patch +++ b/scripts/vm/hypervisor/xenserver/xenserver60/patch @@ -28,7 +28,6 @@ pingtest.sh=../../..,0755,/opt/xensource/bin dhcp_entry.sh=../../../../network/domr/,0755,/opt/xensource/bin vm_data.sh=../../../../network/domr/,0755,/opt/xensource/bin save_password_to_domr.sh=../../../../network/domr/,0755,/opt/xensource/bin -networkUsage.sh=../../../../network/domr/,0755,/opt/xensource/bin call_firewall.sh=../../../../network/domr/,0755,/opt/xensource/bin call_loadbalancer.sh=../../../../network/domr/,0755,/opt/xensource/bin router_proxy.sh=../../../../network/domr/,0755,/opt/xensource/bin diff --git a/wscript b/wscript index 6e2f5a11031..d5628386c56 100644 --- a/wscript +++ b/wscript @@ -4,7 +4,7 @@ # the following two variables are used by the target "waf dist" # if you change 'em here, you need to change it also in cloud.spec, add a %changelog entry there, and add an entry in debian/changelog -VERSION = '3.0.3.2012-06-06T21:28:42Z' +VERSION = '3.0.3.2012-06-06T23:35:14Z' APPNAME = 'cloud' import shutil,os