From 2f18afaaa506ba6743cf199c102eb4649edd63d0 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 1 Oct 2012 19:06:46 +0200 Subject: [PATCH 01/22] feature #1388: Change default port to 4568 for econe-server --- src/cloud/ec2/etc/econe.conf | 2 +- src/cloud/ec2/lib/EC2QueryClient.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloud/ec2/etc/econe.conf b/src/cloud/ec2/etc/econe.conf index 8fa7faac65..bef637a457 100644 --- a/src/cloud/ec2/etc/econe.conf +++ b/src/cloud/ec2/etc/econe.conf @@ -26,7 +26,7 @@ # Host and port where econe server will run :host: localhost -:port: 4567 +:port: 4568 # SSL proxy URL that serves the API (set if is being used) #:ssl_server: https://service.endpoint.fqdn:port/ diff --git a/src/cloud/ec2/lib/EC2QueryClient.rb b/src/cloud/ec2/lib/EC2QueryClient.rb index 8fe2383e24..fa8c87aaa6 100644 --- a/src/cloud/ec2/lib/EC2QueryClient.rb +++ b/src/cloud/ec2/lib/EC2QueryClient.rb @@ -97,7 +97,7 @@ module EC2QueryClient if $ec2url endpoint = $ec2url else - endpoint = "http://localhost:4567" + endpoint = "http://localhost:4568" end end From e22c9a0f6063e17abfc808b339c6f796694ed789 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 2 Oct 2012 11:53:02 +0200 Subject: [PATCH 02/22] Revert "feature #1388: Change default port to 4568 for econe-server" This reverts commit 2f18afaaa506ba6743cf199c102eb4649edd63d0. --- src/cloud/ec2/etc/econe.conf | 2 +- src/cloud/ec2/lib/EC2QueryClient.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloud/ec2/etc/econe.conf b/src/cloud/ec2/etc/econe.conf index bef637a457..8fa7faac65 100644 --- a/src/cloud/ec2/etc/econe.conf +++ b/src/cloud/ec2/etc/econe.conf @@ -26,7 +26,7 @@ # Host and port where econe server will run :host: localhost -:port: 4568 +:port: 4567 # SSL proxy URL that serves the API (set if is being used) #:ssl_server: https://service.endpoint.fqdn:port/ diff --git a/src/cloud/ec2/lib/EC2QueryClient.rb b/src/cloud/ec2/lib/EC2QueryClient.rb index fa8c87aaa6..8fe2383e24 100644 --- a/src/cloud/ec2/lib/EC2QueryClient.rb +++ b/src/cloud/ec2/lib/EC2QueryClient.rb @@ -97,7 +97,7 @@ module EC2QueryClient if $ec2url endpoint = $ec2url else - endpoint = "http://localhost:4568" + endpoint = "http://localhost:4567" end end From 841120b66852468be62ca38820841d13683926bd Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Tue, 2 Oct 2012 12:13:33 +0200 Subject: [PATCH 03/22] Bug #1421: Relative paths in tm drivers cause deployment failures --- src/tm_mad/qcow2/clone | 10 +++++++--- src/tm_mad/qcow2/mvds | 12 ++++++++---- src/tm_mad/shared/clone | 10 +++++++--- src/tm_mad/shared/ln | 39 ++++++++++++++++++--------------------- src/tm_mad/shared/mvds | 12 ++++++++---- src/tm_mad/ssh/mvds | 14 +------------- src/tm_mad/vmfs/ln | 33 +++++++++++++++------------------ src/tm_mad/vmfs/mvds | 2 -- 8 files changed, 64 insertions(+), 68 deletions(-) diff --git a/src/tm_mad/qcow2/clone b/src/tm_mad/qcow2/clone index d5271aaf8d..57e1b78b8a 100755 --- a/src/tm_mad/qcow2/clone +++ b/src/tm_mad/qcow2/clone @@ -41,13 +41,17 @@ fi #------------------------------------------------------------------------------- # Set dst path and dir #------------------------------------------------------------------------------- -SRC_PATH=`arg_path $SRC` -SRC_PATH="../../${SRC_PATH##"$DS_DIR/"}" - DST_PATH=`arg_path $DST` DST_HOST=`arg_host $DST` DST_DIR=`dirname $DST_PATH` +SRC_ARG_PATH=`arg_path $SRC` + +DST_DS_PATH="$(dirname $(dirname $(dirname $DST_PATH)))" +SRC_DS_PATH="$(dirname $(dirname $SRC_ARG_PATH))" + +SRC_PATH="${DST_DS_PATH}${SRC_ARG_PATH##$SRC_DS_PATH}" + ssh_make_path $DST_HOST $DST_DIR #------------------------------------------------------------------------------- diff --git a/src/tm_mad/qcow2/mvds b/src/tm_mad/qcow2/mvds index dabec292c9..f32d9c8f60 100755 --- a/src/tm_mad/qcow2/mvds +++ b/src/tm_mad/qcow2/mvds @@ -44,11 +44,15 @@ set_ds_location # Set dst path and dir #------------------------------------------------------------------------------- SRC_PATH=`arg_path $SRC` -DST_PATH=`arg_path $DST` - -DST_PATH="$RMT_DS_DIR/${DST_PATH##"$DS_DIR/"}" - SRC_HOST=`arg_host $SRC` +SRC_DIR=`dirname $SRC_PATH` + +DST_ARG_PATH=`arg_path $DST` + +SRC_DS_PATH="$(dirname $(dirname $(dirname $SRC_PATH)))" +DST_DS_PATH="$(dirname $(dirname $DST_ARG_PATH))" + +DST_PATH="${SRC_DS_PATH}${DST_ARG_PATH##$DST_DS_PATH}" #------------------------------------------------------------------------------- # Move the image back to the datastore diff --git a/src/tm_mad/shared/clone b/src/tm_mad/shared/clone index 9888811512..cbe500e0a4 100755 --- a/src/tm_mad/shared/clone +++ b/src/tm_mad/shared/clone @@ -41,13 +41,17 @@ fi #------------------------------------------------------------------------------- # Set dst path and dir #------------------------------------------------------------------------------- -SRC_PATH=`arg_path $SRC` -SRC_PATH="../../${SRC_PATH##"$DS_DIR/"}" - DST_PATH=`arg_path $DST` DST_HOST=`arg_host $DST` DST_DIR=`dirname $DST_PATH` +SRC_ARG_PATH=`arg_path $SRC` + +DST_DS_PATH="$(dirname $(dirname $(dirname $DST_PATH)))" +SRC_DS_PATH="$(dirname $(dirname $SRC_ARG_PATH))" + +SRC_PATH="${DST_DS_PATH}${SRC_ARG_PATH##$SRC_DS_PATH}" + ssh_make_path $DST_HOST $DST_DIR #------------------------------------------------------------------------------- diff --git a/src/tm_mad/shared/ln b/src/tm_mad/shared/ln index 19aa46786c..c323ffdd24 100755 --- a/src/tm_mad/shared/ln +++ b/src/tm_mad/shared/ln @@ -41,46 +41,43 @@ fi #------------------------------------------------------------------------------- # Set dst path and dir #------------------------------------------------------------------------------- -SRC_PATH=`arg_path $SRC` -SRC_PATH="../../${SRC_PATH##"$DS_DIR/"}" - DST_PATH=`arg_path $DST` DST_HOST=`arg_host $DST` DST_DIR=`dirname $DST_PATH` +SRC_ARG_PATH=`arg_path $SRC` + +DST_DS_PATH="$(dirname $(dirname $(dirname $DST_PATH)))" +SRC_DS_PATH="$(dirname $(dirname $SRC_ARG_PATH))" + +SRC_PATH="${DST_DS_PATH}${SRC_ARG_PATH##$SRC_DS_PATH}" + #------------------------------------------------------------------------------- # Link (ln) SRC into DST #------------------------------------------------------------------------------- # Is it a file or a folder (VMware)? if [ -d `arg_path $SRC` ]; then - ssh_make_path $DST_HOST $DST_PATH + ssh_make_path $DST_HOST $DST_PATH - # It's a folder, make links for all elements - SRC_FOLDER_NAME=`basename $SRC_PATH` - SRC_WITH_NO_FOLDER=`dirname $SRC_PATH` - SRC_DS_NAME=`basename $SRC_WITH_NO_FOLDER` - REL_SRC_PATH="../../../$SRC_DS_NAME/$SRC_FOLDER_NAME" - - log "Link all files in $SRC_PATH to $DST_PATH" + log "Link all files in $SRC_PATH to $DST_PATH" LINK_SCRIPT=$(cat < Date: Tue, 2 Oct 2012 13:32:51 +0200 Subject: [PATCH 04/22] bug #1498: Add ssl_verify_peer option to econe-upload --- src/cloud/ec2/bin/econe-upload | 3 +-- src/cloud/ec2/lib/EC2QueryClient.rb | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloud/ec2/bin/econe-upload b/src/cloud/ec2/bin/econe-upload index 76606d4f78..e2551a836f 100755 --- a/src/cloud/ec2/bin/econe-upload +++ b/src/cloud/ec2/bin/econe-upload @@ -56,8 +56,7 @@ EOT EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL, - USER_DATA, - TYPE + MULTIPART ] main :file do diff --git a/src/cloud/ec2/lib/EC2QueryClient.rb b/src/cloud/ec2/lib/EC2QueryClient.rb index 8fe2383e24..dcc53bda24 100644 --- a/src/cloud/ec2/lib/EC2QueryClient.rb +++ b/src/cloud/ec2/lib/EC2QueryClient.rb @@ -252,6 +252,7 @@ module EC2QueryClient connection = Curl::Easy.new(@uri.to_s) connection.multipart_form_post = true + connection.ssl_verify_peer = false connection.http_post(*post_fields) From 957eef49ac3000ea109a5fd6af0689c98ebb4d41 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 2 Oct 2012 13:42:40 +0200 Subject: [PATCH 05/22] feature #1383: Remove \n from public key blob --- src/cloud/ec2/lib/keypair.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/ec2/lib/keypair.rb b/src/cloud/ec2/lib/keypair.rb index fb438c6288..77ba2a29bf 100644 --- a/src/cloud/ec2/lib/keypair.rb +++ b/src/cloud/ec2/lib/keypair.rb @@ -93,7 +93,7 @@ module Keypair erb_ssh_public_key = erb_public_key.ssh_type << " " << - [ erb_public_key.to_blob ].pack('m0') << + [ erb_public_key.to_blob ].pack('m0').gsub(/\n/, '') << " " << erb_keyname kp[erb_keyname] = { From be46ef1a50cc38571bb8abbee6f0818c0b48fdcd Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 2 Oct 2012 13:52:51 +0200 Subject: [PATCH 06/22] Change default column size in econe-describe-keypairs --- src/cloud/ec2/bin/econe-describe-keypairs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/ec2/bin/econe-describe-keypairs b/src/cloud/ec2/bin/econe-describe-keypairs index f0e7b047be..47388cf428 100755 --- a/src/cloud/ec2/bin/econe-describe-keypairs +++ b/src/cloud/ec2/bin/econe-describe-keypairs @@ -37,7 +37,7 @@ TABLE = CLIHelper::ShowTable.new(nil, self) do d["keyName"] end - column :keyFingerprint, "keyFingerprint", :left, :size=>65 do |d| + column :keyFingerprint, "keyFingerprint", :left, :size=>60 do |d| d["keyFingerprint"] end From cf45afe0a77d5a03d6001427165899913b6c32e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 2 Oct 2012 16:25:57 +0200 Subject: [PATCH 07/22] Feature #1108: Add more verbosity to Request Manager log messages: * Each request message includes a unique (ish) ID, and user doing the request * Success results are also logged * All arguments are included in the request message (except session) * Password arguments are shown as *** --- include/Request.h | 42 ++++++++ include/RequestManagerAllocate.h | 5 + include/RequestManagerUser.h | 10 ++ src/rm/Request.cc | 162 +++++++++++++++++++++++++++++-- src/rm/RequestManagerAllocate.cc | 17 ++++ src/rm/RequestManagerUser.cc | 34 +++++++ 6 files changed, 261 insertions(+), 9 deletions(-) diff --git a/include/Request.h b/include/Request.h index 07129634ee..ea73ae2f58 100644 --- a/include/Request.h +++ b/include/Request.h @@ -74,6 +74,7 @@ protected: string gname; /**< name of the user's group */ string session; /**< Session from ONE XML-RPC API */ + int req_id; /**< Request ID for log messages */ xmlrpc_c::value * retval; /**< Return value from libxmlrpc-c */ @@ -311,6 +312,47 @@ protected: RequestAttributes& att, PoolObjectAuth& perms, string& name); + + /** + * Logs the method invocation, including the arguments + * + * @param att the specific request attributes + * @param paramList list of XML parameters + */ + virtual void log_method_invoked( + const RequestAttributes& att, + const xmlrpc_c::paramList& paramList); + + /** + * Logs the method result, including the output data or error message + * + * @param att the specific request attributes + */ + virtual void log_result( + const RequestAttributes& att); + + /** + * Formats and adds a xmlrpc_c::value input parameter to oss. + * + * @param v value to format + * @param oss stream to write v + * @param index parameter index + */ + virtual void log_xmlrpc_param( + const xmlrpc_c::value& v, + ostringstream& oss, + const int& index); + + /** + * Formats and adds a xmlrpc_c::value to oss. + * + * @param v value to format + * @param oss stream to write v + */ + virtual void log_xmlrpc_value( + const xmlrpc_c::value& v, + ostringstream& oss); + private: /* ------------- Functions to manage user and group quotas -------------- */ diff --git a/include/RequestManagerAllocate.h b/include/RequestManagerAllocate.h index d6683448bc..4957ded508 100644 --- a/include/RequestManagerAllocate.h +++ b/include/RequestManagerAllocate.h @@ -304,6 +304,11 @@ public: int& id, string& error_str, RequestAttributes& att); + + void log_xmlrpc_param( + const xmlrpc_c::value& v, + ostringstream& oss, + const int& index); }; /* ------------------------------------------------------------------------- */ diff --git a/include/RequestManagerUser.h b/include/RequestManagerUser.h index e65d914b67..4f95682fd3 100644 --- a/include/RequestManagerUser.h +++ b/include/RequestManagerUser.h @@ -74,6 +74,11 @@ public: int user_action(int user_id, xmlrpc_c::paramList const& _paramList, string& err); + + void log_xmlrpc_param( + const xmlrpc_c::value& v, + ostringstream& oss, + const int& index); }; /* ------------------------------------------------------------------------- */ @@ -95,6 +100,11 @@ public: int user_action(int user_id, xmlrpc_c::paramList const& _paramList, string& err); + + void log_xmlrpc_param( + const xmlrpc_c::value& v, + ostringstream& oss, + const int& index); }; /* ------------------------------------------------------------------------- */ diff --git a/src/rm/Request.cc b/src/rm/Request.cc index 0a9f4d3450..21bc34ed39 100644 --- a/src/rm/Request.cc +++ b/src/rm/Request.cc @@ -19,7 +19,6 @@ #include "PoolObjectAuth.h" - /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -31,17 +30,20 @@ void Request::execute( att.retval = _retval; att.session = xmlrpc_c::value_string (_paramList.getString(0)); + att.req_id = rand() % 1000; Nebula& nd = Nebula::instance(); UserPool* upool = nd.get_upool(); - NebulaLog::log("ReM",Log::DEBUG, method_name + " method invoked"); + bool authenticated = upool->authenticate( att.session, + att.uid, + att.gid, + att.uname, + att.gname); - if ( upool->authenticate(att.session, - att.uid, - att.gid, - att.uname, - att.gname) == false ) + log_method_invoked(att, _paramList); + + if ( authenticated == false ) { failure_response(AUTHENTICATION, authenticate_error(), att); } @@ -49,11 +51,155 @@ void Request::execute( { request_execute(_paramList, att); } + + log_result(att); }; /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ +void Request::log_method_invoked( + const RequestAttributes& att, + const xmlrpc_c::paramList& paramList) +{ + ostringstream oss; + + oss << "[" << att.req_id << "] "; + + if ( att.uid != -1 ) + { + oss << "[" << att.uid << " " << att.uname << "] "; + } + else + { + oss << "[- -] "; + } + + oss << "[" << method_name << "] method invoked"; + + for (unsigned int i=1; i const vvalue(array1.vectorValueValue()); + + if ( static_cast(xmlrpc_c::value_boolean(vvalue[0])) ) + { + oss << "SUCCESS"; + + for (unsigned int i=1; i(xmlrpc_c::value_string(vvalue[1])); + + NebulaLog::log("ReM",Log::ERROR, oss); + } +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void Request::log_xmlrpc_param( + const xmlrpc_c::value& v, + ostringstream& oss, + const int& index) +{ + log_xmlrpc_value(v, oss); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void Request::log_xmlrpc_value( + const xmlrpc_c::value& v, + ostringstream& oss) +{ + size_t st_limit = 20; + size_t st_newline; + + switch (v.type()) + { + case xmlrpc_c::value::TYPE_INT: + oss << ", " << static_cast(xmlrpc_c::value_int(v)); + break; + case xmlrpc_c::value::TYPE_BOOLEAN: + oss << ", "; + + if ( static_cast(xmlrpc_c::value_boolean(v)) ) + { + oss << "true"; + } + else + { + oss << "false"; + } + + break; + case xmlrpc_c::value::TYPE_STRING: + st_newline = + static_cast(xmlrpc_c::value_string(v)).find("\n"); + + if ( st_newline < st_limit ) + { + st_limit = st_newline; + } + + oss << ", \"" << + static_cast(xmlrpc_c::value_string(v)).substr(0,st_limit); + + if ( static_cast(xmlrpc_c::value_string(v)).size() > st_limit ) + { + oss << "..."; + } + + oss << "\""; + break; + case xmlrpc_c::value::TYPE_DOUBLE: + oss << ", " + << static_cast(xmlrpc_c::value_double(v)); + break; + default: + oss << ", unknown param type"; + break; + } +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + bool Request::basic_authorization(int oid, AuthRequest::Operation op, RequestAttributes& att) @@ -338,8 +484,6 @@ void Request::failure_response(ErrorCode ec, const string& str_val, xmlrpc_c::value_array arrayresult(arrayData); *(att.retval) = arrayresult; - - NebulaLog::log("ReM",Log::ERROR,str_val); } /* -------------------------------------------------------------------------- */ diff --git a/src/rm/RequestManagerAllocate.cc b/src/rm/RequestManagerAllocate.cc index 2da96e857b..e376487176 100644 --- a/src/rm/RequestManagerAllocate.cc +++ b/src/rm/RequestManagerAllocate.cc @@ -546,6 +546,23 @@ int UserAllocate::pool_allocate(xmlrpc_c::paramList const& paramList, return upool->allocate(&id,ugid,uname,ugname,passwd,driver,true,error_str); } +/* -------------------------------------------------------------------------- */ + +void UserAllocate::log_xmlrpc_param( + const xmlrpc_c::value& v, + ostringstream& oss, + const int& index) +{ + if ( index == 2 ) // password argument + { + oss << ", ****"; + } + else + { + Request::log_xmlrpc_param(v, oss, index); + } +} + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ diff --git a/src/rm/RequestManagerUser.cc b/src/rm/RequestManagerUser.cc index 2af6c7d61d..9e9da50eaa 100644 --- a/src/rm/RequestManagerUser.cc +++ b/src/rm/RequestManagerUser.cc @@ -86,6 +86,23 @@ int UserChangePassword::user_action(int user_id, return rc; } +/* -------------------------------------------------------------------------- */ + +void UserChangePassword::log_xmlrpc_param( + const xmlrpc_c::value& v, + ostringstream& oss, + const int& index) +{ + if ( index == 2 ) // password argument + { + oss << ", ****"; + } + else + { + Request::log_xmlrpc_param(v, oss, index); + } +} + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -133,6 +150,23 @@ int UserChangeAuth::user_action(int user_id, return rc; } +/* -------------------------------------------------------------------------- */ + +void UserChangeAuth::log_xmlrpc_param( + const xmlrpc_c::value& v, + ostringstream& oss, + const int& index) +{ + if ( index == 3 ) // password argument + { + oss << ", ****"; + } + else + { + Request::log_xmlrpc_param(v, oss, index); + } +} + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ From 99ff7b267b63377aae784b6f92f5d28166b64b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 2 Oct 2012 16:46:13 +0200 Subject: [PATCH 08/22] Feature #1522: Add default rule '* DOCUMENT/* CREATE' --- src/acl/AclManager.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/acl/AclManager.cc b/src/acl/AclManager.cc index 5075767fa0..8e80e4dba7 100644 --- a/src/acl/AclManager.cc +++ b/src/acl/AclManager.cc @@ -87,6 +87,13 @@ AclManager::AclManager(SqlDB * _db) : db(_db), lastOID(-1) PoolObjectSQL::HOST, AuthRequest::MANAGE, error_str); + + add_rule(AclRule::ALL_ID, + AclRule::ALL_ID | + PoolObjectSQL::DOCUMENT, + AuthRequest::CREATE, + error_str); + } } From f0ef542c75bcfe8e10c39faa6990632f727ee723 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 2 Oct 2012 18:16:09 +0200 Subject: [PATCH 09/22] feature #1190: Update econe CLI to use the new DSL --- src/cloud/ec2/bin/econe-attach-volume | 166 +++++++------------- src/cloud/ec2/bin/econe-create-volume | 138 +++++----------- src/cloud/ec2/bin/econe-delete-volume | 119 ++++---------- src/cloud/ec2/bin/econe-describe-volumes | 160 ++++++++----------- src/cloud/ec2/bin/econe-detach-volume | 95 +++++++++++ src/cloud/ec2/bin/econe-reboot-instances | 121 +++++--------- src/cloud/ec2/bin/econe-release-address | 7 +- src/cloud/ec2/bin/econe-start-instances | 124 +++++---------- src/cloud/ec2/bin/econe-stop-instances | 124 +++++---------- src/cloud/ec2/bin/econe-terminate-instances | 10 +- src/cloud/ec2/lib/instance.rb | 4 + 11 files changed, 410 insertions(+), 658 deletions(-) diff --git a/src/cloud/ec2/bin/econe-attach-volume b/src/cloud/ec2/bin/econe-attach-volume index 14d25ba5f5..fba6fa2ea2 100755 --- a/src/cloud/ec2/bin/econe-attach-volume +++ b/src/cloud/ec2/bin/econe-attach-volume @@ -23,125 +23,71 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end - $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" -COMMANDS_HELP=<<-EOT -econe-attach-volume - -Attaches a DATABLOCK to a running instance and exposes it as the specified device. - -Usage: - econe-attach-volume [OPTIONS] VOLUME-ID - -Options: - - --help, -h - Show help - - --access-key , -K - The username of the user - - --secret-key , -S - The password of the user - - --url , -U - Set url as the web service url to use - - --instance , -i - The ID of the instance to attach the volume to - - --device , -d "instance_id", + :short => "-i instance_id", + :large => "--instance instance_id", + :description => "The ID of the instance to attach the volume to", + :format => String +} -headers = false -url = nil -access = nil -secret = nil -instance = nil -device = nil +DEVICE = { + :name => "device", + :short => "-d device", + :large => "--device device", + :description => "Specifies the device name to expose to the instance." << + " Example: -d /dev/sdf", + :format => String +} -begin - opts.each do |opt, arg| - case opt - when '--help' - puts COMMANDS_HELP - return - when '--version' - puts CloudCLI.version_text - exit 0 - when '--access-key' - access = arg - when '--secret-key' - secret = arg - when '--url' - url = arg - when '--instance' - instance = arg - when '--headers' - headers = true - when '--device' - device = arg +CommandParser::CmdParser.new(ARGV) do + usage "econe-attach-volume [OPTIONS] VOLUME-ID" + version CloudCLI.version_text + description <<-EOT +Attaches a DATABLOCK to a running instance and exposes it as the specified device. +VOLUME-ID: The ID of the DATABLOCK +EOT + + option [ + CommandParser::VERBOSE, + CommandParser::HELP, + EC2QueryClient::ACCESS_KEY, + EC2QueryClient::SECRET_KEY, + EC2QueryClient::URL, + INSTANCE, + DEVICE + ] + + main :volume_id do + begin + ec2_client = EC2QueryClient::Client.new( + options[:access_key], + options[:secret_key], + options[:url]) + rescue Exception => e + exit_with_code -1, "#{cmd_name}: #{e.message}" + end + + rc = ec2_client.attach_volume(args[0], options[:instance_id], options[:device]) + + if CloudClient::is_error?(rc) + exit_with_code -1, "#{cmd_name}: #{rc.message}" + else + puts "volumeId: #{rc['volumeId']}" + puts "instanceId: #{rc['instanceId']}" + puts "status: #{rc['status']}" + puts "device: #{rc['device']}" + exit_with_code 0 end end -rescue Exception => e - exit -1 -end - -volume_id = ARGV.shift - -if !volume_id - puts "#{cmd_name}: missing VOLUME-ID parameter" - exit -1 -end - -begin - ec2_client = EC2QueryClient::Client.new(access, secret, url) -rescue Exception => e - puts "#{cmd_name}: #{e.message}" - exit -1 -end - -rc = ec2_client.attach_volume(volume_id, instance, device) - -if CloudClient::is_error?(rc) - puts "#{cmd_name}: #{rc.message}" - exit -1 -end - -fmt = "%-15s %-15s %-10s %s" - -if headers - puts fmt % ["volumeId", "instanceId", "status", "device"] - puts "------------------------------------------------------------------------------" -end - -puts fmt % [rc['volumeId'], rc['instanceId'], rc['status'], rc['device']] - -exit 0 +end \ No newline at end of file diff --git a/src/cloud/ec2/bin/econe-create-volume b/src/cloud/ec2/bin/econe-create-volume index ca542f77aa..70ac476a15 100755 --- a/src/cloud/ec2/bin/econe-create-volume +++ b/src/cloud/ec2/bin/econe-create-volume @@ -23,113 +23,57 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end - $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" -COMMANDS_HELP=<<-EOT -econe-create-volume - -Create a new DATABLOCK - -Usage: - econe-create-volume [OPTIONS] - -Options: - - --help, -h - Show help - - --access-key , -K - The username of the user - - --secret-key , -S - The password of the user - - --url , -U - Set url as the web service url to use - - --size , -s - The ID of the instance to attach the volume to - - --headers, -H - Display column headers - -EOT +require 'cli/command_parser' +require 'cli/cli_helper' require 'econe/EC2QueryClient' -require 'CloudClient' -require 'getoptlong' include CloudCLI -opts = GetoptLong.new( - ['--help', '-h',GetoptLong::NO_ARGUMENT], - ['--version', '-v',GetoptLong::NO_ARGUMENT], - ['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT], - ['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT], - ['--url', '-U',GetoptLong::REQUIRED_ARGUMENT], - ['--size', '-s',GetoptLong::REQUIRED_ARGUMENT], - ['--headers', '-H',GetoptLong::NO_ARGUMENT] - ) +SIZE = { + :name => "size", + :short => "-s size", + :large => "--size size", + :description => "The size of the volume, in GiBs.", + :format => String +} -headers = false -url = nil -access = nil -secret = nil -size = nil +CommandParser::CmdParser.new(ARGV) do + usage "econe-create-volume [OPTIONS]" + version CloudCLI.version_text + description "Create a new VOLUME" -begin - opts.each do |opt, arg| - case opt - when '--help' - puts COMMANDS_HELP - return - when '--version' - puts CloudCLI.version_text - exit 0 - when '--access-key' - access = arg - when '--secret-key' - secret = arg - when '--url' - url = arg - when '--size' - size = arg - when '--headers' - headers = true + option [ + CommandParser::VERBOSE, + CommandParser::HELP, + EC2QueryClient::ACCESS_KEY, + EC2QueryClient::SECRET_KEY, + EC2QueryClient::URL, + SIZE + ] + + main :volume_id do + begin + ec2_client = EC2QueryClient::Client.new( + options[:access_key], + options[:secret_key], + options[:url]) + rescue Exception => e + exit_with_code -1, "#{cmd_name}: #{e.message}" + end + + rc = ec2_client.create_volume(options[:size]) + + if CloudClient::is_error?(rc) + exit_with_code -1, "#{cmd_name}: #{rc.message}" + else + puts "volumeId: #{rc['volumeId']}" + puts "size: #{rc['size']}" + puts "createTime: #{rc['createTime']}" + exit_with_code 0 end end -rescue Exception => e - exit -1 end - -if !size - puts "#{cmd_name}: missing --size option" - exit -1 -end - -begin - ec2_client = EC2QueryClient::Client.new(access, secret, url) -rescue Exception => e - puts "#{cmd_name}: #{e.message}" - exit -1 -end - -rc = ec2_client.create_volume(size) - -if CloudClient::is_error?(rc) - puts "#{cmd_name}: #{rc.message}" - exit -1 -end - -fmt = "%-15s %-10s %s" - -if headers - puts fmt % ["volumeId", "size", "createTime"] - puts "------------------------------------------------------------------------------" -end - -puts fmt % [rc['volumeId'], rc['size'], rc['createTime']] - -exit 0 diff --git a/src/cloud/ec2/bin/econe-delete-volume b/src/cloud/ec2/bin/econe-delete-volume index 4a143a82d5..473bf2aedc 100755 --- a/src/cloud/ec2/bin/econe-delete-volume +++ b/src/cloud/ec2/bin/econe-delete-volume @@ -23,101 +23,48 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end - $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" -COMMANDS_HELP=<<-EOT -econe-delete-volume - -Deletes a DATABLOCK - -Usage: - econe-delete-volume [OPTIONS] VOLUME-ID - -Options: - - --help, -h - Show help - - --access-key , -K - The username of the user - - --secret-key , -S - The password of the user - - --url , -U - Set url as the web service url to use - - --headers, -H - Display column headers - -VOLUME-ID: The ID of the DATABLOCK - -EOT +require 'cli/command_parser' +require 'cli/cli_helper' require 'econe/EC2QueryClient' -require 'CloudClient' -require 'getoptlong' include CloudCLI -opts = GetoptLong.new( - ['--help', '-h',GetoptLong::NO_ARGUMENT], - ['--version', '-v',GetoptLong::NO_ARGUMENT], - ['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT], - ['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT], - ['--url', '-U',GetoptLong::REQUIRED_ARGUMENT], - ['--headers', '-H',GetoptLong::NO_ARGUMENT] - ) +CommandParser::CmdParser.new(ARGV) do + usage "econe-delete-volume [OPTIONS] VOLUME-ID" + version CloudCLI.version_text + description <<-EOT +Deletes the targe VOLUME +VOLUME-ID: The ID of the DATABLOCK +EOT -headers = false -url = nil -access = nil -secret = nil + option [ + CommandParser::VERBOSE, + CommandParser::HELP, + EC2QueryClient::ACCESS_KEY, + EC2QueryClient::SECRET_KEY, + EC2QueryClient::URL + ] -begin - opts.each do |opt, arg| - case opt - when '--help' - puts COMMANDS_HELP - return - when '--version' - puts CloudCLI.version_text - exit 0 - when '--access-key' - access = arg - when '--secret-key' - secret = arg - when '--url' - url = arg - when '--headers' - headers = true + main :volume_id do + begin + ec2_client = EC2QueryClient::Client.new( + options[:access_key], + options[:secret_key], + options[:url]) + rescue Exception => e + exit_with_code -1, "#{cmd_name}: #{e.message}" + end + + rc = ec2_client.delete_volume(args[0]) + + if CloudClient::is_error?(rc) + exit_with_code -1, "#{cmd_name}: #{rc.message}" + else + exit_with_code 0 end end -rescue Exception => e - exit -1 -end - -volume_id = ARGV.shift - -if !volume_id - puts "#{cmd_name}: missing VOLUME-ID parameter" - exit -1 -end - -begin - ec2_client = EC2QueryClient::Client.new(access, secret, url) -rescue Exception => e - puts "#{cmd_name}: #{e.message}" - exit -1 -end - -rc = ec2_client.delete_volume(volume_id) - -if CloudClient::is_error?(rc) - puts "#{cmd_name}: #{rc.message}" - exit -1 -end - -exit 0 +end \ No newline at end of file diff --git a/src/cloud/ec2/bin/econe-describe-volumes b/src/cloud/ec2/bin/econe-describe-volumes index 895f2283c4..c7bbd338d8 100755 --- a/src/cloud/ec2/bin/econe-describe-volumes +++ b/src/cloud/ec2/bin/econe-describe-volumes @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # # limitations under the License. # #--------------------------------------------------------------------------- # - ONE_LOCATION=ENV["ONE_LOCATION"] if !ONE_LOCATION @@ -23,116 +22,85 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end - $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" -COMMANDS_HELP=<<-EOT -econe-describe-volumes - -Describes your Amazon EBS volumes - -Usage: - econe-describe-volumes [OPTIONS] - -Options: - --help, -h - Show help - - --access-key , -K - The username of the user - - --secret-key , -S - The password of the user - - --url , -U - Set url as the web service url to use - - --headers, -H - Display column headers - -EOT +require 'cli/command_parser' +require 'cli/cli_helper' require 'econe/EC2QueryClient' -require 'CloudClient' -require 'getoptlong' include CloudCLI +TABLE = CLIHelper::ShowTable.new(nil, self) do + column :volumeId, "volumeId", :size=>12 do |d| + d["volumeId"] + end -opts = GetoptLong.new( - ['--help', '-h',GetoptLong::NO_ARGUMENT], - ['--version', '-v',GetoptLong::NO_ARGUMENT], - ['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT], - ['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT], - ['--url', '-U',GetoptLong::REQUIRED_ARGUMENT], - ['--headers', '-H',GetoptLong::NO_ARGUMENT] - ) + column :size, "size", :size=>6 do |d| + d["size"] + end -headers = false -url = nil -access = nil -secret = nil + column :status, "status", :size=>10 do |d| + d["status"] + end -begin - opts.each do |opt, arg| - case opt - when '--help' - puts COMMANDS_HELP - return - when '--version' - puts CloudCLI.version_text - exit 0 - when '--access-key' - access = arg - when '--secret-key' - secret = arg - when '--url' - url = arg - when '--headers' - headers = true + column :createTime, "createTime", :size=>28 do |d| + d['createTime'] + end + + column :instanceId, "instanceId", :size=>12 do |d| + if d['attachmentSet'] && d['attachmentSet']['item'] + d['attachmentSet']['item'][0]['instanceId'] end end -rescue Exception => e - exit -1 -end -begin - ec2_client = EC2QueryClient::Client.new(access, secret, url) -rescue Exception => e - puts "#{cmd_name}: #{e.message}" - exit -1 -end - -rc = ec2_client.describe_volumes - -if CloudClient::is_error?(rc) - puts "#{cmd_name}: #{rc.message}" - exit -1 -end - -volumes = [] -if rc['volumeSet'] - volumes = rc['volumeSet']['item'] -end - -fmt = "%-15s %-10s %s" - -if headers - puts fmt % ["volumeId", "size", "instanceId"] - puts "------------------------------------------------------------------------------" -end - -volumes.each { |vol| - instances = "" - if vol['attachmentSet'] && vol['attachmentSet']['item'] - instances = vol['attachmentSet']['item'].collect{ |item| - item['instanceId'] - }.join(',') + column :device, "device", :size=>8 do |d| + if d['attachmentSet'] && d['attachmentSet']['item'] + d['attachmentSet']['item'][0]['device'] + end end - puts fmt % [vol['volumeId'], vol['size'], instances] -} + default :volumeId, :size, :status, :createTime, :instanceId, :device +end -exit 0 +CommandParser::CmdParser.new(ARGV) do + usage "econe-describe-volumes [OPTIONS]" + version CloudCLI.version_text + description "List and describe volumes" + + option [ + CommandParser::VERBOSE, + CommandParser::HELP, + EC2QueryClient::ACCESS_KEY, + EC2QueryClient::SECRET_KEY, + EC2QueryClient::URL + ] + + main do + begin + ec2_client = EC2QueryClient::Client.new( + options[:access_key], + options[:secret_key], + options[:url]) + rescue Exception => e + exit_with_code -1, "#{cmd_name}: #{e.message}" + end + + rc = ec2_client.describe_volumes + + if CloudClient::is_error?(rc) + exit_with_code -1, "#{cmd_name}: #{rc.message}" + else + if rc.empty? || rc['volumeSet'].nil? || rc['volumeSet']['item'].nil? + vols = [] + else + vols = rc['volumeSet']['item'] + end + + TABLE.show(vols) + exit_with_code 0 + end + end +end diff --git a/src/cloud/ec2/bin/econe-detach-volume b/src/cloud/ec2/bin/econe-detach-volume index 85699eb909..c65240d2ec 100755 --- a/src/cloud/ec2/bin/econe-detach-volume +++ b/src/cloud/ec2/bin/econe-detach-volume @@ -146,3 +146,98 @@ end puts fmt % [rc['volumeId'], rc['instanceId'], rc['status'], rc['device']] exit 0 + +#!/usr/bin/env ruby +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +ONE_LOCATION=ENV["ONE_LOCATION"] + +if !ONE_LOCATION + RUBY_LIB_LOCATION="/usr/lib/one/ruby" +else + RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" +end + +$: << RUBY_LIB_LOCATION +$: << RUBY_LIB_LOCATION+"/cloud" + + +require 'cli/command_parser' +require 'cli/cli_helper' +require 'econe/EC2QueryClient' + +include CloudCLI + +INSTANCE = { + :name => "instance_id", + :short => "-i instance_id", + :large => "--instance instance_id", + :description => "The ID of the instance to attach the volume to", + :format => String +} + +DEVICE = { + :name => "device", + :short => "-d device", + :large => "--device device", + :description => "Specifies the device name to expose to the instance." << + " Example: -d /dev/sdf", + :format => String +} + +CommandParser::CmdParser.new(ARGV) do + usage "econe-detach-volume [OPTIONS] VOLUME-ID" + version CloudCLI.version_text + description <<-EOT +Detaches a volume from an instance. Make sure to unmount any file systems +on the device within your operating system before detaching the volume +VOLUME-ID: The ID of the DATABLOCK +EOT + + option [ + CommandParser::VERBOSE, + CommandParser::HELP, + EC2QueryClient::ACCESS_KEY, + EC2QueryClient::SECRET_KEY, + EC2QueryClient::URL, + INSTANCE, + DEVICE + ] + + main :volume_id do + begin + ec2_client = EC2QueryClient::Client.new( + options[:access_key], + options[:secret_key], + options[:url]) + rescue Exception => e + exit_with_code -1, "#{cmd_name}: #{e.message}" + end + + rc = ec2_client.detach_volume(args[0], options[:instance_id], options[:device]) + + if CloudClient::is_error?(rc) + exit_with_code -1, "#{cmd_name}: #{rc.message}" + else + puts "volumeId: #{rc['volumeId']}" + puts "instanceId: #{rc['instanceId']}" + puts "status: #{rc['status']}" + puts "device: #{rc['device']}" + exit_with_code 0 + end + end +end diff --git a/src/cloud/ec2/bin/econe-reboot-instances b/src/cloud/ec2/bin/econe-reboot-instances index d6ee877979..590dccb301 100755 --- a/src/cloud/ec2/bin/econe-reboot-instances +++ b/src/cloud/ec2/bin/econe-reboot-instances @@ -23,100 +23,51 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end - $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" -COMMANDS_HELP=<<-EOT -econe-reboot-instances - -reboot the selected running instance - -Usage: - econe-register [OPTIONS] INSTANCE-ID - -Options: - - --help, -h - Show help - - --access-key , -K - The username of the user - - --secret-key , -S - The password of the user - - --url , -U - Set url as the web service url to use - -INSTANCE-ID: The instance identification as returned by -the econe-run-instances command - -EOT +require 'cli/command_parser' +require 'cli/cli_helper' require 'econe/EC2QueryClient' -require 'CloudClient' -require 'getoptlong' include CloudCLI -opts = GetoptLong.new( - ['--help', '-h',GetoptLong::NO_ARGUMENT], - ['--version', '-v',GetoptLong::NO_ARGUMENT], - ['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT], - ['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT], - ['--url', '-U',GetoptLong::REQUIRED_ARGUMENT] - ) -url = nil -access = nil -secret = nil +CommandParser::CmdParser.new(ARGV) do + usage "econe-reboot-instances [OPTIONS] INSTANCE-ID" + version CloudCLI.version_text + description <<-EOT +Reboot the selected running instance +INSTANCE-ID: The instance identification as returned by the econe-run-instances command +EOT -begin - opts.each do |opt, arg| - case opt - when '--help' - puts COMMANDS_HELP - return - when '--version' - puts CloudCLI.version_text - exit 0 - when '--access-key' - access = arg - when '--secret-key' - secret = arg - when '--url' - url = arg - when '--headers' - headers = true + option [ + CommandParser::VERBOSE, + CommandParser::HELP, + EC2QueryClient::ACCESS_KEY, + EC2QueryClient::SECRET_KEY, + EC2QueryClient::URL + ] + + main :instance_id do + begin + ec2_client = EC2QueryClient::Client.new( + options[:access_key], + options[:secret_key], + options[:url]) + rescue Exception => e + puts "#{cmd_name}: #{e.message}" + exit -1 + end + + rc = ec2_client.reboot_instances(args[0]) + + if CloudClient::is_error?(rc) + exit_with_code -1, "#{cmd_name}: #{rc.message}" + else + puts "Success: Rebooting" + exit_with_code 0 end end -rescue Exception => e - exit -1 -end - -instance = ARGV.shift - -if !instance - puts "#{cmd_name}: missing INSTANCE-ID parameter" - exit -1 -end - -begin - ec2_client = EC2QueryClient::Client.new(access, secret, url) -rescue Exception => e - puts "#{cmd_name}: #{e.message}" - exit -1 -end - -rc = ec2_client.reboot_instances(instance) - -if CloudClient::is_error?(rc) - puts "#{cmd_name}: #{rc.message}" - exit -1 -end - - -puts "Success: Reboting" - -exit 0 +end \ No newline at end of file diff --git a/src/cloud/ec2/bin/econe-release-address b/src/cloud/ec2/bin/econe-release-address index f03fb8d689..d1977471ed 100755 --- a/src/cloud/ec2/bin/econe-release-address +++ b/src/cloud/ec2/bin/econe-release-address @@ -66,12 +66,7 @@ EOT [-1, "#{cmd_name}: #{rc.message}"] else exit_code 0 - - if options[:headers] - CLIHelper.print_header("publicIP") - end - - puts rc['publicIP'] + puts "publicIP: #{rc['publicIP']}" end end end diff --git a/src/cloud/ec2/bin/econe-start-instances b/src/cloud/ec2/bin/econe-start-instances index b9fd0a6062..95386a4818 100755 --- a/src/cloud/ec2/bin/econe-start-instances +++ b/src/cloud/ec2/bin/econe-start-instances @@ -23,101 +23,53 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end - $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" -COMMANDS_HELP=<<-EOT -econe-start-instances - -Start the selected running instance - -Usage: - econe-register [OPTIONS] INSTANCE-ID - -Options: - - --help, -h - Show help - - --access-key , -K - The username of the user - - --secret-key , -S - The password of the user - - --url , -U - Set url as the web service url to use - -INSTANCE-ID: The instance identification as returned by -the econe-run-instances command - -EOT +require 'cli/command_parser' +require 'cli/cli_helper' require 'econe/EC2QueryClient' -require 'CloudClient' -require 'getoptlong' include CloudCLI -opts = GetoptLong.new( - ['--help', '-h',GetoptLong::NO_ARGUMENT], - ['--version', '-v',GetoptLong::NO_ARGUMENT], - ['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT], - ['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT], - ['--url', '-U',GetoptLong::REQUIRED_ARGUMENT] - ) -url = nil -access = nil -secret = nil +CommandParser::CmdParser.new(ARGV) do + usage "econe-start-instances [OPTIONS] INSTANCE-ID" + version CloudCLI.version_text + description <<-EOT +Start the selected stopped instance +INSTANCE-ID: The instance identification as returned by the econe-run-instances command +EOT -begin - opts.each do |opt, arg| - case opt - when '--help' - puts COMMANDS_HELP - return - when '--version' - puts CloudCLI.version_text - exit 0 - when '--access-key' - access = arg - when '--secret-key' - secret = arg - when '--url' - url = arg - when '--headers' - headers = true + option [ + CommandParser::VERBOSE, + CommandParser::HELP, + EC2QueryClient::ACCESS_KEY, + EC2QueryClient::SECRET_KEY, + EC2QueryClient::URL + ] + + main :instance_id do + begin + ec2_client = EC2QueryClient::Client.new( + options[:access_key], + options[:secret_key], + options[:url]) + rescue Exception => e + puts "#{cmd_name}: #{e.message}" + exit -1 + end + + rc = ec2_client.start_instances(args[0]) + + if CloudClient::is_error?(rc) + exit_with_code -1, "#{cmd_name}: #{rc.message}" + else + result = rc['instancesSet']['item'][0] + puts "Success: Starting #{result['instanceId']} in " << + "#{result['previousState']['name']} state" + exit_with_code 0 end end -rescue Exception => e - exit -1 -end - -instance = ARGV.shift - -if !instance - puts "#{cmd_name}: missing INSTANCE-ID parameter" - exit -1 -end - -begin - ec2_client = EC2QueryClient::Client.new(access, secret, url) -rescue Exception => e - puts "#{cmd_name}: #{e.message}" - exit -1 -end - -rc = ec2_client.start_instances(instance) - -if CloudClient::is_error?(rc) - puts "#{cmd_name}: #{rc.message}" - exit -1 -end - -result = rc['instancesSet']['item'][0] - -puts "Success: Starting #{result['instanceId']} in #{result['previousState']['name']} state" - -exit 0 +end \ No newline at end of file diff --git a/src/cloud/ec2/bin/econe-stop-instances b/src/cloud/ec2/bin/econe-stop-instances index 3b8f4865a6..a2d0021550 100755 --- a/src/cloud/ec2/bin/econe-stop-instances +++ b/src/cloud/ec2/bin/econe-stop-instances @@ -23,101 +23,53 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end - $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" -COMMANDS_HELP=<<-EOT -econe-stop-instances - -Stop the selected running instance - -Usage: - econe-register [OPTIONS] INSTANCE-ID - -Options: - - --help, -h - Show help - - --access-key , -K - The username of the user - - --secret-key , -S - The password of the user - - --url , -U - Set url as the web service url to use - -INSTANCE-ID: The instance identification as returned by -the econe-run-instances command - -EOT +require 'cli/command_parser' +require 'cli/cli_helper' require 'econe/EC2QueryClient' -require 'CloudClient' -require 'getoptlong' include CloudCLI -opts = GetoptLong.new( - ['--help', '-h',GetoptLong::NO_ARGUMENT], - ['--version', '-v',GetoptLong::NO_ARGUMENT], - ['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT], - ['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT], - ['--url', '-U',GetoptLong::REQUIRED_ARGUMENT] - ) -url = nil -access = nil -secret = nil +CommandParser::CmdParser.new(ARGV) do + usage "econe-stop-instances [OPTIONS] INSTANCE-ID" + version CloudCLI.version_text + description <<-EOT +Stop the selected running instance +INSTANCE-ID: The instance identification as returned by the econe-run-instances command +EOT -begin - opts.each do |opt, arg| - case opt - when '--help' - puts COMMANDS_HELP - return - when '--version' - puts CloudCLI.version_text - exit 0 - when '--access-key' - access = arg - when '--secret-key' - secret = arg - when '--url' - url = arg - when '--headers' - headers = true + option [ + CommandParser::VERBOSE, + CommandParser::HELP, + EC2QueryClient::ACCESS_KEY, + EC2QueryClient::SECRET_KEY, + EC2QueryClient::URL + ] + + main :instance_id do + begin + ec2_client = EC2QueryClient::Client.new( + options[:access_key], + options[:secret_key], + options[:url]) + rescue Exception => e + puts "#{cmd_name}: #{e.message}" + exit -1 + end + + rc = ec2_client.stop_instances(args[0]) + + if CloudClient::is_error?(rc) + exit_with_code -1, "#{cmd_name}: #{rc.message}" + else + result = rc['instancesSet']['item'][0] + puts "Success: Stopping #{result['instanceId']} in " << + "#{result['previousState']['name']} state" + exit_with_code 0 end end -rescue Exception => e - exit -1 -end - -instance = ARGV.shift - -if !instance - puts "#{cmd_name}: missing INSTANCE-ID parameter" - exit -1 -end - -begin - ec2_client = EC2QueryClient::Client.new(access, secret, url) -rescue Exception => e - puts "#{cmd_name}: #{e.message}" - exit -1 -end - -rc = ec2_client.stop_instances(instance) - -if CloudClient::is_error?(rc) - puts "#{cmd_name}: #{rc.message}" - exit -1 -end - -result = rc['instancesSet']['item'][0] - -puts "Success: Stopping #{result['instanceId']} in #{result['previousState']['name']} state" - -exit 0 +end \ No newline at end of file diff --git a/src/cloud/ec2/bin/econe-terminate-instances b/src/cloud/ec2/bin/econe-terminate-instances index c2f923d84d..036b7f7055 100755 --- a/src/cloud/ec2/bin/econe-terminate-instances +++ b/src/cloud/ec2/bin/econe-terminate-instances @@ -47,12 +47,10 @@ EOT CommandParser::HELP, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, - EC2QueryClient::URL, - USER_DATA, - TYPE + EC2QueryClient::URL ] - main :image_id do + main :instance_id do begin ec2_client = EC2QueryClient::Client.new( options[:access_key], @@ -69,8 +67,8 @@ EOT exit_with_code -1, "#{cmd_name}: #{rc.message}" else result = rc['instancesSet']['item'][0] - puts "Success: Terminating #{result['instanceId']} in \ - #{result['previousState']['name']} state" + puts "Success: Terminating #{result['instanceId']} in " << + "#{result['previousState']['name']} state" exit_with_code 0 end end diff --git a/src/cloud/ec2/lib/instance.rb b/src/cloud/ec2/lib/instance.rb index 2fa75872c1..14f6157774 100644 --- a/src/cloud/ec2/lib/instance.rb +++ b/src/cloud/ec2/lib/instance.rb @@ -165,6 +165,10 @@ module Instance rc = block.call(vm) + if OpenNebula::is_error?(rc) + return rc + end + vm.info erb_current_state = render_state(vm) From 4fc26bc51fa14908408f7538664bb19eb9142f93 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 2 Oct 2012 18:31:56 +0200 Subject: [PATCH 10/22] feature #1190: Remove all version of econe-detach-volume --- src/cloud/ec2/bin/econe-detach-volume | 149 -------------------------- 1 file changed, 149 deletions(-) diff --git a/src/cloud/ec2/bin/econe-detach-volume b/src/cloud/ec2/bin/econe-detach-volume index c65240d2ec..fb36860f0a 100755 --- a/src/cloud/ec2/bin/econe-detach-volume +++ b/src/cloud/ec2/bin/econe-detach-volume @@ -23,155 +23,6 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end - -$: << RUBY_LIB_LOCATION -$: << RUBY_LIB_LOCATION+"/cloud" - -COMMANDS_HELP=<<-EOT -econe-detach-volume - -Detaches an Amazon EBS volume from an instance. Make sure to unmount any -file systems on the device within your operating system before detaching the volume - -Usage: - econe-detach-volume [OPTIONS] VOLUME-ID - -Options: - - --help, -h - Show help - - --access-key , -K - The username of the user - - --secret-key , -S - The password of the user - - --url , -U - Set url as the web service url to use - - --instance , -i - The ID of the instance to attach the volume to - - --device , -d e - exit -1 -end - -volume_id = ARGV.shift - -if !volume_id - puts "#{cmd_name}: missing VOLUME-ID parameter" - exit -1 -end - -begin - ec2_client = EC2QueryClient::Client.new(access, secret, url) -rescue Exception => e - puts "#{cmd_name}: #{e.message}" - exit -1 -end - -rc = ec2_client.detach_volume(volume_id, instance, device) - -if CloudClient::is_error?(rc) - puts "#{cmd_name}: #{rc.message}" - exit -1 -end - -fmt = "%-15s %-15s %-10s %s" - -if headers - puts fmt % ["volumeId", "instanceId", "status", "device"] - puts "------------------------------------------------------------------------------" -end - -puts fmt % [rc['volumeId'], rc['instanceId'], rc['status'], rc['device']] - -exit 0 - -#!/usr/bin/env ruby -# -------------------------------------------------------------------------- # -# 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. # -#--------------------------------------------------------------------------- # - -ONE_LOCATION=ENV["ONE_LOCATION"] - -if !ONE_LOCATION - RUBY_LIB_LOCATION="/usr/lib/one/ruby" -else - RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" -end - $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" From 5712f56a63536bbcb59cc000ef4bcc2a8e24530a Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Tue, 2 Oct 2012 18:37:49 +0200 Subject: [PATCH 11/22] Bug #1421: remove set_ds_location function --- src/tm_mad/qcow2/mvds | 2 -- src/tm_mad/shared/mvds | 2 -- src/tm_mad/tm_common.sh | 9 --------- 3 files changed, 13 deletions(-) diff --git a/src/tm_mad/qcow2/mvds b/src/tm_mad/qcow2/mvds index f32d9c8f60..9507555ea8 100755 --- a/src/tm_mad/qcow2/mvds +++ b/src/tm_mad/qcow2/mvds @@ -38,8 +38,6 @@ fi . $TMCOMMON -set_ds_location - #------------------------------------------------------------------------------- # Set dst path and dir #------------------------------------------------------------------------------- diff --git a/src/tm_mad/shared/mvds b/src/tm_mad/shared/mvds index 347d6c636e..c7f4fd0ec6 100755 --- a/src/tm_mad/shared/mvds +++ b/src/tm_mad/shared/mvds @@ -38,8 +38,6 @@ fi . $TMCOMMON -set_ds_location - #------------------------------------------------------------------------------- # Set dst path and dir #------------------------------------------------------------------------------- diff --git a/src/tm_mad/tm_common.sh b/src/tm_mad/tm_common.sh index a9a7f5297e..d6052c20c6 100644 --- a/src/tm_mad/tm_common.sh +++ b/src/tm_mad/tm_common.sh @@ -53,15 +53,6 @@ function arg_path fix_dir_slashes "$ARG_PATH" } -#Return the DATASTORE_LOCATION from OpenNebula configuration -function set_ds_location -{ - RMT_DS_DIR=`$GREP '^DATASTORE_LOCATION=' $ONE_LOCAL_VAR/config | cut -d= -f2` - RMT_DS_DIR=`fix_dir_slashes $RMT_DS_DIR` - - export RMT_DS_DIR -} - #Return 1 if the first argument is a disk function is_disk { From 6ff8972279f678f4fc8e1fd08e8f1047490d914b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 2 Oct 2012 18:54:06 +0200 Subject: [PATCH 12/22] Feature #1523: New xmlrpc method one.system.version added to RequestManager --- include/RequestManagerSystem.h | 67 ++++++++++++++++++++++++++++++++++ src/rm/RequestManager.cc | 10 +++++ src/rm/RequestManagerSystem.cc | 39 ++++++++++++++++++++ src/rm/SConstruct | 3 +- 4 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 include/RequestManagerSystem.h create mode 100644 src/rm/RequestManagerSystem.cc diff --git a/include/RequestManagerSystem.h b/include/RequestManagerSystem.h new file mode 100644 index 0000000000..f774a7759a --- /dev/null +++ b/include/RequestManagerSystem.h @@ -0,0 +1,67 @@ +/* -------------------------------------------------------------------------- */ +/* 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. */ +/* -------------------------------------------------------------------------- */ + +#ifndef REQUEST_MANAGER_SYSTEM_H +#define REQUEST_MANAGER_SYSTEM_H + +#include "Request.h" + +using namespace std; + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +class RequestManagerSystem: public Request +{ +protected: + RequestManagerSystem( const string& method_name, + const string& help, + const string& params) + :Request(method_name,params,help) + {}; + + ~RequestManagerSystem(){}; + + /* -------------------------------------------------------------------- */ + + virtual void request_execute(xmlrpc_c::paramList const& _paramList, + RequestAttributes& att) = 0; +}; + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +class SystemVersion : public RequestManagerSystem +{ +public: + SystemVersion(): + RequestManagerSystem("SystemVersion", + "Returns the OpenNebula version", + "A:s") + {}; + + ~SystemVersion(){}; + + void request_execute(xmlrpc_c::paramList const& _paramList, + RequestAttributes& att); +}; + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +#endif diff --git a/src/rm/RequestManager.cc b/src/rm/RequestManager.cc index 4c2135785b..341d44d159 100644 --- a/src/rm/RequestManager.cc +++ b/src/rm/RequestManager.cc @@ -37,6 +37,8 @@ #include "RequestManagerCluster.h" #include "RequestManagerGroup.h" +#include "RequestManagerSystem.h" + #include #include #include @@ -362,6 +364,9 @@ void RequestManager::register_xml_methods() xmlrpc_c::methodPtr cluster_addvnet(new ClusterAddVNet()); xmlrpc_c::methodPtr cluster_delvnet(new ClusterDelVNet()); + // System Methods + xmlrpc_c::methodPtr system_version(new SystemVersion()); + /* VM related methods */ RequestManagerRegistry.addMethod("one.vm.deploy", vm_deploy); RequestManagerRegistry.addMethod("one.vm.action", vm_action); @@ -490,6 +495,11 @@ void RequestManager::register_xml_methods() RequestManagerRegistry.addMethod("one.document.clone", doc_clone); RequestManagerRegistry.addMethod("one.documentpool.info",docpool_info); + + /* System related methods */ + RequestManagerRegistry.addMethod("one.system.version", system_version); + + }; /* -------------------------------------------------------------------------- */ diff --git a/src/rm/RequestManagerSystem.cc b/src/rm/RequestManagerSystem.cc new file mode 100644 index 0000000000..84d9486e5e --- /dev/null +++ b/src/rm/RequestManagerSystem.cc @@ -0,0 +1,39 @@ +/* -------------------------------------------------------------------------- */ +/* 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. */ +/* -------------------------------------------------------------------------- */ + +#include "RequestManagerSystem.h" +#include "Nebula.h" + +using namespace std; + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +void SystemVersion::request_execute(xmlrpc_c::paramList const& paramList, + RequestAttributes& att) +{ + // TODO: request_execute will not be executed if the session string + // is not authenticated in Request::execute. + // Should we make the version call accessible even + // if no user is provided? + + success_response(Nebula::instance().db_version(), att); + + return; +} + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ diff --git a/src/rm/SConstruct b/src/rm/SConstruct index 6260123704..4420593001 100644 --- a/src/rm/SConstruct +++ b/src/rm/SConstruct @@ -40,7 +40,8 @@ source_files=[ 'RequestManagerAcl.cc', 'RequestManagerChmod.cc', 'RequestManagerCluster.cc', - 'RequestManagerClone.cc' + 'RequestManagerClone.cc', + 'RequestManagerSystem.cc' ] # Build library From 1a85ee1feb0a395d84728e5f01d8d74f8a0938b0 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Wed, 3 Oct 2012 17:20:56 +0200 Subject: [PATCH 13/22] feature #1327: Add --raw and --arch to onevm create --- src/cli/one_helper.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/cli/one_helper.rb b/src/cli/one_helper.rb index ba149d6a31..efe115ee7c 100644 --- a/src/cli/one_helper.rb +++ b/src/cli/one_helper.rb @@ -83,6 +83,13 @@ EOT 'CPU percentage reserved for the VM (1=100% one CPU)', :format => Float }, + { + :name => 'arch', + :large => '--arch arch', + :description => + 'Architecture of the VM, e.g.: i386 or x86_64', + :format => String + }, { :name => 'memory', :large => '--memory memory', @@ -118,6 +125,12 @@ EOT :large => '--network network0,network1', :description => 'Networks to attach. To use a network owned by other user use user[network]', :format => Array + }, + { + :name => 'raw', + :large => '--raw string', + :description => 'Raw string to add to the template. Not to be confused with the RAW attribute', + :format => String } ] @@ -552,8 +565,10 @@ EOT template='' template<<"NAME=\"#{options[:name]}\"\n" if options[:name] + template<<"OS = [ ARCH = \"#{options[:arch]}\" ]\n" if options[:arch] template<<"CPU=#{options[:cpu]}\n" if options[:cpu] template<<"MEMORY=#{options[:memory]}\n" if options[:memory] + template<<"#{options[:raw]}\n" if options[:raw] if options[:disk] res=create_disk_net(options[:disk], 'DISK', 'IMAGE') From 598b48c80aeb4fb15b9ceb6dcc2116fbc4d8ee5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 3 Oct 2012 17:21:55 +0200 Subject: [PATCH 14/22] Fix command_parser to work with onedb --- src/cli/command_parser.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/cli/command_parser.rb b/src/cli/command_parser.rb index 3f34026087..ab6c05e33b 100644 --- a/src/cli/command_parser.rb +++ b/src/cli/command_parser.rb @@ -441,12 +441,14 @@ module CommandParser opts.on(*args) do |o| if e[:proc] rc = e[:proc].call(o, @options) - if rc.instance_of?(Array) && rc[0] == 0 - options[e[:name].to_sym] = rc[1] - else - puts rc[1] - puts "option #{e[:name]}: Parsing error" - exit -1 + if rc.instance_of?(Array) + if rc[0] == 0 + options[e[:name].to_sym] = rc[1] + else + puts rc[1] + puts "option #{e[:name]}: Parsing error" + exit -1 + end end elsif e[:name]=="help" print_help From 78f2dc5da51b539fe038b0ea4c8247720d60e8b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 3 Oct 2012 18:13:20 +0200 Subject: [PATCH 15/22] Feature #1522, Bugs #1363, #1335: Update 3.7.80 onedb migrator --- src/onedb/3.6.0_to_3.7.80.rb | 89 ++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/src/onedb/3.6.0_to_3.7.80.rb b/src/onedb/3.6.0_to_3.7.80.rb index b06e50ac93..262cbe5872 100644 --- a/src/onedb/3.6.0_to_3.7.80.rb +++ b/src/onedb/3.6.0_to_3.7.80.rb @@ -28,7 +28,90 @@ module Migrator def up ######################################################################## - # Bug #1335 + # Feature #1522: Allow users to create Documents by default + ######################################################################## + + # Insert rule "* DOCUMENT/* CREATE" + + last_oid = 0 + @db.fetch("SELECT last_oid FROM pool_control WHERE tablename='acl'") do |row| + last_oid = row[:last_oid].to_i + end + + @db[:acl].insert( + :oid => (last_oid + 1).to_s, + :user => 0x400000000.to_s, + :resource => 0x400400000000.to_s, + :rights => 0x8.to_s) + + @db.run("UPDATE pool_control SET last_oid=#{last_oid + 1} WHERE tablename='acl';") + + ######################################################################## + # Bugs #1363: Make sure all VMs have CPU (float) & MEM (int) + ######################################################################## + + # NOTE: The VM memory and CPU are modified, but the sum in + # HOST/HOST_SHARE is not. A onedb fsck is required + + @db.run "ALTER TABLE vm_pool RENAME TO old_vm_pool;" + @db.run "CREATE TABLE vm_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, last_poll INTEGER, state INTEGER, lcm_state INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER);" + + @db.fetch("SELECT * FROM old_vm_pool") do |row| + if ( row[:state] == 6 ) + body = row[:body] + else + vm_doc = Document.new(row[:body]) + + memory = nil + vm_doc.root.each_element("TEMPLATE/MEMORY") { |e| + memory = e.text.to_i + memory = 0 if memory < 0 + + e.text = memory.to_s + } + + if memory.nil? + vm_doc.root.each_element("TEMPLATE") { |e| + e.add_element("MEMORY").text = "0" + } + end + + cpu = nil + vm_doc.root.each_element("TEMPLATE/CPU") { |e| + # truncate to 2 decimals + cpu = (e.text.to_f * 100).to_i / 100.0 + cpu = 0 if cpu < 0 + + e.text = cpu.to_s + } + + if cpu.nil? + vm_doc.root.each_element("TEMPLATE") { |e| + e.add_element("CPU").text = "0" + } + end + + body = vm_doc.root.to_s + end + + @db[:vm_pool].insert( + :oid => row[:oid], + :name => row[:name], + :body => body, + :uid => row[:uid], + :gid => row[:gid], + :last_poll => row[:last_poll], + :state => row[:state], + :lcm_state => row[:lcm_state], + :owner_u => row[:owner_u], + :group_u => row[:group_u], + :other_u => row[:other_u]) + end + + @db.run "DROP TABLE old_vm_pool;" + + ######################################################################## + # Bug #1335: Add suspended VMs resoureces to Host usage ######################################################################## @db.fetch("SELECT * FROM vm_pool WHERE state = 5") do |row| @@ -41,7 +124,7 @@ module Migrator cpu = 0 vm_doc.root.each_element("TEMPLATE/CPU") { |e| - cpu = e.text.to_i + cpu = e.text.to_f } hid = -1 @@ -188,7 +271,7 @@ module Migrator mem_used = 0 vms_used = 0 - @db.fetch("SELECT body FROM vm_pool WHERE #{where_filter} AND state!=6") do |vm_row| + @db.fetch("SELECT body FROM vm_pool WHERE #{where_filter} AND state<>6") do |vm_row| vmdoc = Document.new(vm_row[:body]) # VM quotas From 78a153de2992bcbb16c0e19b1733b2adb2e3c4b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 3 Oct 2012 18:26:40 +0200 Subject: [PATCH 16/22] Feature #1523: Add a get_client call to ruby & java oca Client class --- src/oca/java/src/org/opennebula/client/Client.java | 10 ++++++++++ src/oca/ruby/OpenNebula.rb | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/oca/java/src/org/opennebula/client/Client.java b/src/oca/java/src/org/opennebula/client/Client.java index 36c0b36b5c..7d4c87ad83 100644 --- a/src/oca/java/src/org/opennebula/client/Client.java +++ b/src/oca/java/src/org/opennebula/client/Client.java @@ -119,6 +119,16 @@ public class Client{ return new OneResponse(success, msg); } + /** + * Calls OpenNebula and retrieves oned version + * + * @return The server's xml-rpc response encapsulated + */ + public OneResponse get_version() + { + return call("system.version"); + } + //-------------------------------------------------------------------------- // PRIVATE ATTRIBUTES AND METHODS //-------------------------------------------------------------------------- diff --git a/src/oca/ruby/OpenNebula.rb b/src/oca/ruby/OpenNebula.rb index 34980fd0c3..43da8be78e 100644 --- a/src/oca/ruby/OpenNebula.rb +++ b/src/oca/ruby/OpenNebula.rb @@ -167,5 +167,9 @@ module OpenNebula Error.new(e.message) end end + + def get_version() + call("system.version") + end end end From 26b01931690281327d938d3a523ee088fd1d1260 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 3 Oct 2012 18:26:59 +0200 Subject: [PATCH 17/22] Add ostruct gem to CloudClient and use include instead of extend for EC2 modules --- src/cloud/common/CloudClient.rb | 2 ++ src/cloud/ec2/bin/econe-describe-addresses | 11 +++--- src/cloud/ec2/lib/EC2QueryServer.rb | 40 +++------------------- 3 files changed, 13 insertions(+), 40 deletions(-) diff --git a/src/cloud/common/CloudClient.rb b/src/cloud/common/CloudClient.rb index b7ee78569b..9b781fadab 100644 --- a/src/cloud/common/CloudClient.rb +++ b/src/cloud/common/CloudClient.rb @@ -22,6 +22,8 @@ require 'net/https' require "rexml/document" +require 'ostruct' + begin require 'rexml/formatters/pretty' REXML_FORMATTERS=true diff --git a/src/cloud/ec2/bin/econe-describe-addresses b/src/cloud/ec2/bin/econe-describe-addresses index 0dce55e95b..19d73988a6 100755 --- a/src/cloud/ec2/bin/econe-describe-addresses +++ b/src/cloud/ec2/bin/econe-describe-addresses @@ -34,15 +34,15 @@ require 'econe/EC2QueryClient' include CloudCLI TABLE = CLIHelper::ShowTable.new(nil, self) do - column :publicIP, "publicIP", :size=>10 do |d| - d["publicIP"] + column :publicIp, "publicIp", :size=>10 do |d| + d["publicIp"] end - column :instanceID, "instanceID", :size=>25 do |d| - d["instanceID"] + column :instanceId, "instanceId", :size=>25 do |d| + d["instanceId"] end - default :publicIP, :instanceID + default :publicIp, :instanceId end @@ -74,6 +74,7 @@ CommandParser::CmdParser.new(ARGV) do if CloudClient::is_error?(rc) exit_with_code -1, "#{cmd_name}: #{rc.message}" else + puts rc if rc.empty? || rc['addressesSet'].nil? || rc['addressesSet']['item'].nil? addrs = [] else diff --git a/src/cloud/ec2/lib/EC2QueryServer.rb b/src/cloud/ec2/lib/EC2QueryServer.rb index ec18f1504f..4478961206 100644 --- a/src/cloud/ec2/lib/EC2QueryServer.rb +++ b/src/cloud/ec2/lib/EC2QueryServer.rb @@ -63,6 +63,11 @@ end ############################################################################### class EC2QueryServer < CloudServer + include ElasticIP + include Keypair + include EBS + include Instance + ############################################################################ # # @@ -78,18 +83,6 @@ class EC2QueryServer < CloudServer else @base_url="http://#{config[:server]}:#{config[:port]}" end - - # ----------- Load EC2 API modules ------------ - - if @config[:elasticips_vnet_id].nil? - logger.error { 'ElasticIP module not loaded' } - else - extend ElasticIP - end - - extend Keypair - extend EBS - extend Instance end ########################################################################### @@ -166,29 +159,6 @@ class EC2QueryServer < CloudServer return response.result(binding), 200 end - ########################################################################### - # Provide defaults for Elastic IP if not loaded - ########################################################################### - def allocate_address(params) - return OpenNebula::Error.new('Unsupported') - end - - def release_address(params) - return OpenNebula::Error.new('Unsupported') - end - - def describe_addresses(params) - return OpenNebula::Error.new('Unsupported') - end - - def associate_address(params) - return OpenNebula::Error.new('Unsupported') - end - - def disassociate_address(params) - return OpenNebula::Error.new('Unsupported') - end - ########################################################################### # Helper functions ########################################################################### From 69eb361d7a1b023dddbea9890a7d7e59c9e83cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 3 Oct 2012 18:31:45 +0200 Subject: [PATCH 18/22] Feature #1404: Add poweroff action to Java OCA --- .../src/org/opennebula/client/vm/VirtualMachine.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java b/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java index 245de275ef..d9e8bd2add 100644 --- a/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java +++ b/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java @@ -491,6 +491,15 @@ public class VirtualMachine extends PoolElement{ return action("shutdown"); } + /** + * Powers off a running VM. + * @return If an error occurs the error message contains the reason. + */ + public OneResponse poweroff() + { + return action("poweroff"); + } + /** * Reboots a running VM. * @return If an error occurs the error message contains the reason. From 0e1729e84c7e7d73f7cd012aaa3115752d2ebe07 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Wed, 3 Oct 2012 19:51:57 +0200 Subject: [PATCH 19/22] bug #1520: Firewall not working with Open vSwitch Switch from the iptables firewall scripts, which aren't compatible anymore, with scripts that create openvswitch flows. Port whitelisting functionality can't be implemented with this model. --- src/vnm_mad/remotes/OpenNebulaNetwork.rb | 3 +- src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb | 121 ++++++++++++++++++-- src/vnm_mad/remotes/ovswitch/clean | 8 +- src/vnm_mad/remotes/ovswitch/post | 10 +- 4 files changed, 119 insertions(+), 23 deletions(-) diff --git a/src/vnm_mad/remotes/OpenNebulaNetwork.rb b/src/vnm_mad/remotes/OpenNebulaNetwork.rb index f3dd5342d6..702e46acfc 100644 --- a/src/vnm_mad/remotes/OpenNebulaNetwork.rb +++ b/src/vnm_mad/remotes/OpenNebulaNetwork.rb @@ -37,7 +37,8 @@ COMMANDS = { :vconfig => "sudo /sbin/vconfig", :virsh => "virsh -c qemu:///system", :xm => "sudo /usr/sbin/xm", - :ovs_vsctl=> "sudo /usr/local/bin/ovs-vsctl", + :ovs_vsctl=> "sudo /usr/bin/ovs-vsctl", + :ovs_ofctl=> "sudo /usr/bin/ovs-ofctl", :lsmod => "/sbin/lsmod" } diff --git a/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb b/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb index 45f957373d..e0f32cef55 100644 --- a/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb +++ b/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb @@ -17,7 +17,13 @@ require 'OpenNebulaNetwork' class OpenvSwitchVLAN < OpenNebulaNetwork - XPATH_FILTER = "TEMPLATE/NIC[VLAN='YES']" + FIREWALL_PARAMS = [:white_ports_tcp, + :white_ports_udp, + :black_ports_tcp, + :black_ports_udp, + :icmp] + + XPATH_FILTER = "TEMPLATE/NIC" def initialize(vm, deploy_id = nil, hypervisor = nil) super(vm,XPATH_FILTER,deploy_id,hypervisor) @@ -25,18 +31,113 @@ class OpenvSwitchVLAN < OpenNebulaNetwork def activate process do |nic| - if nic[:vlan_id] - vlan = nic[:vlan_id] - else - vlan = CONF[:start_vlan] + nic[:network_id].to_i - end + @nic = nic - cmd = "#{COMMANDS[:ovs_vsctl]} set Port #{nic[:tap]} " - cmd << "tag=#{vlan}" + # Apply VLAN + tag_vlan if @nic[:vlan] == "YES" - OpenNebula.exec_and_log(cmd) + # Apply Firewall + configure_fw if FIREWALL_PARAMS & @nic.keys != [] end - return 0 end + + def deactivate + process do |nic| + @nic = nic + + # Remove flows + del_flows + end + end + + def tag_vlan + if @nic[:vlan_id] + vlan = @nic[:vlan_id] + else + vlan = CONF[:start_vlan] + @nic[:network_id].to_i + end + + cmd = "#{COMMANDS[:ovs_vsctl]} set Port #{@nic[:tap]} " + cmd << "tag=#{vlan}" + + run cmd + end + + def configure_fw + # Mac-spoofing + add_flow("in_port=#{port},dl_src=#{@nic[:mac]}",:normal,40000) + add_flow("in_port=#{port}",:drop,39000) + + # TCP + if range = @nic[:black_ports_tcp] + if range? range + range.split(",").each do |p| + add_flow("tcp,dl_dst=#{@nic[:mac]},tp_dst=#{p}",:drop) + end + end + end + + # UDP + if range = @nic[:black_ports_udp] + if range? range + range.split(",").each do |p| + add_flow("udp,dl_dst=#{@nic[:mac]},tp_dst=#{p}",:drop) + end + end + end + + # ICMP + if @nic[:icmp] + if %w(no drop).include? @nic[:icmp].downcase + add_flow("icmp,dl_dst=#{@nic[:mac]}",:drop) + end + end + end + + def del_flows + in_port = "" + + dump_flows = "#{COMMANDS[:ovs_ofctl]} dump-flows #{@nic[:bridge]}" + `#{dump_flows}`.lines do |flow| + next unless flow.match("#{@nic[:mac]}") + flow = flow.split.select{|e| e.match(@nic[:mac])}.first + if in_port.empty? and (m = flow.match(/in_port=(\d+)/)) + in_port = m[1] + end + del_flow flow + end + + del_flow "in_port=#{in_port}" if !in_port.empty? + end + + def add_flow(filter,action,priority=nil) + priority = (priority.to_s.empty? ? "" : "priority=#{priority},") + + run "#{COMMANDS[:ovs_ofctl]} add-flow " << + "#{@nic[:bridge]} #{filter},#{priority}actions=#{action}" + end + + def del_flow(filter) + filter.gsub!(/priority=(\d+)/,"") + run "#{COMMANDS[:ovs_ofctl]} del-flows " << + "#{@nic[:bridge]} #{filter}" + end + + def run(cmd) + OpenNebula.exec_and_log(cmd) + end + + def port + return @nic[:port] if @nic[:port] + + dump_ports = `#{COMMANDS[:ovs_ofctl]} \ + dump-ports #{@nic[:bridge]} #{@nic[:tap]}` + + @nic[:port] = dump_ports.scan(/^\s*port\s*(\d+):/).flatten.first + end + + def range?(range) + !range.match(/^\d+(,\d+)*$/).nil? + end end diff --git a/src/vnm_mad/remotes/ovswitch/clean b/src/vnm_mad/remotes/ovswitch/clean index c63c4821f7..d1cd859edd 100755 --- a/src/vnm_mad/remotes/ovswitch/clean +++ b/src/vnm_mad/remotes/ovswitch/clean @@ -19,9 +19,9 @@ $: << File.dirname(__FILE__) $: << File.join(File.dirname(__FILE__), "..") -require 'OpenNebulaNetwork' -require 'Firewall' +require 'OpenvSwitch' -fw = OpenNebulaFirewall.from_base64(ARGV[0]) +template64 = ARGV[0] -fw.deactivate +ovs = OpenvSwitchVLAN.from_base64(template64) +ovs.deactivate diff --git a/src/vnm_mad/remotes/ovswitch/post b/src/vnm_mad/remotes/ovswitch/post index 1f4720badb..80cda45c63 100755 --- a/src/vnm_mad/remotes/ovswitch/post +++ b/src/vnm_mad/remotes/ovswitch/post @@ -20,15 +20,9 @@ $: << File.dirname(__FILE__) $: << File.join(File.dirname(__FILE__), "..") require 'OpenvSwitch' -require 'Firewall' template64 = ARGV[0] deploy_id = ARGV[1] -onevlan = OpenvSwitchVLAN.from_base64(template64, deploy_id) - -onevlan.activate - -fw = OpenNebulaFirewall.from_base64(template64, deploy_id) - -fw.activate +ovs = OpenvSwitchVLAN.from_base64(template64, deploy_id) +ovs.activate From dcc10218a8022b06c14979605c43a8e63292684b Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 4 Oct 2012 11:39:16 +0200 Subject: [PATCH 20/22] bug #1520: Remove unsupported white_ports, and apply the mac_spoofing filter on all interfaces. --- src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb b/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb index e0f32cef55..8ea85732f1 100644 --- a/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb +++ b/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb @@ -17,9 +17,7 @@ require 'OpenNebulaNetwork' class OpenvSwitchVLAN < OpenNebulaNetwork - FIREWALL_PARAMS = [:white_ports_tcp, - :white_ports_udp, - :black_ports_tcp, + FIREWALL_PARAMS = [:black_ports_tcp, :black_ports_udp, :icmp] @@ -36,6 +34,9 @@ class OpenvSwitchVLAN < OpenNebulaNetwork # Apply VLAN tag_vlan if @nic[:vlan] == "YES" + # Prevent Mac-spoofing + mac_spoofing + # Apply Firewall configure_fw if FIREWALL_PARAMS & @nic.keys != [] end @@ -64,11 +65,12 @@ class OpenvSwitchVLAN < OpenNebulaNetwork run cmd end - def configure_fw - # Mac-spoofing + def mac_spoofing add_flow("in_port=#{port},dl_src=#{@nic[:mac]}",:normal,40000) add_flow("in_port=#{port}",:drop,39000) + end + def configure_fw # TCP if range = @nic[:black_ports_tcp] if range? range From 8711ac6ae4296be1de23a383ab7056ce917326ac Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 4 Oct 2012 11:54:39 +0200 Subject: [PATCH 21/22] Feature #1190: Add --version option to all the econe commands --- src/cloud/ec2/bin/econe-allocate-address | 1 + src/cloud/ec2/bin/econe-associate-address | 3 ++- src/cloud/ec2/bin/econe-attach-volume | 3 ++- src/cloud/ec2/bin/econe-create-keypair | 1 + src/cloud/ec2/bin/econe-create-volume | 1 + src/cloud/ec2/bin/econe-delete-keypair | 1 + src/cloud/ec2/bin/econe-delete-volume | 3 ++- src/cloud/ec2/bin/econe-describe-addresses | 1 + src/cloud/ec2/bin/econe-describe-images | 1 + src/cloud/ec2/bin/econe-describe-instances | 1 + src/cloud/ec2/bin/econe-describe-keypairs | 1 + src/cloud/ec2/bin/econe-describe-volumes | 1 + src/cloud/ec2/bin/econe-detach-volume | 1 + src/cloud/ec2/bin/econe-disassociate-address | 1 + src/cloud/ec2/bin/econe-reboot-instances | 3 ++- src/cloud/ec2/bin/econe-register | 1 + src/cloud/ec2/bin/econe-release-address | 1 + src/cloud/ec2/bin/econe-run-instances | 1 + src/cloud/ec2/bin/econe-start-instances | 3 ++- src/cloud/ec2/bin/econe-stop-instances | 3 ++- src/cloud/ec2/bin/econe-terminate-instances | 3 ++- src/cloud/ec2/bin/econe-upload | 1 + 22 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/cloud/ec2/bin/econe-allocate-address b/src/cloud/ec2/bin/econe-allocate-address index 8c780ec682..19744ec86e 100755 --- a/src/cloud/ec2/bin/econe-allocate-address +++ b/src/cloud/ec2/bin/econe-allocate-address @@ -40,6 +40,7 @@ CommandParser::CmdParser.new(ARGV) do option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-associate-address b/src/cloud/ec2/bin/econe-associate-address index 7abb873578..fc33d92be5 100755 --- a/src/cloud/ec2/bin/econe-associate-address +++ b/src/cloud/ec2/bin/econe-associate-address @@ -45,6 +45,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL @@ -68,4 +69,4 @@ EOT exit_with_code 0 end end -end \ No newline at end of file +end diff --git a/src/cloud/ec2/bin/econe-attach-volume b/src/cloud/ec2/bin/econe-attach-volume index fba6fa2ea2..d90d849be5 100755 --- a/src/cloud/ec2/bin/econe-attach-volume +++ b/src/cloud/ec2/bin/econe-attach-volume @@ -61,6 +61,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL, @@ -90,4 +91,4 @@ EOT exit_with_code 0 end end -end \ No newline at end of file +end diff --git a/src/cloud/ec2/bin/econe-create-keypair b/src/cloud/ec2/bin/econe-create-keypair index b49d8c0ac8..ff7016dd3b 100755 --- a/src/cloud/ec2/bin/econe-create-keypair +++ b/src/cloud/ec2/bin/econe-create-keypair @@ -44,6 +44,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-create-volume b/src/cloud/ec2/bin/econe-create-volume index 70ac476a15..8450ad559b 100755 --- a/src/cloud/ec2/bin/econe-create-volume +++ b/src/cloud/ec2/bin/econe-create-volume @@ -49,6 +49,7 @@ CommandParser::CmdParser.new(ARGV) do option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL, diff --git a/src/cloud/ec2/bin/econe-delete-keypair b/src/cloud/ec2/bin/econe-delete-keypair index 3e8e2adbe5..8b2a50057f 100755 --- a/src/cloud/ec2/bin/econe-delete-keypair +++ b/src/cloud/ec2/bin/econe-delete-keypair @@ -44,6 +44,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-delete-volume b/src/cloud/ec2/bin/econe-delete-volume index 473bf2aedc..44c9402060 100755 --- a/src/cloud/ec2/bin/econe-delete-volume +++ b/src/cloud/ec2/bin/econe-delete-volume @@ -44,6 +44,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL @@ -67,4 +68,4 @@ EOT exit_with_code 0 end end -end \ No newline at end of file +end diff --git a/src/cloud/ec2/bin/econe-describe-addresses b/src/cloud/ec2/bin/econe-describe-addresses index 19d73988a6..7238917c33 100755 --- a/src/cloud/ec2/bin/econe-describe-addresses +++ b/src/cloud/ec2/bin/econe-describe-addresses @@ -54,6 +54,7 @@ CommandParser::CmdParser.new(ARGV) do option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-describe-images b/src/cloud/ec2/bin/econe-describe-images index 7ada55841e..6eddc27ddc 100755 --- a/src/cloud/ec2/bin/econe-describe-images +++ b/src/cloud/ec2/bin/econe-describe-images @@ -66,6 +66,7 @@ used with an OpenNebula Cloud." option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-describe-instances b/src/cloud/ec2/bin/econe-describe-instances index 89a68f0684..76fa7e132b 100755 --- a/src/cloud/ec2/bin/econe-describe-instances +++ b/src/cloud/ec2/bin/econe-describe-instances @@ -64,6 +64,7 @@ CommandParser::CmdParser.new(ARGV) do option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-describe-keypairs b/src/cloud/ec2/bin/econe-describe-keypairs index 47388cf428..17b99a0248 100755 --- a/src/cloud/ec2/bin/econe-describe-keypairs +++ b/src/cloud/ec2/bin/econe-describe-keypairs @@ -52,6 +52,7 @@ CommandParser::CmdParser.new(ARGV) do option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-describe-volumes b/src/cloud/ec2/bin/econe-describe-volumes index c7bbd338d8..ee7b099fb1 100755 --- a/src/cloud/ec2/bin/econe-describe-volumes +++ b/src/cloud/ec2/bin/econe-describe-volumes @@ -72,6 +72,7 @@ CommandParser::CmdParser.new(ARGV) do option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-detach-volume b/src/cloud/ec2/bin/econe-detach-volume index fb36860f0a..2a29613e68 100755 --- a/src/cloud/ec2/bin/econe-detach-volume +++ b/src/cloud/ec2/bin/econe-detach-volume @@ -62,6 +62,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL, diff --git a/src/cloud/ec2/bin/econe-disassociate-address b/src/cloud/ec2/bin/econe-disassociate-address index 0e055b8c44..0dd0e49ee4 100755 --- a/src/cloud/ec2/bin/econe-disassociate-address +++ b/src/cloud/ec2/bin/econe-disassociate-address @@ -44,6 +44,7 @@ EOT" option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-reboot-instances b/src/cloud/ec2/bin/econe-reboot-instances index 590dccb301..5e473069d6 100755 --- a/src/cloud/ec2/bin/econe-reboot-instances +++ b/src/cloud/ec2/bin/econe-reboot-instances @@ -45,6 +45,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL @@ -70,4 +71,4 @@ EOT exit_with_code 0 end end -end \ No newline at end of file +end diff --git a/src/cloud/ec2/bin/econe-register b/src/cloud/ec2/bin/econe-register index 74cc5523ea..d5103cb62a 100755 --- a/src/cloud/ec2/bin/econe-register +++ b/src/cloud/ec2/bin/econe-register @@ -44,6 +44,7 @@ EOT" option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-release-address b/src/cloud/ec2/bin/econe-release-address index d1977471ed..6f1afd8883 100755 --- a/src/cloud/ec2/bin/econe-release-address +++ b/src/cloud/ec2/bin/econe-release-address @@ -44,6 +44,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL diff --git a/src/cloud/ec2/bin/econe-run-instances b/src/cloud/ec2/bin/econe-run-instances index 416953cca5..c19d1a78d0 100755 --- a/src/cloud/ec2/bin/econe-run-instances +++ b/src/cloud/ec2/bin/econe-run-instances @@ -89,6 +89,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL, diff --git a/src/cloud/ec2/bin/econe-start-instances b/src/cloud/ec2/bin/econe-start-instances index 95386a4818..548ba59598 100755 --- a/src/cloud/ec2/bin/econe-start-instances +++ b/src/cloud/ec2/bin/econe-start-instances @@ -45,6 +45,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL @@ -72,4 +73,4 @@ EOT exit_with_code 0 end end -end \ No newline at end of file +end diff --git a/src/cloud/ec2/bin/econe-stop-instances b/src/cloud/ec2/bin/econe-stop-instances index a2d0021550..a9e1e83ae2 100755 --- a/src/cloud/ec2/bin/econe-stop-instances +++ b/src/cloud/ec2/bin/econe-stop-instances @@ -45,6 +45,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL @@ -72,4 +73,4 @@ EOT exit_with_code 0 end end -end \ No newline at end of file +end diff --git a/src/cloud/ec2/bin/econe-terminate-instances b/src/cloud/ec2/bin/econe-terminate-instances index 036b7f7055..bc3847a729 100755 --- a/src/cloud/ec2/bin/econe-terminate-instances +++ b/src/cloud/ec2/bin/econe-terminate-instances @@ -45,6 +45,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL @@ -72,4 +73,4 @@ EOT exit_with_code 0 end end -end \ No newline at end of file +end diff --git a/src/cloud/ec2/bin/econe-upload b/src/cloud/ec2/bin/econe-upload index e2551a836f..dfebf1d25a 100755 --- a/src/cloud/ec2/bin/econe-upload +++ b/src/cloud/ec2/bin/econe-upload @@ -53,6 +53,7 @@ EOT option [ CommandParser::VERBOSE, CommandParser::HELP, + CommandParser::VERSION, EC2QueryClient::ACCESS_KEY, EC2QueryClient::SECRET_KEY, EC2QueryClient::URL, From b27629f26e5ad53e255079bca324591115866c75 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 4 Oct 2012 11:58:17 +0200 Subject: [PATCH 22/22] Bump vesion to 3.7.80 --- include/Nebula.h | 4 +- share/man/econe-describe-images.1 | 66 +++++++++------ share/man/econe-describe-instances.1 | 67 +++++++++------ share/man/econe-register.1 | 78 +++++++++++------- share/man/econe-run-instances.1 | 94 +++++++++++++--------- share/man/econe-terminate-instances.1 | 69 ++++++++++------ share/man/econe-upload.1 | 73 +++++++++++------ share/man/occi-compute.1 | 10 ++- share/man/occi-network.1 | 2 +- share/man/occi-storage.1 | 7 +- share/man/oneacct.1 | 4 +- share/man/oneacl.1 | 7 +- share/man/onecluster.1 | 7 +- share/man/onedatastore.1 | 7 +- share/man/onedb.1 | 2 +- share/man/onegroup.1 | 22 ++++- share/man/onehost.1 | 7 +- share/man/oneimage.1 | 46 +++++++++-- share/man/onetemplate.1 | 37 +++++++-- share/man/oneuser.1 | 30 +++++-- share/man/onevdc.1 | 4 +- share/man/onevm.1 | 75 ++++++++++++----- share/man/onevnet.1 | 7 +- share/man/onezone.1 | 4 +- src/cloud/common/CloudClient.rb | 2 +- src/cloud/occi/lib/ui/templates/login.html | 2 +- src/cloud/occi/lib/ui/views/index.erb | 2 +- src/oca/ruby/OpenNebula.rb | 2 +- src/ozones/Server/templates/index.html | 2 +- src/ozones/Server/templates/login.html | 2 +- src/sunstone/views/index.erb | 2 +- src/sunstone/views/login.erb | 2 +- 32 files changed, 508 insertions(+), 237 deletions(-) diff --git a/include/Nebula.h b/include/Nebula.h index b16c8f3fc0..d90ead90dc 100644 --- a/include/Nebula.h +++ b/include/Nebula.h @@ -274,12 +274,12 @@ public: static string version() { - return "OpenNebula 3.7.0"; + return "OpenNebula 3.7.80"; }; static string db_version() { - return "3.7.0"; + return "3.7.80"; } void start(); diff --git a/share/man/econe-describe-images.1 b/share/man/econe-describe-images.1 index 583c331231..dd9c562327 100644 --- a/share/man/econe-describe-images.1 +++ b/share/man/econe-describe-images.1 @@ -1,36 +1,56 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "July 2012" "OpenNebula 3.7.0" "User Commands" +.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.7.80" "User Commands" .SH NAME OpenNebula \- OpenNebula econe-describe-images -.SH SYNOPSIS -.B econe-describe-images -[\fIOPTIONS\fR] .SH DESCRIPTION -econe\-describe\-images +## SYNOPSIS +.PP +econe\-describe\-images [OPTIONS] .PP List and describe previously uploaded images of a user to be used with an OpenNebula Cloud. -.SH OPTIONS -.HP -\fB\-\-help\fR, \fB\-h\fR -.IP -Show help -.HP -\fB\-\-access\-key\fR , \fB\-K\fR -.IP +.PP +## OPTIONS +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Verbose mode +.TP +\fB\-h\fR, \fB\-\-help\fR +Show this message +.TP +\fB\-V\fR, \fB\-\-version\fR +Show version and copyright information +.TP +\fB\-K\fR, \fB\-\-access\-key\fR id The username of the user -.HP -\fB\-\-secret\-key\fR , \fB\-S\fR -.IP -The password of the user -.HP -\fB\-\-url\fR , \fB\-U\fR -.IP +.TP +\fB\-S\fR, \fB\-\-sercret\-key\fR key +The sha1 hashed password of the user +.TP +\fB\-U\fR, \fB\-\-url\fR url Set url as the web service url to use -.HP -\fB\-\-headers\fR, \fB\-H\fR +.PP +## ARGUMENT FORMATS +.TP +\fBfile\fR .IP -Display column headers +Path to a file +.TP +\fBrange\fR +.IP +List of id's in the form 1,8..15 +.TP +\fBtext\fR +.IP +String +.PP +## LICENSE +OpenNebula 3.7.80 +Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +.PP +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 .SH COPYRIGHT Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) .PP diff --git a/share/man/econe-describe-instances.1 b/share/man/econe-describe-instances.1 index 05695e411b..25d3cf3e5f 100644 --- a/share/man/econe-describe-instances.1 +++ b/share/man/econe-describe-instances.1 @@ -1,36 +1,55 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "July 2012" "OpenNebula 3.7.0" "User Commands" +.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.7.80" "User Commands" .SH NAME OpenNebula \- OpenNebula econe-describe-instances -.SH SYNOPSIS -.B econe-describe-instances -[\fIOPTIONS\fR] .SH DESCRIPTION -econe\-describe\-instances +## SYNOPSIS +.PP +econe\-describe\-instances [OPTIONS] .PP List and describe running instances -.SH OPTIONS - -.HP -\fB\-\-help\fR, \fB\-h\fR -.IP -Show help -.HP -\fB\-\-access\-key\fR , \fB\-K\fR -.IP +.PP +## OPTIONS +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Verbose mode +.TP +\fB\-h\fR, \fB\-\-help\fR +Show this message +.TP +\fB\-V\fR, \fB\-\-version\fR +Show version and copyright information +.TP +\fB\-K\fR, \fB\-\-access\-key\fR id The username of the user -.HP -\fB\-\-secret\-key\fR , \fB\-S\fR -.IP -The password of the user -.HP -\fB\-\-url\fR , \fB\-U\fR -.IP +.TP +\fB\-S\fR, \fB\-\-sercret\-key\fR key +The sha1 hashed password of the user +.TP +\fB\-U\fR, \fB\-\-url\fR url Set url as the web service url to use -.HP -\fB\-\-headers\fR, \fB\-H\fR +.PP +## ARGUMENT FORMATS +.TP +\fBfile\fR .IP -Display column headers +Path to a file +.TP +\fBrange\fR +.IP +List of id's in the form 1,8..15 +.TP +\fBtext\fR +.IP +String +.PP +## LICENSE +OpenNebula 3.7.80 +Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +.PP +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 .SH COPYRIGHT Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) .PP diff --git a/share/man/econe-register.1 b/share/man/econe-register.1 index 02fe3ab4de..b11d6c3d03 100644 --- a/share/man/econe-register.1 +++ b/share/man/econe-register.1 @@ -1,40 +1,60 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "July 2012" "OpenNebula 3.7.0" "User Commands" +.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.7.80" "User Commands" .SH NAME OpenNebula \- OpenNebula econe-register -.SH SYNOPSIS -.B econe-register -[\fIOPTIONS\fR] \fIIMAGE-ID\fR .SH DESCRIPTION -econe\-register +## SYNOPSIS .PP -Register a previously uploaded image for use with an -OpenNebula Cloud. -.SH OPTIONS - -.HP -\fB\-\-help\fR, \fB\-h\fR -.IP -Show help -.HP -\fB\-\-access\-key\fR , \fB\-K\fR -.IP +econe\-register [OPTIONS] IMAGE\-ID +.PP +<<\-EOT +Register a previously uploaded image for use with an OpenNebula Cloud. +IMAGE\-ID: The image identification as returned by the econe\-upload command +EOT +.PP +## OPTIONS +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Verbose mode +.TP +\fB\-h\fR, \fB\-\-help\fR +Show this message +.TP +\fB\-V\fR, \fB\-\-version\fR +Show version and copyright information +.TP +\fB\-K\fR, \fB\-\-access\-key\fR id The username of the user -.HP -\fB\-\-secret\-key\fR , \fB\-S\fR -.IP -The password of the user -.HP -\fB\-\-url\fR , \fB\-U\fR -.IP +.TP +\fB\-S\fR, \fB\-\-sercret\-key\fR key +The sha1 hashed password of the user +.TP +\fB\-U\fR, \fB\-\-url\fR url Set url as the web service url to use -.HP -\fB\-\-headers\fR, \fB\-H\fR -.IP -Display column headers .PP -IMAGE\-ID: The image identification as returned by -the econe\-upload command + +.PP +## ARGUMENT FORMATS +.TP +\fBfile\fR +.IP +Path to a file +.TP +\fBrange\fR +.IP +List of id's in the form 1,8..15 +.TP +\fBtext\fR +.IP +String +.PP +## LICENSE +OpenNebula 3.7.80 +Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +.PP +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 .SH COPYRIGHT Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) .PP diff --git a/share/man/econe-run-instances.1 b/share/man/econe-run-instances.1 index 5ab91b15d3..97cbc79228 100644 --- a/share/man/econe-run-instances.1 +++ b/share/man/econe-run-instances.1 @@ -1,48 +1,66 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "July 2012" "OpenNebula 3.7.0" "User Commands" +.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.7.80" "User Commands" .SH NAME OpenNebula \- OpenNebula econe-run-instances -.SH SYNOPSIS -.B econe-run-instances -[\fIOPTIONS\fR] \fIIMAGE-ID\fR .SH DESCRIPTION -econe\-run\-instances +## SYNOPSIS +.PP +econe\-run\-instances [OPTIONS] IMAGE\-ID .PP Runs an instance of a particular image -.SH OPTIONS - -.HP -\fB\-\-help\fR, \fB\-h\fR -.IP -Show help -.HP -\fB\-\-access\-key\fR , \fB\-K\fR -.IP -The username of the user -.HP -\fB\-\-secret\-key\fR , \fB\-S\fR -.IP -The password of the user -.HP -\fB\-\-url\fR , \fB\-U\fR -.IP -Set url as the web service url to use -.HP -\fB\-\-type\fR , \fB\-t\fR -.IP -OpenNebula template in which is based this instance -.HP -\fB\-\-user\-data\fR, \fB\-d\fR -.IP -Specifies Base64\-encoded MIME user data to be made -available to the instance -.HP -\fB\-\-headers\fR, \fB\-H\fR -.IP -Display column headers +IMAGE\-ID: The image identification as returned by the econe\-upload command .PP -IMAGE\-ID: The image identification as returned by -the econe\-upload command +## OPTIONS +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Verbose mode +.TP +\fB\-h\fR, \fB\-\-help\fR +Show this message +.TP +\fB\-V\fR, \fB\-\-version\fR +Show version and copyright information +.TP +\fB\-K\fR, \fB\-\-access\-key\fR id +The username of the user +.TP +\fB\-S\fR, \fB\-\-sercret\-key\fR key +The sha1 hashed password of the user +.TP +\fB\-U\fR, \fB\-\-url\fR url +Set url as the web service url to use +.TP +\fB\-d\fR, \fB\-\-user\-data\fR data +Specifies Base64\-encoded MIME user data to be made +.IP +available to the instance +.TP +\fB\-t\fR, \fB\-\-type\fR type +OpenNebula template in which is based this instance +.PP + +.PP +## ARGUMENT FORMATS +.TP +\fBfile\fR +.IP +Path to a file +.TP +\fBrange\fR +.IP +List of id's in the form 1,8..15 +.TP +\fBtext\fR +.IP +String +.PP +## LICENSE +OpenNebula 3.7.80 +Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +.PP +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 .SH COPYRIGHT Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) .PP diff --git a/share/man/econe-terminate-instances.1 b/share/man/econe-terminate-instances.1 index c22ed735c9..31cdab8bb6 100644 --- a/share/man/econe-terminate-instances.1 +++ b/share/man/econe-terminate-instances.1 @@ -1,35 +1,58 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "July 2012" "OpenNebula 3.7.0" "User Commands" +.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.7.80" "User Commands" .SH NAME OpenNebula \- OpenNebula econe-terminate-instances -.SH SYNOPSIS -.B econe-register -[\fIOPTIONS\fR] \fIINSTANCE-ID\fR .SH DESCRIPTION -econe\-terminate\-instances +## SYNOPSIS +.PP +econe\-terminate\-instances [OPTIONS] INSTANCE\-ID .PP Terminate the selected running instance -.SH OPTIONS - -.HP -\fB\-\-help\fR, \fB\-h\fR -.IP -Show help -.HP -\fB\-\-access\-key\fR , \fB\-K\fR -.IP +INSTANCE\-ID: The instance identification as returned by the econe\-run\-instances command +.PP +## OPTIONS +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Verbose mode +.TP +\fB\-h\fR, \fB\-\-help\fR +Show this message +.TP +\fB\-V\fR, \fB\-\-version\fR +Show version and copyright information +.TP +\fB\-K\fR, \fB\-\-access\-key\fR id The username of the user -.HP -\fB\-\-secret\-key\fR , \fB\-S\fR -.IP -The password of the user -.HP -\fB\-\-url\fR , \fB\-U\fR -.IP +.TP +\fB\-S\fR, \fB\-\-sercret\-key\fR key +The sha1 hashed password of the user +.TP +\fB\-U\fR, \fB\-\-url\fR url Set url as the web service url to use .PP -INSTANCE\-ID: The instance identification as returned by -the econe\-run\-instances command + +.PP +## ARGUMENT FORMATS +.TP +\fBfile\fR +.IP +Path to a file +.TP +\fBrange\fR +.IP +List of id's in the form 1,8..15 +.TP +\fBtext\fR +.IP +String +.PP +## LICENSE +OpenNebula 3.7.80 +Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +.PP +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 .SH COPYRIGHT Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) .PP diff --git a/share/man/econe-upload.1 b/share/man/econe-upload.1 index c1be1b714a..bb272db089 100644 --- a/share/man/econe-upload.1 +++ b/share/man/econe-upload.1 @@ -1,39 +1,62 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "July 2012" "OpenNebula 3.7.0" "User Commands" +.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.7.80" "User Commands" .SH NAME OpenNebula \- OpenNebula econe-upload -.SH SYNOPSIS -.B econe-upload -[\fIOPTIONS\fR] \fIIMAGE-PATH\fR .SH DESCRIPTION -econe\-upload +## SYNOPSIS +.PP +econe\-upload [OPTIONS] IMAGE\-PATH .PP Uploads an image for use with an OpenNebula Cloud. This image should be later register with econe\-register using the returned ImageId -.SH OPTIONS - -.HP -\fB\-\-help\fR, \fB\-h\fR -.IP -Show help -.HP -\fB\-\-access\-key\fR , \fB\-K\fR -.IP +IMAGE\-PATH: Path to the image to upload +.PP +## OPTIONS +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Verbose mode +.TP +\fB\-h\fR, \fB\-\-help\fR +Show this message +.TP +\fB\-V\fR, \fB\-\-version\fR +Show version and copyright information +.TP +\fB\-K\fR, \fB\-\-access\-key\fR id The username of the user -.HP -\fB\-\-secret\-key\fR , \fB\-S\fR -.IP -The password of the user -.HP -\fB\-\-url\fR , \fB\-U\fR -.IP +.TP +\fB\-S\fR, \fB\-\-sercret\-key\fR key +The sha1 hashed password of the user +.TP +\fB\-U\fR, \fB\-\-url\fR url Set url as the web service url to use -.HP -\fB\-\-multipart\fR, \fB\-M\fR -.IP +.TP +\fB\-M\fR, \fB\-\-multipart\fR Use 'multipart\-post' library instead of Curb/Curl .PP -IMAGE\-PATH: Path to the image to upload + +.PP +## ARGUMENT FORMATS +.TP +\fBfile\fR +.IP +Path to a file +.TP +\fBrange\fR +.IP +List of id's in the form 1,8..15 +.TP +\fBtext\fR +.IP +String +.PP +## LICENSE +OpenNebula 3.7.80 +Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +.PP +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 .SH COPYRIGHT Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) .PP diff --git a/share/man/occi-compute.1 b/share/man/occi-compute.1 index 095f2031c5..c2d6b05f5d 100644 --- a/share/man/occi-compute.1 +++ b/share/man/occi-compute.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "July 2012" "OpenNebula 3.7.0" "User Commands" +.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.7.80" "User Commands" .SH NAME OpenNebula \- OpenNebula occi-compute .SH SYNOPSIS @@ -60,6 +60,14 @@ provided \fBdelete\fR .IP deletes the compute resource idenfitied by +.TP +\fBattachdisk\fR +.IP +attaches an storage to a given compute +.TP +\fBdetachdisk\fR +.IP +detaches the target disk form the compute .SH COPYRIGHT Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) .PP diff --git a/share/man/occi-network.1 b/share/man/occi-network.1 index bf4c5948fb..63119ad5f4 100644 --- a/share/man/occi-network.1 +++ b/share/man/occi-network.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "July 2012" "OpenNebula 3.7.0" "User Commands" +.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.7.80" "User Commands" .SH NAME OpenNebula \- OpenNebula occi-network .SH SYNOPSIS diff --git a/share/man/occi-storage.1 b/share/man/occi-storage.1 index 4fda20bdd7..113d6c0d31 100644 --- a/share/man/occi-storage.1 +++ b/share/man/occi-storage.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "July 2012" "OpenNebula 3.7.0" "User Commands" +.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.7.80" "User Commands" .SH NAME OpenNebula \- OpenNebula occi-storage .SH SYNOPSIS @@ -68,6 +68,11 @@ provided \fBdelete\fR .IP deletes the storage resource idenfitied by +.TP +\fBclone\fR +.IP +clones the storage resource idenfitied by in a new one +using the given .SH COPYRIGHT Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) .PP diff --git a/share/man/oneacct.1 b/share/man/oneacct.1 index dc285514b1..129c908d20 100644 --- a/share/man/oneacct.1 +++ b/share/man/oneacct.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEACCT" "1" "September 2012" "" "oneacct(1) -- OpenNebula Accountin Tool" +.TH "ONEACCT" "1" "October 2012" "" "oneacct(1) -- OpenNebula Accountin Tool" . .SH "NAME" \fBoneacct\fR @@ -75,7 +75,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/oneacl.1 b/share/man/oneacl.1 index be4948e52a..f0a1870dd8 100644 --- a/share/man/oneacl.1 +++ b/share/man/oneacl.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEACL" "1" "July 2012" "" "oneacl(1) -- manages OpenNebula ACLs" +.TH "ONEACL" "1" "October 2012" "" "oneacl(1) -- manages OpenNebula ACLs" . .SH "NAME" \fBoneacl\fR @@ -14,6 +14,7 @@ .nf \-x, \-\-xml Show the resource in xml format + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -58,7 +59,7 @@ list .nf Lists the ACL rule set -valid options: xml +valid options: xml, describe . .fi . @@ -128,7 +129,7 @@ Comma\-separated list of OpenNebula ACL names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/onecluster.1 b/share/man/onecluster.1 index 4b97815adf..76446b5f8b 100644 --- a/share/man/onecluster.1 +++ b/share/man/onecluster.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONECLUSTER" "1" "July 2012" "" "onecluster(1) -- manages OpenNebula clusters" +.TH "ONECLUSTER" "1" "October 2012" "" "onecluster(1) -- manages OpenNebula clusters" . .SH "NAME" \fBonecluster\fR @@ -17,6 +17,7 @@ \-d, \-\-delay x Sets the delay in seconds for top command \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -61,7 +62,7 @@ list .nf Lists Clusters in the pool -valid options: list, delay, xml, numeric +valid options: list, delay, xml, numeric, describe . .fi . @@ -301,7 +302,7 @@ OpenNebula DATASTORE name or id .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/onedatastore.1 b/share/man/onedatastore.1 index b562710852..0b96f02d4f 100644 --- a/share/man/onedatastore.1 +++ b/share/man/onedatastore.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEDATASTORE" "1" "July 2012" "" "onedatastore(1) -- manages OpenNebula datastores" +.TH "ONEDATASTORE" "1" "October 2012" "" "onedatastore(1) -- manages OpenNebula datastores" . .SH "NAME" \fBonedatastore\fR @@ -18,6 +18,7 @@ \-d, \-\-delay x Sets the delay in seconds for top command \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -105,7 +106,7 @@ list .nf Lists Datastores in the pool -valid options: list, delay, xml, numeric +valid options: list, delay, xml, numeric, describe . .fi . @@ -261,7 +262,7 @@ OpenNebula USER name or id .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/onedb.1 b/share/man/onedb.1 index 9ece109827..c6dfcbc7f8 100644 --- a/share/man/onedb.1 +++ b/share/man/onedb.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEDB" "1" "July 2012" "" "onedb(1) -- OpenNebula database migration tool" +.TH "ONEDB" "1" "October 2012" "" "onedb(1) -- OpenNebula database migration tool" . .SH "NAME" \fBonedb\fR diff --git a/share/man/onegroup.1 b/share/man/onegroup.1 index 2847eeedbe..dc41cb6e39 100644 --- a/share/man/onegroup.1 +++ b/share/man/onegroup.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEGROUP" "1" "July 2012" "" "onegroup(1) -- manages OpenNebula groups" +.TH "ONEGROUP" "1" "October 2012" "" "onegroup(1) -- manages OpenNebula groups" . .SH "NAME" \fBonegroup\fR @@ -17,6 +17,7 @@ \-d, \-\-delay x Sets the delay in seconds for top command \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -61,7 +62,7 @@ list .nf Lists Groups in the pool -valid options: list, delay, xml, numeric +valid options: list, delay, xml, numeric, describe . .fi . @@ -97,6 +98,21 @@ will be launched to modify the current quotas\. . .IP "" 0 +. +.IP "\(bu" 4 +batchquota \fIrange|groupid_list\fR [\fIfile\fR] +. +.IP "" 4 +. +.nf + +Sets the quota limits in batch for various groups\. If a path is not +provided the editor will be launched to create new quotas\. +. +.fi +. +.IP "" 0 + . .IP "" 0 . @@ -175,7 +191,7 @@ Comma\-separated list of OpenNebula GROUP names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/onehost.1 b/share/man/onehost.1 index 5315022f26..d3b36a6089 100644 --- a/share/man/onehost.1 +++ b/share/man/onehost.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEHOST" "1" "July 2012" "" "onehost(1) -- manages OpenNebula hosts" +.TH "ONEHOST" "1" "October 2012" "" "onehost(1) -- manages OpenNebula hosts" . .SH "NAME" \fBonehost\fR @@ -22,6 +22,7 @@ \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs \-k, \-\-kilobytes Show units in kilobytes + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -126,7 +127,7 @@ list .nf Lists Hosts in the pool -valid options: list, delay, xml, numeric, kilobytes +valid options: list, delay, xml, numeric, kilobytes, describe . .fi . @@ -254,7 +255,7 @@ Comma\-separated list of OpenNebula HOST names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/oneimage.1 b/share/man/oneimage.1 index 2c6c45d758..082f6b19ff 100644 --- a/share/man/oneimage.1 +++ b/share/man/oneimage.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEIMAGE" "1" "July 2012" "" "oneimage(1) -- manages OpenNebula images" +.TH "ONEIMAGE" "1" "October 2012" "" "oneimage(1) -- manages OpenNebula images" . .SH "NAME" \fBoneimage\fR @@ -14,10 +14,23 @@ .nf \-d, \-\-datastore id|name Selects the datastore + \-\-name name Name of the new image + \-\-description description Description for the new Image + \-\-type type Type of the new Image: OS, CDROM or DATABLOCK + \-\-persistent Tells if the image will be persistent + \-\-prefix prefix Device prefix for the disk (eg\. hd, sd, xvd or vd) + \-\-target target Device the disk will be attached to + \-\-path path Path of the image file + \-\-driver driver Driver to use image (raw, qcow2, tap:aio:\.\.\.) + \-\-disk_type disk_type Type of the image (BLOCK, CDROM or FILE) + \-\-source source Source to be used\. Useful for not file\-based images + \-\-size size Size in MB\. Used for DATABLOCK type + \-\-fstype fstype Type of file system to be built\. This can be any value understood by mkfs unix command\. \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -27,14 +40,33 @@ .SH "COMMANDS" . .IP "\(bu" 4 -create \fIfile\fR +create [\fIfile\fR] . .IP "" 4 . .nf -Creates a new Image from the given template file -valid options: datastore +Creates a new Image +Examples: + \- using a template description file: + + oneimage create \-d default centOS\.tmpl + + \- new image "arch" using a path of type centOS: + + oneimage create \-d default \-\-name arch \-\-path /tmp/arch\.img + + \- new persistent image, OS type and qcow2 format: + + oneimage create \-d 1 \-\-name ubuntu \-\-path /tmp/ubuntu\.qcow2 \e + \-\-prefix sd \-\-type OS \-\-driver qcow2 \e + \-\-description "A OS plain installation" + + \- a datablock image of 400MB: + + oneimage create \-d 1 \-\-name data \-\-type DATABLOCK \-\-size 400 \e + \-\-fstype ext2 +valid options: datastore, name, description, type, persistent, prefix, target, path, driver, disk_type, source, size, fstype . .fi . @@ -237,7 +269,7 @@ list [\fIfilterflag\fR] .nf Lists Images in the pool -valid options: list, delay, xml, numeric +valid options: list, delay, xml, numeric, describe . .fi . @@ -267,7 +299,7 @@ top [\fIfilterflag\fR] .nf Lists Images continuously -valid options: list, delay, xml, numeric +valid options: list, delay, xml, numeric, describe . .fi . @@ -398,7 +430,7 @@ user IMAGE of the user identified by the username .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/onetemplate.1 b/share/man/onetemplate.1 index 2812dfd099..045a8b3867 100644 --- a/share/man/onetemplate.1 +++ b/share/man/onetemplate.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONETEMPLATE" "1" "July 2012" "" "onetemplate(1) -- manages OpenNebula templates" +.TH "ONETEMPLATE" "1" "October 2012" "" "onetemplate(1) -- manages OpenNebula templates" . .SH "NAME" \fBonetemplate\fR @@ -13,7 +13,14 @@ . .nf - \-n, \-\-name vm_name Name of the new Virtual Machine\. When instantiating + \-\-name name Name for the VM + \-\-cpu cpu CPU percentage reserved for the VM (1=100% one CPU) + \-\-arch arch Architecture of the VM, e\.g\.: i386 or x86_64 + \-\-memory memory Memory ammount given to the VM + \-\-disk disk0,disk1 Disks to attach\. To use a disk owned by other user use user[disk] + \-\-network network0,network1 Networks to attach\. To use a network owned by other user use user[network] + \-\-raw string Raw string to add to the template\. Not to be confused with the RAW attribute + \-\-name vm_name Name of the new Virtual Machine\. When instantiating multiple VMs you can use the"%i" wildcard to produce different names such as vm\-0, vm\-1\.\.\. @@ -22,6 +29,7 @@ \-d, \-\-delay x Sets the delay in seconds for top command \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -31,13 +39,28 @@ .SH "COMMANDS" . .IP "\(bu" 4 -create \fIfile\fR +create [\fIfile\fR] . .IP "" 4 . .nf -Creates a new Template from the given template file +Creates a new VM Template from the given description + +Examples: + \- using a VM Template description file: + + onetemplate create vm_description\.tmpl + + \- new VM Template named "arch vm" with a disk and a nic: + + onetemplate create \-\-name "arch vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch \e + \-\-network private_lan + + \- using two disks: + + onevm create \-\-name "test vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch,data +valid options: name, cpu, arch, memory, disk, network, raw . .fi . @@ -184,7 +207,7 @@ list [\fIfilterflag\fR] .nf Lists Templates in the pool -valid options: list, delay, xml, numeric +valid options: list, delay, xml, numeric, describe . .fi . @@ -214,7 +237,7 @@ top [\fIfilterflag\fR] .nf Lists Templates continuously -valid options: list, delay, xml, numeric +valid options: list, delay, xml, numeric, describe . .fi . @@ -345,7 +368,7 @@ user VMTEMPLATE of the user identified by the username .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/oneuser.1 b/share/man/oneuser.1 index 58dada1657..dddef6e821 100644 --- a/share/man/oneuser.1 +++ b/share/man/oneuser.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEUSER" "1" "July 2012" "" "oneuser(1) -- manages OpenNebula users" +.TH "ONEUSER" "1" "October 2012" "" "oneuser(1) -- manages OpenNebula users" . .SH "NAME" \fBoneuser\fR @@ -27,6 +27,7 @@ \-d, \-\-delay x Sets the delay in seconds for top command \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -85,6 +86,21 @@ will be launched to modify the current quotas\. . .IP "" 0 +. +.IP "\(bu" 4 +batchquota \fIrange|userid_list\fR [\fIfile\fR] +. +.IP "" 4 +. +.nf + +Sets the quota limits in batch for various users\. If a path is not +provided the editor will be launched to create new quotas\. +. +.fi +. +.IP "" 0 + . .IP "\(bu" 4 login \fIusername\fR @@ -96,8 +112,10 @@ login \fIusername\fR Creates the Login token for authentication Examples: oneuser login my_user \-\-ssh \-\-key /tmp/id_rsa \-\-time 72000 - oneuser login my_user \-\-x509 \-\-cert /tmp/my_cert\.pem \-\-key /tmp/my_key\.pk \-\-time 72000 - oneuser login my_user \-\-x509_proxy \-\-proxy /tmp/my_cert\.pem \-\-time 72000 + oneuser login my_user \-\-x509 \-\-cert /tmp/my_cert\.pem + \-\-key /tmp/my_key\.pk \-\-time 72000 + oneuser login my_user \-\-x509_proxy \-\-proxy /tmp/my_cert\.pem + \-\-time 72000 valid options: ssh, x509, x509_proxy, key, cert, proxy, time . .fi @@ -112,6 +130,8 @@ key . .nf +DEPRECATED, use login to generate auth files\. + Shows a public key from a private SSH key\. Use it as password for the SSH authentication mechanism\. valid options: key @@ -194,7 +214,7 @@ list .nf Lists Users in the pool -valid options: list, delay, xml, numeric +valid options: list, delay, xml, numeric, describe . .fi . @@ -335,7 +355,7 @@ User password .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/onevdc.1 b/share/man/onevdc.1 index cc12b87cc8..e38a080723 100644 --- a/share/man/onevdc.1 +++ b/share/man/onevdc.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEVDC" "1" "July 2012" "" "onevdc(1) -- manages OpenNebula Virtual DataCenters" +.TH "ONEVDC" "1" "October 2012" "" "onevdc(1) -- manages OpenNebula Virtual DataCenters" . .SH "NAME" \fBonevdc\fR @@ -178,7 +178,7 @@ VDC ID .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/onevm.1 b/share/man/onevm.1 index 0b8fc79fed..e202859e53 100644 --- a/share/man/onevm.1 +++ b/share/man/onevm.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEVM" "1" "July 2012" "" "onevm(1) -- manages OpenNebula virtual machines" +.TH "ONEVM" "1" "October 2012" "" "onevm(1) -- manages OpenNebula virtual machines" . .SH "NAME" \fBonevm\fR @@ -14,15 +14,23 @@ .nf \-m, \-\-multiple x Instance multiple VMs - \-x, \-\-xml Show the resource in xml format - \-n, \-\-numeric Do not translate user and group IDs - \-k, \-\-kilobytes Show units in kilobytes + \-\-name name Name for the VM + \-\-cpu cpu CPU percentage reserved for the VM (1=100% one CPU) + \-\-arch arch Architecture of the VM, e\.g\.: i386 or x86_64 + \-\-memory memory Memory ammount given to the VM + \-\-disk disk0,disk1 Disks to attach\. To use a disk owned by other user use user[disk] + \-\-network network0,network1 Networks to attach\. To use a network owned by other user use user[network] + \-\-raw string Raw string to add to the template\. Not to be confused with the RAW attribute \-t, \-\-type type Type of the new Image \-f, \-\-file file Selects the template file \-i, \-\-image id|name Selects the image \-t, \-\-target type Device where the image will be attached \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command + \-x, \-\-xml Show the resource in xml format + \-n, \-\-numeric Do not translate user and group IDs + \-k, \-\-kilobytes Show units in kilobytes + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -32,16 +40,30 @@ .SH "COMMANDS" . .IP "\(bu" 4 -create \fIfile\fR +create [\fIfile\fR] . .IP "" 4 . .nf -Creates a new VM from the given template file\. This command bypasses -the Template pool, which is the preferred way to instantiate new VMs\. -See \'onetemplate create\' and \'onetemplate instantiate\' -valid options: multiple, xml, numeric, kilobytes +Creates a new VM from the given description instead of using a previously +defined template (see \'onetemplate create\' and \'onetemplate instantiate\')\. + +Examples: + + \- using a template description file: + + onevm create vm_description\.tmpl + + \- new VM named "arch vm" with a disk and a nic + + onevm create \-\-name "arch vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch \e + \-\-network private_lan + + \- a vm with two disks + + onevm create \-\-name "test vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch,data +valid options: multiple, name, cpu, arch, memory, disk, network, raw . .fi . @@ -105,8 +127,8 @@ saveas \fIvmid\fR \fIdiskid\fR \fIimg_name\fR .nf Sets the specified VM disk to be saved in a new Image\. The Image is -created inmediately, but the contents are saved only if the VM is -shut down gracefuly (i\.e\., using \'onevm shutdown\' and not +created immediately, but the contents are saved only if the VM is +shut down gracefully (i\.e\., using \'onevm shutdown\' and not \'onevm delete\') States: ANY @@ -124,7 +146,24 @@ shutdown \fIrange|vmid_list\fR . .nf -Shuts down the given VM\. +Shuts down the given VM\. The VM life cycle will end\. + +States: RUNNING +. +.fi +. +.IP "" 0 + +. +.IP "\(bu" 4 +poweroff \fIrange|vmid_list\fR +. +.IP "" 4 +. +.nf + +Powers off the given VM\. The VM will remain in the poweroff state, and +can be powered on with the \'onevm restart\' command\. States: RUNNING . @@ -223,9 +262,9 @@ restart \fIrange|vmid_list\fR . .nf -Forces a re\-deployment of the given VM, issuing a boot action\. +Boots the given VM\. -States: UNKNOWN, BOOT +States: UNKNOWN, BOOT, POWEROFF . .fi . @@ -239,9 +278,9 @@ resubmit \fIrange|vmid_list\fR . .nf -Resubmits the VM to PENDING state\. This is intented for VMs stuck in a +Resubmits the VM to PENDING state\. This is intended for VMs stuck in a transient state\. To re\-deploy a fresh copy of the same VM, create a -Template and instantiante it, see \'onetemplate instantiate\' +Template and instantiate it, see \'onetemplate instantiate\' States: ANY, except SUSPENDED or DONE . @@ -435,7 +474,7 @@ list [\fIfilterflag\fR] .nf Lists VMs in the pool -valid options: list, delay, xml, numeric, kilobytes +valid options: list, delay, xml, numeric, kilobytes, describe . .fi . @@ -624,7 +663,7 @@ Integer .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/onevnet.1 b/share/man/onevnet.1 index e505d13b84..51db8211b4 100644 --- a/share/man/onevnet.1 +++ b/share/man/onevnet.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEVNET" "1" "July 2012" "" "onevnet(1) -- manages OpenNebula networks" +.TH "ONEVNET" "1" "October 2012" "" "onevnet(1) -- manages OpenNebula networks" . .SH "NAME" \fBonevnet\fR @@ -19,6 +19,7 @@ \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs \-k, \-\-kilobytes Show units in kilobytes + \-\-describe Describe list columns \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information @@ -193,7 +194,7 @@ list [\fIfilterflag\fR] .nf Lists Virtual Networks in the pool -valid options: list, delay, xml, numeric, kilobytes +valid options: list, delay, xml, numeric, kilobytes, describe . .fi . @@ -354,7 +355,7 @@ user VNET of the user identified by the username .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/share/man/onezone.1 b/share/man/onezone.1 index 75e46f9f43..af90966d3f 100644 --- a/share/man/onezone.1 +++ b/share/man/onezone.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEZONE" "1" "July 2012" "" "onezone(1) -- manages OpenNebula zones" +.TH "ONEZONE" "1" "October 2012" "" "onezone(1) -- manages OpenNebula zones" . .SH "NAME" \fBonezone\fR @@ -148,7 +148,7 @@ Zone ID .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.7\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.7\.80 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) . .P 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 diff --git a/src/cloud/common/CloudClient.rb b/src/cloud/common/CloudClient.rb index 9b781fadab..46dd9b8147 100644 --- a/src/cloud/common/CloudClient.rb +++ b/src/cloud/common/CloudClient.rb @@ -52,7 +52,7 @@ end module CloudClient # OpenNebula version - VERSION = '3.7.0' + VERSION = '3.7.80' # ######################################################################### # Default location for the authentication file diff --git a/src/cloud/occi/lib/ui/templates/login.html b/src/cloud/occi/lib/ui/templates/login.html index 0f7af9f3dd..a9e412093e 100644 --- a/src/cloud/occi/lib/ui/templates/login.html +++ b/src/cloud/occi/lib/ui/templates/login.html @@ -53,7 +53,7 @@ diff --git a/src/cloud/occi/lib/ui/views/index.erb b/src/cloud/occi/lib/ui/views/index.erb index 7453100052..de88128782 100644 --- a/src/cloud/occi/lib/ui/views/index.erb +++ b/src/cloud/occi/lib/ui/views/index.erb @@ -81,7 +81,7 @@ diff --git a/src/oca/ruby/OpenNebula.rb b/src/oca/ruby/OpenNebula.rb index 43da8be78e..6374c04051 100644 --- a/src/oca/ruby/OpenNebula.rb +++ b/src/oca/ruby/OpenNebula.rb @@ -52,7 +52,7 @@ require 'OpenNebula/DocumentPool' module OpenNebula # OpenNebula version - VERSION = '3.7.0' + VERSION = '3.7.80' # The Error Class represents a generic error in the OpenNebula # library. It contains a readable representation of the error. diff --git a/src/ozones/Server/templates/index.html b/src/ozones/Server/templates/index.html index 6c9364153d..c2ca6e1db9 100644 --- a/src/ozones/Server/templates/index.html +++ b/src/ozones/Server/templates/index.html @@ -65,7 +65,7 @@
diff --git a/src/ozones/Server/templates/login.html b/src/ozones/Server/templates/login.html index 47d4f9d36e..08a4e85d0e 100644 --- a/src/ozones/Server/templates/login.html +++ b/src/ozones/Server/templates/login.html @@ -49,7 +49,7 @@
diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index 5b466ff8f8..90867c883b 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -94,7 +94,7 @@ diff --git a/src/sunstone/views/login.erb b/src/sunstone/views/login.erb index 30147df259..ab06fcc823 100644 --- a/src/sunstone/views/login.erb +++ b/src/sunstone/views/login.erb @@ -36,7 +36,7 @@