1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

Merge branch 'feature-1112' of git.opennebula.org:one into feature-1112

This commit is contained in:
Tino Vazquez 2012-03-14 16:31:13 +01:00
commit a9175b9faa
16 changed files with 83 additions and 23 deletions

View File

@ -191,7 +191,7 @@ private:
/**
* Factory method for virtual network templates
*/
Template * get_new_template()
Template * get_new_template() const
{
return new DatastoreTemplate;
}

View File

@ -281,7 +281,7 @@ public:
/**
* Factory method for host templates
*/
Template * get_new_template()
Template * get_new_template() const
{
return new HostTemplate;
}

View File

@ -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;
}

View File

@ -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);
};
};

View File

@ -162,7 +162,7 @@ public:
/**
* Factory method for image templates
*/
Template * get_new_template()
Template * get_new_template() const
{
return new UserTemplate;
}

View File

@ -44,7 +44,7 @@ public:
/**
* Factory method for virtual machine templates
*/
Template * get_new_template()
Template * get_new_template() const
{
return new VirtualMachineTemplate;
}

View File

@ -542,7 +542,7 @@ public:
/**
* Factory method for virtual machine templates
*/
Template * get_new_template()
Template * get_new_template() const
{
return new VirtualMachineTemplate;
}

View File

@ -62,7 +62,7 @@ public:
/**
* Factory method for virtual network templates
*/
Template * get_new_template()
Template * get_new_template() const
{
return new VirtualNetworkTemplate;
}

View File

@ -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"

View File

@ -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"
]
#*******************************************************************************

View File

@ -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

View File

@ -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|

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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