diff --git a/include/Datastore.h b/include/Datastore.h index 39cfa9ef60..43c5cd3e9e 100644 --- a/include/Datastore.h +++ b/include/Datastore.h @@ -191,7 +191,7 @@ private: /** * Factory method for virtual network templates */ - Template * get_new_template() + Template * get_new_template() const { return new DatastoreTemplate; } diff --git a/include/Host.h b/include/Host.h index 06b519f450..0c60e7f783 100644 --- a/include/Host.h +++ b/include/Host.h @@ -281,7 +281,7 @@ public: /** * Factory method for host templates */ - Template * get_new_template() + Template * get_new_template() const { return new HostTemplate; } diff --git a/include/PoolObjectSQL.h b/include/PoolObjectSQL.h index a1177c364c..bd4e72b449 100644 --- a/include/PoolObjectSQL.h +++ b/include/PoolObjectSQL.h @@ -363,7 +363,7 @@ public: * by classes that uses templates * @return a new template */ - virtual Template * get_new_template() + virtual Template * get_new_template() const { return 0; } diff --git a/include/RequestManagerAllocate.h b/include/RequestManagerAllocate.h index faceccd4db..e13bdbc42c 100644 --- a/include/RequestManagerAllocate.h +++ b/include/RequestManagerAllocate.h @@ -178,7 +178,7 @@ public: int add_to_cluster(Cluster* cluster, int id, string& error_msg) { - return cluster->add_datastore(id, error_msg); + return cluster->add_vnet(id, error_msg); }; }; diff --git a/include/User.h b/include/User.h index befac1f21b..770b5943bc 100644 --- a/include/User.h +++ b/include/User.h @@ -162,7 +162,7 @@ public: /** * Factory method for image templates */ - Template * get_new_template() + Template * get_new_template() const { return new UserTemplate; } diff --git a/include/VMTemplate.h b/include/VMTemplate.h index 610f7e43a5..b48f7ddb75 100644 --- a/include/VMTemplate.h +++ b/include/VMTemplate.h @@ -44,7 +44,7 @@ public: /** * Factory method for virtual machine templates */ - Template * get_new_template() + Template * get_new_template() const { return new VirtualMachineTemplate; } diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 06150277a7..9254ec2b4c 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -542,7 +542,7 @@ public: /** * Factory method for virtual machine templates */ - Template * get_new_template() + Template * get_new_template() const { return new VirtualMachineTemplate; } diff --git a/include/VirtualNetwork.h b/include/VirtualNetwork.h index 161bdd77b8..069a7449a6 100644 --- a/include/VirtualNetwork.h +++ b/include/VirtualNetwork.h @@ -62,7 +62,7 @@ public: /** * Factory method for virtual network templates */ - Template * get_new_template() + Template * get_new_template() const { return new VirtualNetworkTemplate; } diff --git a/install.sh b/install.sh index 3675417768..8a4501f716 100755 --- a/install.sh +++ b/install.sh @@ -236,6 +236,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/hooks \ $VAR_LOCATION/remotes/hooks/ft \ $VAR_LOCATION/remotes/datastore \ + $VAR_LOCATION/remotes/datastore/dummy \ $VAR_LOCATION/remotes/datastore/fs \ $VAR_LOCATION/remotes/datastore/vmware \ $VAR_LOCATION/remotes/datastore/iscsi \ @@ -391,6 +392,7 @@ INSTALL_FILES=( TM_DUMMY_FILES:$VAR_LOCATION/remotes/tm/dummy TM_LVM_FILES:$VAR_LOCATION/remotes/tm/lvm DATASTORE_DRIVER_COMMON_SCRIPTS:$VAR_LOCATION/remotes/datastore/ + DATASTORE_DRIVER_DUMMY_SCRIPTS:$VAR_LOCATION/remotes/datastore/dummy DATASTORE_DRIVER_FS_SCRIPTS:$VAR_LOCATION/remotes/datastore/fs DATASTORE_DRIVER_VMWARE_SCRIPTS:$VAR_LOCATION/remotes/datastore/vmware DATASTORE_DRIVER_ISCSI_SCRIPTS:$VAR_LOCATION/remotes/datastore/iscsi @@ -821,6 +823,10 @@ TM_ISCSI_FILES="src/tm_mad/iscsi/clone \ DATASTORE_DRIVER_COMMON_SCRIPTS="src/datastore_mad/remotes/xpath.rb \ src/datastore_mad/remotes/libfs.sh" +DATASTORE_DRIVER_DUMMY_SCRIPTS="src/datastore_mad/remotes/dummy/cp \ + src/datastore_mad/remotes/dummy/mkfs \ + src/datastore_mad/remotes/dummy/rm" + DATASTORE_DRIVER_FS_SCRIPTS="src/datastore_mad/remotes/fs/cp \ src/datastore_mad/remotes/fs/mkfs \ src/datastore_mad/remotes/fs/rm" diff --git a/share/etc/oned.conf b/share/etc/oned.conf index b98bdf288e..ba4cb5cba7 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -281,7 +281,7 @@ VM_MAD = [ TM_MAD = [ executable = "one_tm", - arguments = "-t 15 -d dummy,lvm,shared,ssh,vmware" ] + arguments = "-t 15 -d dummy,lvm,shared,ssh,vmware,iscsi" ] #******************************************************************************* # Datastore Driver Configuration @@ -298,7 +298,7 @@ TM_MAD = [ DATASTORE_MAD = [ executable = "one_datastore", - arguments = "-t 15 -d fs,vmware" + arguments = "-t 15 -d fs,vmware,iscsi" ] #******************************************************************************* diff --git a/src/cli/onecluster b/src/cli/onecluster index 352e4811e0..8cb5ac0dd3 100755 --- a/src/cli/onecluster +++ b/src/cli/onecluster @@ -169,7 +169,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do # TODO: allow the second param to be [:range, :vnetid_list] command :delvnet, delvnet_desc,:clusterid, :vnetid do - helper.perform_actions(args[0],options,"updated") do |cluster| + helper.perform_action(args[0],options,"updated") do |cluster| cluster.delvnet(args[1].to_i) end end diff --git a/src/cli/onevnet b/src/cli/onevnet index e76da4b48d..2c82e5b1fe 100755 --- a/src/cli/onevnet +++ b/src/cli/onevnet @@ -75,7 +75,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do Creates a new Virtual Network from the given template file EOT - command :create, create_desc, :file, options=>CREATE_OPTIONS do + command :create, create_desc, :file, :options=>CREATE_OPTIONS do cid = options[:cluster] || ClusterPool::NONE_CLUSTER_ID helper.create_resource(options) do |vn| diff --git a/src/datastore_mad/remotes/dummy/cp b/src/datastore_mad/remotes/dummy/cp new file mode 100755 index 0000000000..d915146f42 --- /dev/null +++ b/src/datastore_mad/remotes/dummy/cp @@ -0,0 +1,19 @@ +#!/bin/sh + +# -------------------------------------------------------------------------- # +# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +echo "dummy_path 1024" diff --git a/src/datastore_mad/remotes/dummy/mkfs b/src/datastore_mad/remotes/dummy/mkfs new file mode 100755 index 0000000000..d915146f42 --- /dev/null +++ b/src/datastore_mad/remotes/dummy/mkfs @@ -0,0 +1,19 @@ +#!/bin/sh + +# -------------------------------------------------------------------------- # +# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +echo "dummy_path 1024" diff --git a/src/datastore_mad/remotes/dummy/rm b/src/datastore_mad/remotes/dummy/rm new file mode 100755 index 0000000000..6c1cd9257d --- /dev/null +++ b/src/datastore_mad/remotes/dummy/rm @@ -0,0 +1,19 @@ +#!/bin/sh + +# -------------------------------------------------------------------------- # +# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +exit 0 diff --git a/src/tm_mad/one_tm.rb b/src/tm_mad/one_tm.rb index 0a9a70eff1..d8fc620987 100755 --- a/src/tm_mad/one_tm.rb +++ b/src/tm_mad/one_tm.rb @@ -33,9 +33,9 @@ require 'OpenNebulaDriver' require 'CommandManager' require 'getoptlong' -# This class provides basic messaging and logging functionality to implement -# TransferManager Drivers. A TransferManager driver is a program (or a set of) -# that specialize the OpenNebula behavior to distribute disk images in a +# This class provides basic messaging and logging functionality to implement +# TransferManager Drivers. A TransferManager driver is a program (or a set of) +# that specialize the OpenNebula behavior to distribute disk images in a # specific datastore to the hosts class TransferManagerDriver < OpenNebulaDriver @@ -72,9 +72,9 @@ class TransferManagerDriver < OpenNebulaDriver script = parse_script(script_file) if script.nil? - send_message("TRANSFER", + send_message("TRANSFER", RESULT[:failure], - id, + id, "Transfer file '#{script_file}' does not exist") return end @@ -84,7 +84,7 @@ class TransferManagerDriver < OpenNebulaDriver if result == RESULT[:failure] send_message("TRANSFER", result, id, info) - return + return end } @@ -106,7 +106,7 @@ class TransferManagerDriver < OpenNebulaDriver stext.each_line {|line| next if line.match(/^\s*#/) # skip if the line is commented next if line.match(/^\s*$/) # skip if the line is empty - + command = line.split(" ") lines << command @@ -115,7 +115,7 @@ class TransferManagerDriver < OpenNebulaDriver return lines end - # Executes a single transfer action (command), as returned by the parse + # Executes a single transfer action (command), as returned by the parse # method # @param id [String] with the OpenNebula ID for the TRANSFER action # @param command [Array] @@ -131,13 +131,10 @@ class TransferManagerDriver < OpenNebulaDriver path = File.join(@local_scripts_path, tm, cmd) path << " " << args - rc = LocalCommand.run(path, log_method(id)) result, info = get_info_from_execution(rc) - PP.pp([path,result,info],STDERR) - return result, info end end