diff --git a/NOTICE b/NOTICE index a60de3f651..d5e4daa42a 100644 --- a/NOTICE +++ b/NOTICE @@ -1,7 +1,6 @@ OpenNebula Open Source Project -------------------------------------------------------------------------------- -Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) -Copyright 2010-2012, C12G Labs S.L. (C12G.com) +Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs -------------------------------------------------------------------------------- You can find more information about the project, release notes and diff --git a/README.md b/README.md index 1261b2301c..687277f083 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ Support mailing list: http://opennebula.org/support:support ## LICENSE -Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs 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 diff --git a/SConstruct b/SConstruct index 78485245f4..4b1b9813af 100644 --- a/SConstruct +++ b/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/include/AclManager.h b/include/AclManager.h index d4401cbff1..e4e0fe7b1c 100644 --- a/include/AclManager.h +++ b/include/AclManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -108,6 +108,13 @@ public: */ void del_gid_rules(int gid); + /** + * Deletes rules that apply to this cluster id + * + * @param cid The cluster id + */ + void del_cid_rules(int cid); + /** * Deletes all rules that apply to this resource * @@ -127,6 +134,7 @@ public: * @param all True if the user can perform the operation over any object * @param oids Set of object IDs over which the user can operate * @param gids Set of object group IDs over which the user can operate + * @param cids Set of object cluster IDs over which the user can operate */ void reverse_search(int uid, int gid, @@ -134,7 +142,8 @@ public: AuthRequest::Operation op, bool& all, vector& oids, - vector& gids); + vector& gids, + vector& cids); /* ---------------------------------------------------------------------- */ /* DB management */ @@ -179,10 +188,12 @@ private: * @param user_req user/group id and flags * @param resource_oid_req 64 bit request, ob. type and individual oid * @param resource_gid_req 64 bit request, ob. type and group id + * @param resource_cid_req 64 bit request, ob. type and cluster id * @param resource_all_req 64 bit request, ob. type and all flag * @param rights_req Requested rights * @param individual_obj_type Mask with ob. type and individual flags * @param group_obj_type Mask with ob. type and group flags + * @param cluster_obj_type Mask with ob. type and cluster flags * @param rules ACL rules to match * * @return true if any rule grants permission @@ -191,10 +202,12 @@ private: long long user_req, long long resource_oid_req, long long resource_gid_req, + long long resource_cid_req, long long resource_all_req, long long rights_req, long long individual_obj_type, long long group_obj_type, + long long cluster_obj_type, multimap &rules); /** @@ -204,10 +217,12 @@ private: * @param user_req user/group id and flags * @param resource_oid_req 64 bit request, ob. type and individual oid * @param resource_gid_req 64 bit request, ob. type and group id + * @param resource_cid_req 64 bit request, ob. type and cluster id * @param resource_all_req 64 bit request, ob. type and all flag * @param rights_req Requested rights * @param individual_obj_type Mask with ob. type and individual flags * @param group_obj_type Mask with ob. type and group flags + * @param cluster_obj_type Mask with ob. type and cluster flags * @param tmp_rules Temporary map group of ACL rules * * @return true if any rule grants permission @@ -216,10 +231,12 @@ private: long long user_req, long long resource_oid_req, long long resource_gid_req, + long long resource_cid_req, long long resource_all_req, long long rights_req, long long individual_obj_type, long long group_obj_type, + long long cluster_obj_type, multimap &tmp_rules); /** diff --git a/include/AclRule.h b/include/AclRule.h index 57bf4c6fb2..46de7aea82 100644 --- a/include/AclRule.h +++ b/include/AclRule.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -36,10 +36,12 @@ public: // ------------------------------------------------------------------------ static const long long INDIVIDUAL_ID; - + static const long long GROUP_ID; static const long long ALL_ID; + + static const long long CLUSTER_ID; // ------------------------------------------------------------------------ /** @@ -50,9 +52,9 @@ public: /** * Main ACL rule constructor */ - AclRule(int _oid, - long long _user, - long long _resource, + AclRule(int _oid, + long long _user, + long long _resource, long long _rights): oid(_oid), user(_user), resource(_resource), rights(_rights) { @@ -64,8 +66,8 @@ public: */ void set(int _oid, - long long _user, - long long _resource, + long long _user, + long long _resource, long long _rights) { oid = _oid; @@ -189,8 +191,8 @@ private: int oid; /** - * 64 bit integer holding a user compound: - * + * 64 bit integer holding a user compound: + * * 32 bits 32 bits * +-----------------------+-----------------------+ * | Type (user,group,all) | user/group ID | @@ -200,7 +202,7 @@ private: /** * 64 bit integer holding a resource compound - * + * * 32 bits 32 bits * +-----------------------+-----------------------+ * | Type (VM, Host...) | resource ID | @@ -241,6 +243,11 @@ private: static const int num_auth_operations; static const AuthRequest::Operation auth_operations[]; + + /** + * Objects that cannot be used with the CLUSTER(%) selector + */ + static const long long INVALID_CLUSTER_OBJECTS; }; #endif /*ACL_RULE_H*/ diff --git a/include/ActionManager.h b/include/ActionManager.h index a23aada27d..741843fe3d 100644 --- a/include/ActionManager.h +++ b/include/ActionManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Attribute.h b/include/Attribute.h index 408f79678b..cd3b8f2881 100644 --- a/include/Attribute.h +++ b/include/Attribute.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -48,7 +48,7 @@ public: if ((size >0 && !isalpha(aname[0]))|| (size >=3 && (aname[0]=='X' && aname[1]=='M' && aname[2]=='L'))) { - attribute_name.insert(0,"ONE_"); + attribute_name.insert(0,"ONE_"); } }; @@ -198,7 +198,7 @@ public: */ Attribute* clone() const { - return new SingleAttribute(*this); + return new SingleAttribute(*this); }; private: @@ -246,6 +246,15 @@ public: */ string vector_value(const char *name) const; + /** + * Returns the boolean value + * @param name of the attribute + * @param value Bool value ("YES" is true) + * + * @return 0 on success, -1 otherwise + */ + int vector_value(const char *name, bool& value) const; + /** * Returns the integer value * @@ -336,7 +345,36 @@ public: oss << value; replace(name, oss.str()); - } + } + + /** + * Replace the value of the given vector attribute + */ + void replace(const string& name, const char* value) + { + string svalue(value); + + replace(name, svalue); + } + + /** + * Replace the value of the given vector attribute + */ + void replace(const string& name, bool value) + { + string b_value; + + if (value == true) + { + b_value = "YES"; + } + else + { + b_value = "NO"; + } + + replace(name, b_value); + } /** * Removes given the vector attribute @@ -357,7 +395,7 @@ public: */ Attribute* clone() const { - return new VectorAttribute(*this); + return new VectorAttribute(*this); }; private: diff --git a/include/AuthManager.h b/include/AuthManager.h index ea4da3ccb4..d620b38867 100644 --- a/include/AuthManager.h +++ b/include/AuthManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/AuthManagerDriver.h b/include/AuthManagerDriver.h index 3f560e5f0d..723f24d9f3 100644 --- a/include/AuthManagerDriver.h +++ b/include/AuthManagerDriver.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/AuthRequest.h b/include/AuthRequest.h index 2ae3e04471..b0b4a49e61 100644 --- a/include/AuthRequest.h +++ b/include/AuthRequest.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Callbackable.h b/include/Callbackable.h index 78146bb9bd..474aa833b7 100644 --- a/include/Callbackable.h +++ b/include/Callbackable.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Cluster.h b/include/Cluster.h index 2aa93e5e8d..822c2a28d0 100644 --- a/include/Cluster.h +++ b/include/Cluster.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -32,20 +32,13 @@ class Cluster : public PoolObjectSQL public: /** - * Returns the SYSTEM_DS attribute, or the system DS id if it is not defined + * Returns the SYSTEM_DS attribute * - * @return the SYSTEM_DS attribute, or the system DS id if it is not defined + * @return the SYSTEM_DS attribute */ int get_ds_id() { - int ds_id; - - if ( obj_template->get("SYSTEM_DS", ds_id) == false ) - { - ds_id = DatastorePool::SYSTEM_DS_ID; - } - - return ds_id; + return system_ds; } /** @@ -100,32 +93,11 @@ public: /** * Adds this datastore ID to the set. * @param id to be added to the cluster + * @param ds_type Datastore type * @param error_msg Error message, if any * @return 0 on success */ - int add_datastore(int id, string& error_msg) - { - // TODO: should fail for any system DS? - if ( id == DatastorePool::SYSTEM_DS_ID ) - { - ostringstream oss; - oss << "Datastore '"<< DatastorePool::SYSTEM_DS_NAME - << "' cannot be added to any cluster."; - - error_msg = oss.str(); - - return -1; - } - - int rc = datastores.add_collection_id(id); - - if ( rc < 0 ) - { - error_msg = "Datastore ID is already in the cluster set."; - } - - return rc; - } + int add_datastore(int id, Datastore::DatastoreType ds_type, string& error_msg); /** * Deletes this datastore ID from the set. @@ -133,17 +105,7 @@ public: * @param error_msg Error message, if any * @return 0 on success */ - int del_datastore(int id, string& error_msg) - { - int rc = datastores.del_collection_id(id); - - if ( rc < 0 ) - { - error_msg = "Datastore ID is not part of the cluster set."; - } - - return rc; - } + int del_datastore(int id, string& error_msg); /** * Adds this vnet ID to the set. @@ -219,13 +181,18 @@ private: virtual ~Cluster(){}; // ************************************************************************* - // Object Collections (Private) + // Attributes (Private) // ************************************************************************* ObjectCollection hosts; ObjectCollection datastores; ObjectCollection vnets; + /** + * System datastore id + */ + int system_ds; + // ************************************************************************* // DataBase implementation (Private) // ************************************************************************* diff --git a/include/ClusterPool.h b/include/ClusterPool.h index 35712708ed..008d97f7ac 100644 --- a/include/ClusterPool.h +++ b/include/ClusterPool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/ClusterTemplate.h b/include/ClusterTemplate.h index b317b2e592..e05d253d30 100644 --- a/include/ClusterTemplate.h +++ b/include/ClusterTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Clusterable.h b/include/Clusterable.h index 94bd133fed..93723c28a9 100644 --- a/include/Clusterable.h +++ b/include/Clusterable.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Datastore.h b/include/Datastore.h index a4b8d4243d..d89193b109 100644 --- a/include/Datastore.h +++ b/include/Datastore.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -195,6 +195,7 @@ private: int gid, const string& uname, const string& gname, + int umask, DatastoreTemplate* ds_template, int cluster_id, const string& cluster_name); diff --git a/include/DatastorePool.h b/include/DatastorePool.h index 07d607a749..e533228062 100644 --- a/include/DatastorePool.h +++ b/include/DatastorePool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -75,6 +75,7 @@ public: * @param gid the id of the group this object is assigned to * @param uname name of the user * @param gname name of the group + * @param umask permissions umask * @param ds_template Datastore definition template * @param oid the id assigned to the Datastore * @param cluster_id the id of the cluster this Datastore will belong to @@ -88,6 +89,7 @@ public: int gid, const string& uname, const string& gname, + int umask, DatastoreTemplate * ds_template, int * oid, int cluster_id, @@ -182,7 +184,7 @@ private: */ PoolObjectSQL * create() { - return new Datastore(-1,-1,"","", 0, -1, ""); + return new Datastore(-1,-1,"","", 0, 0, -1, ""); }; }; diff --git a/include/DatastoreTemplate.h b/include/DatastoreTemplate.h index d8856dbe2f..3f283f0a23 100644 --- a/include/DatastoreTemplate.h +++ b/include/DatastoreTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/DefaultQuotas.h b/include/DefaultQuotas.h index 9a90f4e239..eaad86273b 100644 --- a/include/DefaultQuotas.h +++ b/include/DefaultQuotas.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/DispatchManager.h b/include/DispatchManager.h index 4eb2a7eb3e..dfa9bff0a6 100644 --- a/include/DispatchManager.h +++ b/include/DispatchManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Document.h b/include/Document.h index fa3ec1fbc1..d6d61a6808 100644 --- a/include/Document.h +++ b/include/Document.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -127,6 +127,7 @@ protected: int gid, const string& uname, const string& gname, + int umask, int type, Template * _template_contents); diff --git a/include/DocumentPool.h b/include/DocumentPool.h index 47b5b96f7f..4665ca3f87 100644 --- a/include/DocumentPool.h +++ b/include/DocumentPool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -38,6 +38,7 @@ public: * @param gid the id of the group this object is assigned to * @param uname name of the owner user * @param gname name of the group + * @param umask permissions umask * @param type for the new Document * @param template_contents a Template object * @param oid the id assigned to the Document @@ -49,13 +50,14 @@ public: int gid, const string& uname, const string& gname, + int umask, int type, Template * template_contents, int * oid, string& error_str) { *oid = PoolSQL::allocate( - new Document(-1, uid, gid, uname, gname, type, template_contents), + new Document(-1, uid, gid, uname, gname, umask, type, template_contents), error_str); return *oid; @@ -115,7 +117,7 @@ private: */ PoolObjectSQL * create() { - return new Document(-1,-1,-1,"","",0,0); + return new Document(-1,-1,-1,"","",0,0,0); }; }; diff --git a/include/FixedLeases.h b/include/FixedLeases.h index 89ae6b6c62..743cc5f3df 100644 --- a/include/FixedLeases.h +++ b/include/FixedLeases.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Group.h b/include/Group.h index 3a080e0566..37c8f9d590 100644 --- a/include/Group.h +++ b/include/Group.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/GroupPool.h b/include/GroupPool.h index 43302daf2c..0ce5813b36 100644 --- a/include/GroupPool.h +++ b/include/GroupPool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/History.h b/include/History.h index a3bcd71758..942f8068b6 100644 --- a/include/History.h +++ b/include/History.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Hook.h b/include/Hook.h index 6995756730..5dd29a8f90 100644 --- a/include/Hook.h +++ b/include/Hook.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/HookManager.h b/include/HookManager.h index 5f1ad6c347..13faa936b9 100644 --- a/include/HookManager.h +++ b/include/HookManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/HookManagerDriver.h b/include/HookManagerDriver.h index 3209fea2a2..164eff6670 100644 --- a/include/HookManagerDriver.h +++ b/include/HookManagerDriver.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Host.h b/include/Host.h index 532e8c18aa..58e83dd1a4 100644 --- a/include/Host.h +++ b/include/Host.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/HostHook.h b/include/HostHook.h index cac20cdcfe..eca6c21ef2 100644 --- a/include/HostHook.h +++ b/include/HostHook.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/HostPool.h b/include/HostPool.h index 7d72895294..4b0e2a9a1d 100644 --- a/include/HostPool.h +++ b/include/HostPool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/HostShare.h b/include/HostShare.h index 8dfcbf6e33..c7321a3662 100644 --- a/include/HostShare.h +++ b/include/HostShare.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/HostTemplate.h b/include/HostTemplate.h index c2f9195c21..b040691aa3 100644 --- a/include/HostTemplate.h +++ b/include/HostTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Image.h b/include/Image.h index d23530fadc..f5626477ed 100644 --- a/include/Image.h +++ b/include/Image.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -615,6 +615,7 @@ protected: int gid, const string& uname, const string& gname, + int umask, ImageTemplate* img_template); virtual ~Image(); diff --git a/include/ImageManager.h b/include/ImageManager.h index 91e02129e8..6fcc6012ba 100644 --- a/include/ImageManager.h +++ b/include/ImageManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/ImageManagerDriver.h b/include/ImageManagerDriver.h index 1fcbe56641..785f08029a 100644 --- a/include/ImageManagerDriver.h +++ b/include/ImageManagerDriver.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/ImagePool.h b/include/ImagePool.h index a2ef77a4e1..ed55a17d0f 100644 --- a/include/ImagePool.h +++ b/include/ImagePool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -54,6 +54,7 @@ public: * @param gid the id of the group this object is assigned to * @param uname name of the user * @param gname name of the group + * @param umask permissions umask * @param img_template template associated with the image * @param ds_id the id of the datastore * @param ds_name the name of the datastore @@ -73,6 +74,7 @@ public: int gid, const string& uname, const string& gname, + int umask, ImageTemplate * img_template, int ds_id, const string& ds_name, @@ -219,7 +221,7 @@ private: */ PoolObjectSQL * create() { - return new Image(-1,-1,"","",0); + return new Image(-1,-1,"","",0,0); }; }; diff --git a/include/ImageTemplate.h b/include/ImageTemplate.h index b30f7d2738..7f7b0b2a43 100644 --- a/include/ImageTemplate.h +++ b/include/ImageTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/InformationManager.h b/include/InformationManager.h index b48af6f86e..de6007acea 100644 --- a/include/InformationManager.h +++ b/include/InformationManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/InformationManagerDriver.h b/include/InformationManagerDriver.h index da85f5ccda..91b0c3e8dd 100644 --- a/include/InformationManagerDriver.h +++ b/include/InformationManagerDriver.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Leases.h b/include/Leases.h index d6adc8040e..705f7008d1 100644 --- a/include/Leases.h +++ b/include/Leases.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/LibVirtDriver.h b/include/LibVirtDriver.h index 081124bc38..97945b6361 100644 --- a/include/LibVirtDriver.h +++ b/include/LibVirtDriver.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/LifeCycleManager.h b/include/LifeCycleManager.h index 5c280618aa..34d7eece7c 100644 --- a/include/LifeCycleManager.h +++ b/include/LifeCycleManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -62,6 +62,8 @@ public: ATTACH_FAILURE, /**< Sent by the VMM when an attach action fails */ DETACH_SUCCESS, /**< Sent by the VMM when a detach action succeeds */ DETACH_FAILURE, /**< Sent by the VMM when a detach action fails */ + CLEANUP_SUCCESS, /**< Sent by the VMM when a cleanup action succeeds */ + CLEANUP_FAILURE, /**< Sent by the VMM when a cleanup action fails */ DEPLOY, /**< Sent by the DM to deploy a VM on a host */ SUSPEND, /**< Sent by the DM to suspend an running VM */ RESTORE, /**< Sent by the DM to restore a suspended VM */ @@ -145,7 +147,7 @@ private: * the history registers * @param vm with the lock aquired */ - void clean_up_vm (VirtualMachine *vm); + void clean_up_vm (VirtualMachine *vm, bool dispose); void save_success_action(int vid); @@ -185,6 +187,8 @@ private: void detach_failure_action(int vid); + void cleanup_callback_action(int vid); + void deploy_action(int vid); void suspend_action(int vid); diff --git a/include/Log.h b/include/Log.h index e4539a2665..49d96d7ae2 100644 --- a/include/Log.h +++ b/include/Log.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Mad.h b/include/Mad.h index 9b46424f38..79188ab2fb 100644 --- a/include/Mad.h +++ b/include/Mad.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/MadManager.h b/include/MadManager.h index 43cfd434f5..d49d895ee9 100644 --- a/include/MadManager.h +++ b/include/MadManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/MySqlDB.h b/include/MySqlDB.h index f2475bae70..5e4643abaf 100644 --- a/include/MySqlDB.h +++ b/include/MySqlDB.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Nebula.h b/include/Nebula.h index 6cd0963af5..aeb2dea417 100644 --- a/include/Nebula.h +++ b/include/Nebula.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -288,11 +288,19 @@ public: return oss.str(); }; + /** + * Returns the name of the host running oned + * @return the name + */ const string& get_nebula_hostname() { return hostname; }; + /** + * Returns the version of oned + * @return the version + */ static string version() { return "OpenNebula 3.9.0"; @@ -303,32 +311,74 @@ public: return "3.9.0"; } + /** + * Starts all the modules and services for OpenNebula + */ void start(); + // ----------------------------------------------------------------------- + // Configuration attributes (read from oned.conf) + // ----------------------------------------------------------------------- + + /** + * Gets a configuration attribute for oned + * @param name of the attribute + * @param value of the attribute + */ void get_configuration_attribute( const char * name, string& value) const { string _name(name); - nebula_configuration->Template::get(_name,value); + nebula_configuration->Template::get(_name, value); }; + /** + * Gets a configuration attribute for oned, bool version + */ + void get_configuration_attribute( + const char * name, + bool& value) const + { + string _name(name); + + nebula_configuration->Template::get(_name, value); + }; + + /** + * Gets an XML document with all of the configuration attributes + * @return the XML + */ string get_configuration_xml() const { string xml; return nebula_configuration->to_xml(xml); }; + // ----------------------------------------------------------------------- + // Default Quotas + // ----------------------------------------------------------------------- + + /** + * Get the default quotas for OpenNebula users + * @return the default quotas + */ const DefaultQuotas& get_default_user_quota() { return default_user_quota; }; + /** + * Set the default quotas for OpenNebula users + * @param tmpl template with the default quotas + * @param error describes the error if any + * + * @return 0 if success + */ int set_default_user_quota(Template *tmpl, string& error) { - int rc; - rc = default_user_quota.set(tmpl, error); + int rc = default_user_quota.set(tmpl, error); if ( rc == 0 ) { @@ -338,15 +388,25 @@ public: return rc; }; + /** + * Get the default quotas for OpenNebula for groups + * @return the default quotas + */ const DefaultQuotas& get_default_group_quota() { return default_group_quota; }; + /** + * Set the default quotas for OpenNebula groups + * @param tmpl template with the default quotas + * @param error describes the error if any + * + * @return 0 if success + */ int set_default_group_quota(Template *tmpl, string& error) { - int rc; - rc = default_group_quota.set(tmpl, error); + int rc = default_group_quota.set(tmpl, error); if ( rc == 0 ) { diff --git a/include/NebulaLog.h b/include/NebulaLog.h index 47bea21c19..9eaf902606 100644 --- a/include/NebulaLog.h +++ b/include/NebulaLog.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/NebulaTemplate.h b/include/NebulaTemplate.h index 4254d8544c..c264942ef9 100644 --- a/include/NebulaTemplate.h +++ b/include/NebulaTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/ObjectCollection.h b/include/ObjectCollection.h index 4d11b25f32..c621c9de39 100644 --- a/include/ObjectCollection.h +++ b/include/ObjectCollection.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/ObjectSQL.h b/include/ObjectSQL.h index 837dbf3115..0683d2f663 100644 --- a/include/ObjectSQL.h +++ b/include/ObjectSQL.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/ObjectXML.h b/include/ObjectXML.h index a018cc3325..e8e71502f8 100644 --- a/include/ObjectXML.h +++ b/include/ObjectXML.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -148,6 +148,18 @@ public: */ int get_nodes(const char * xpath_expr, vector& content); + /** + * Adds a copy of the node as a child of the node in the xpath expression. + * The source node must be cleaned by the caller. + * + * @param xpath_expr Path of the parent node + * @param node Node copy and add + * @param new_name New name for the node copy + * + * @return 0 on success, -1 otherwise + */ + int add_node(const char * xpath_expr, xmlNodePtr node, const char * new_name); + /** * Frees a vector of XMLNodes, as returned by the get_nodes function * @param content the vector of xmlNodePtr diff --git a/include/OneClient.h b/include/OneClient.h index 27125481f8..dada53c852 100644 --- a/include/OneClient.h +++ b/include/OneClient.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/PoolObjectAuth.h b/include/PoolObjectAuth.h index 12bcf40dea..3c1f3bcc8f 100644 --- a/include/PoolObjectAuth.h +++ b/include/PoolObjectAuth.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -34,6 +34,7 @@ public: oid(-1), uid(-1), gid(-1), + cid(-1), owner_u(1), owner_m(1), owner_a(0), @@ -60,6 +61,7 @@ public: int oid; int uid; int gid; + int cid; int owner_u; int owner_m; diff --git a/include/PoolObjectSQL.h b/include/PoolObjectSQL.h index 31428d4577..d9f77426d8 100644 --- a/include/PoolObjectSQL.h +++ b/include/PoolObjectSQL.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -110,7 +110,7 @@ public: other_u(0), other_m(0), other_a(0), - obj_template(0), + obj_template(0), table(_table) { pthread_mutex_init(&mutex,0); @@ -164,7 +164,7 @@ public: { return gname; }; - + /** * Changes the object's owner * @param _uid New User ID @@ -349,6 +349,21 @@ public: return obj_template->get(name,value); } + /** + * Gets a boolean attribute (single) (YES = true) + * @param name of the attribute + * @param value of the attribute (True if "YES", false otherwise) + * + * @return True if the Single attribute was found and is a valid boolean + * value + */ + bool get_template_attribute( + const char * name, + bool& value) const + { + return obj_template->get(name,value); + } + /** * Adds a new attribute to the template (replacing it if * already defined), the object's mutex SHOULD be locked @@ -503,6 +518,14 @@ protected: } }; + /** + * Initializes the object's permissions, according to the provided umask. + * + * @param umask Permission mask, similar to unix umask. + * For example a umask of 137 will set the permissions "um- u-- ---" + */ + void set_umask(int umask); + /** * The object's unique ID */ diff --git a/include/PoolSQL.h b/include/PoolSQL.h index 71380880fd..8febb8dd77 100644 --- a/include/PoolSQL.h +++ b/include/PoolSQL.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Quota.h b/include/Quota.h index 0a7122196f..01eb24b885 100644 --- a/include/Quota.h +++ b/include/Quota.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/QuotaDatastore.h b/include/QuotaDatastore.h index b37fe53c68..2d7eb305b5 100644 --- a/include/QuotaDatastore.h +++ b/include/QuotaDatastore.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/QuotaImage.h b/include/QuotaImage.h index 57a8c8e759..7a3e8e2f2f 100644 --- a/include/QuotaImage.h +++ b/include/QuotaImage.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/QuotaNetwork.h b/include/QuotaNetwork.h index 2bb4d6d6d1..57faad4806 100644 --- a/include/QuotaNetwork.h +++ b/include/QuotaNetwork.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/QuotaVirtualMachine.h b/include/QuotaVirtualMachine.h index 3d33eb9f10..622ea5c439 100644 --- a/include/QuotaVirtualMachine.h +++ b/include/QuotaVirtualMachine.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Quotas.h b/include/Quotas.h index fb6392540f..f42761ab06 100644 --- a/include/Quotas.h +++ b/include/Quotas.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RangedLeases.h b/include/RangedLeases.h index 27547bf7fb..14277acb72 100644 --- a/include/RangedLeases.h +++ b/include/RangedLeases.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Request.h b/include/Request.h index ea73ae2f58..214f1fc9ec 100644 --- a/include/Request.h +++ b/include/Request.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManager.h b/include/RequestManager.h index e942c716d8..e568557ac0 100644 --- a/include/RequestManager.h +++ b/include/RequestManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerAcl.h b/include/RequestManagerAcl.h index 8b920eeedf..02e1b96d0c 100644 --- a/include/RequestManagerAcl.h +++ b/include/RequestManagerAcl.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerAllocate.h b/include/RequestManagerAllocate.h index 7e8f67f9ed..48e494a434 100644 --- a/include/RequestManagerAllocate.h +++ b/include/RequestManagerAllocate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -65,7 +65,8 @@ protected: Template * tmpl, int& id, string& error_str, - RequestAttributes& att) + RequestAttributes& att, + int umask) { return -1; }; @@ -76,9 +77,10 @@ protected: string& error_str, RequestAttributes& att, int cluster_id, - const string& cluster_name) + const string& cluster_name, + int umask) { - return pool_allocate(_paramList, tmpl, id, error_str, att); + return pool_allocate(_paramList, tmpl, id, error_str, att, umask); }; virtual int get_cluster_id(xmlrpc_c::paramList const& paramList) @@ -86,11 +88,20 @@ protected: return ClusterPool::NONE_CLUSTER_ID; }; - virtual int add_to_cluster(Cluster* cluster, int id, string& error_msg) + virtual int add_to_cluster( + Cluster* cluster, + int id, + Datastore::DatastoreType ds_type, + string& error_msg) { return -1; }; + virtual Datastore::DatastoreType get_ds_type(int oid) + { + return Datastore::FILE_DS; + }; + protected: ClusterPool * clpool; @@ -130,7 +141,8 @@ public: Template * tmpl, int& id, string& error_str, - RequestAttributes& att); + RequestAttributes& att, + int umask); bool allocate_authorization(Template * obj_template, RequestAttributes& att, @@ -169,14 +181,19 @@ public: string& error_str, RequestAttributes& att, int cluster_id, - const string& cluster_name); + const string& cluster_name, + int umask); int get_cluster_id(xmlrpc_c::paramList const& paramList) { return xmlrpc_c::value_int(paramList.getInt(2)); }; - int add_to_cluster(Cluster* cluster, int id, string& error_msg) + int add_to_cluster( + Cluster* cluster, + int id, + Datastore::DatastoreType ds_type, + string& error_msg) { return cluster->add_vnet(id, error_msg); }; @@ -237,7 +254,8 @@ public: Template * tmpl, int& id, string& error_str, - RequestAttributes& att); + RequestAttributes& att, + int umask); }; /* ------------------------------------------------------------------------- */ @@ -267,14 +285,19 @@ public: string& error_str, RequestAttributes& att, int cluster_id, - const string& cluster_name); + const string& cluster_name, + int umask); int get_cluster_id(xmlrpc_c::paramList const& paramList) { return xmlrpc_c::value_int(paramList.getInt(5)); }; - int add_to_cluster(Cluster* cluster, int id, string& error_msg) + int add_to_cluster( + Cluster* cluster, + int id, + Datastore::DatastoreType ds_type, + string& error_msg) { return cluster->add_host(id, error_msg); }; @@ -303,7 +326,8 @@ public: Template * tmpl, int& id, string& error_str, - RequestAttributes& att); + RequestAttributes& att, + int umask); void log_xmlrpc_param( const xmlrpc_c::value& v, @@ -334,7 +358,8 @@ public: Template * tmpl, int& id, string& error_str, - RequestAttributes& att); + RequestAttributes& att, + int umask); }; /* ------------------------------------------------------------------------- */ @@ -369,16 +394,35 @@ public: string& error_str, RequestAttributes& att, int cluster_id, - const string& cluster_name); + const string& cluster_name, + int umask); int get_cluster_id(xmlrpc_c::paramList const& paramList) { return xmlrpc_c::value_int(paramList.getInt(2)); }; - int add_to_cluster(Cluster* cluster, int id, string& error_msg) + virtual Datastore::DatastoreType get_ds_type(int oid) { - return cluster->add_datastore(id, error_msg); + Datastore::DatastoreType ds_type = Datastore::FILE_DS; + Datastore *ds = static_cast(pool)->get(oid, true); + + if ( ds != 0 ) + { + ds_type = ds->get_type(); + ds->unlock(); + } + + return ds_type; + }; + + int add_to_cluster( + Cluster* cluster, + int id, + Datastore::DatastoreType ds_type, + string& error_msg) + { + return cluster->add_datastore(id, ds_type, error_msg); }; }; @@ -405,7 +449,8 @@ public: Template * tmpl, int& id, string& error_str, - RequestAttributes& att); + RequestAttributes& att, + int umask); }; /* ------------------------------------------------------------------------- */ @@ -438,7 +483,8 @@ public: Template * tmpl, int& id, string& error_str, - RequestAttributes& att); + RequestAttributes& att, + int umask); }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerChmod.h b/include/RequestManagerChmod.h index cbee7a81dd..754196a17a 100644 --- a/include/RequestManagerChmod.h +++ b/include/RequestManagerChmod.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerChown.h b/include/RequestManagerChown.h index 2fa0494cf5..64382a3eac 100644 --- a/include/RequestManagerChown.h +++ b/include/RequestManagerChown.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerClone.h b/include/RequestManagerClone.h index 37d1428e30..9ef0c54a8f 100644 --- a/include/RequestManagerClone.h +++ b/include/RequestManagerClone.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -49,7 +49,8 @@ protected: Template * tmpl, int& id, string& error_str, - RequestAttributes& att) = 0; + RequestAttributes& att, + int umask) = 0; }; /* ------------------------------------------------------------------------- */ @@ -83,15 +84,16 @@ public: Template * tmpl, int& id, string& error_str, - RequestAttributes& att) + RequestAttributes& att, + int umask) { VMTemplatePool * tpool = static_cast(pool); VirtualMachineTemplate * ttmpl = static_cast(tmpl); - return tpool->allocate(att.uid, att.gid, att.uname, att.gname, ttmpl, - &id, error_str); + return tpool->allocate(att.uid, att.gid, att.uname, att.gname, umask, + ttmpl, &id, error_str); }; }; @@ -127,12 +129,13 @@ public: Template * tmpl, int& id, string& error_str, - RequestAttributes& att) + RequestAttributes& att, + int umask) { DocumentPool * docpool = static_cast(pool); Document * doc = docpool->get(source_id, true); - return docpool->allocate(att.uid, att.gid, att.uname, att.gname, + return docpool->allocate(att.uid, att.gid, att.uname, att.gname, umask, doc->get_document_type(), tmpl, &id, error_str); }; }; diff --git a/include/RequestManagerCluster.h b/include/RequestManagerCluster.h index 22ab693207..44175d64b6 100644 --- a/include/RequestManagerCluster.h +++ b/include/RequestManagerCluster.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -65,7 +65,24 @@ protected: PoolSQL * pool, PoolObjectSQL::ObjectType type); - virtual int add_object(Cluster* cluster, int id, string& error_msg) = 0; + virtual Datastore::DatastoreType get_ds_type(PoolObjectSQL *obj) + { + return Datastore::FILE_DS; + }; + + /** + * Add object to cluster id collection + * @param cluster where to add the object + * @param id of the object + * @param ds_type Datastore type, will be ignored for different objects + * @param error_msg Error reason, if any + * @return 0 on success + */ + virtual int add_object( + Cluster* cluster, + int id, + Datastore::DatastoreType ds_type, + string& error_msg) = 0; virtual int del_object(Cluster* cluster, int id, string& error_msg) = 0; @@ -86,7 +103,11 @@ public: ~RequestManagerClusterHost(){}; - virtual int add_object(Cluster* cluster, int id, string& error_msg) + virtual int add_object( + Cluster* cluster, + int id, + Datastore::DatastoreType ds_type, + string& error_msg) { return cluster->add_host(id, error_msg); }; @@ -169,9 +190,18 @@ public: ~RequestManagerClusterDatastore(){}; - virtual int add_object(Cluster* cluster, int id, string& error_msg) + virtual Datastore::DatastoreType get_ds_type(PoolObjectSQL *obj) { - return cluster->add_datastore(id, error_msg); + return static_cast(obj)->get_type(); + }; + + virtual int add_object( + Cluster* cluster, + int id, + Datastore::DatastoreType ds_type, + string& error_msg) + { + return cluster->add_datastore(id, ds_type, error_msg); }; virtual int del_object(Cluster* cluster, int id, string& error_msg) @@ -253,7 +283,11 @@ public: ~RequestManagerClusterVNet(){}; - virtual int add_object(Cluster* cluster, int id, string& error_msg) + virtual int add_object( + Cluster* cluster, + int id, + Datastore::DatastoreType ds_type, + string& error_msg) { return cluster->add_vnet(id, error_msg); }; diff --git a/include/RequestManagerDelete.h b/include/RequestManagerDelete.h index 6137bfc377..f6bf6fa8d4 100644 --- a/include/RequestManagerDelete.h +++ b/include/RequestManagerDelete.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -268,6 +268,8 @@ public: }; ~ClusterDelete(){}; + + int drop(int oid, PoolObjectSQL * object, string& error_msg); }; /* ------------------------------------------------------------------------- */ diff --git a/include/RequestManagerGroup.h b/include/RequestManagerGroup.h index 968654af05..3d8b19db34 100644 --- a/include/RequestManagerGroup.h +++ b/include/RequestManagerGroup.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerHost.h b/include/RequestManagerHost.h index 65f538cf0c..f21bfc943d 100644 --- a/include/RequestManagerHost.h +++ b/include/RequestManagerHost.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerImage.h b/include/RequestManagerImage.h index 092c66df8c..4582694a18 100644 --- a/include/RequestManagerImage.h +++ b/include/RequestManagerImage.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerInfo.h b/include/RequestManagerInfo.h index 2fa77ce08f..4499cac4f8 100644 --- a/include/RequestManagerInfo.h +++ b/include/RequestManagerInfo.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerPoolInfoFilter.h b/include/RequestManagerPoolInfoFilter.h index 7975948d52..5927cdc30a 100644 --- a/include/RequestManagerPoolInfoFilter.h +++ b/include/RequestManagerPoolInfoFilter.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerRename.h b/include/RequestManagerRename.h index 5560cbd03c..0034e5b62a 100644 --- a/include/RequestManagerRename.h +++ b/include/RequestManagerRename.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerSystem.h b/include/RequestManagerSystem.h index 4e436b7d4e..75e32d3788 100644 --- a/include/RequestManagerSystem.h +++ b/include/RequestManagerSystem.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerUpdateTemplate.h b/include/RequestManagerUpdateTemplate.h index 511f149ce7..fbea334fd0 100644 --- a/include/RequestManagerUpdateTemplate.h +++ b/include/RequestManagerUpdateTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -53,7 +53,7 @@ public: TemplateUpdateTemplate(): RequestManagerUpdateTemplate("TemplateUpdateTemplate", "Updates a virtual machine template") - { + { Nebula& nd = Nebula::instance(); pool = nd.get_tpool(); auth_object = PoolObjectSQL::TEMPLATE; @@ -65,13 +65,31 @@ public: /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ +class VirtualMachineUpdateTemplate: public RequestManagerUpdateTemplate +{ +public: + VirtualMachineUpdateTemplate(): + RequestManagerUpdateTemplate("VirtualMachineUpdateTemplate", + "Updates a virtual machine user template") + { + Nebula& nd = Nebula::instance(); + pool = nd.get_vmpool(); + auth_object = PoolObjectSQL::VM; + }; + + ~VirtualMachineUpdateTemplate(){}; +}; + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + class ImageUpdateTemplate: public RequestManagerUpdateTemplate { public: ImageUpdateTemplate(): RequestManagerUpdateTemplate("ImageUpdateTemplate", "Updates an image template") - { + { Nebula& nd = Nebula::instance(); pool = nd.get_ipool(); auth_object = PoolObjectSQL::IMAGE; @@ -89,10 +107,11 @@ public: HostUpdateTemplate(): RequestManagerUpdateTemplate("HostUpdateTemplate", "Updates a host template") - { + { Nebula& nd = Nebula::instance(); pool = nd.get_hpool(); auth_object = PoolObjectSQL::HOST; + auth_op = AuthRequest::ADMIN; }; ~HostUpdateTemplate(){}; @@ -107,7 +126,7 @@ public: VirtualNetworkUpdateTemplate(): RequestManagerUpdateTemplate("VirtualNetworkUpdateTemplate", "Updates a vnet template") - { + { Nebula& nd = Nebula::instance(); pool = nd.get_vnpool(); auth_object = PoolObjectSQL::NET; @@ -125,7 +144,7 @@ public: UserUpdateTemplate(): RequestManagerUpdateTemplate("UserUpdateTemplate", "Updates a user template") - { + { Nebula& nd = Nebula::instance(); pool = nd.get_upool(); auth_object = PoolObjectSQL::USER; diff --git a/include/RequestManagerUser.h b/include/RequestManagerUser.h index 4f95682fd3..be6571ea47 100644 --- a/include/RequestManagerUser.h +++ b/include/RequestManagerUser.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerVMTemplate.h b/include/RequestManagerVMTemplate.h index 50d125f7e2..8a528b9d51 100644 --- a/include/RequestManagerVMTemplate.h +++ b/include/RequestManagerVMTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerVirtualMachine.h b/include/RequestManagerVirtualMachine.h index ca61931a76..0393c22b99 100644 --- a/include/RequestManagerVirtualMachine.h +++ b/include/RequestManagerVirtualMachine.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/RequestManagerVirtualNetwork.h b/include/RequestManagerVirtualNetwork.h index de11553656..dec48c9ff0 100644 --- a/include/RequestManagerVirtualNetwork.h +++ b/include/RequestManagerVirtualNetwork.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/SSLTools.h b/include/SSLTools.h index bb3ecd0962..12b8275716 100644 --- a/include/SSLTools.h +++ b/include/SSLTools.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/SqlDB.h b/include/SqlDB.h index c086eb3221..4daafeb8c0 100644 --- a/include/SqlDB.h +++ b/include/SqlDB.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/SqliteDB.h b/include/SqliteDB.h index f9892797ef..197712782a 100644 --- a/include/SqliteDB.h +++ b/include/SqliteDB.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/SyncRequest.h b/include/SyncRequest.h index 21f941d809..64fb490439 100644 --- a/include/SyncRequest.h +++ b/include/SyncRequest.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/SystemDB.h b/include/SystemDB.h index 597868c9b1..a5e442b5af 100644 --- a/include/SystemDB.h +++ b/include/SystemDB.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/Template.h b/include/Template.h index 40c9aab2ae..7726bdf23e 100644 --- a/include/Template.h +++ b/include/Template.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -278,6 +278,22 @@ public: const string& name, bool& value) const; + /** + * Trims the trailing spaces in the NAME attribute + * @return True if the attribute was found and trimmed + */ + virtual bool trim_name() + { + return trim("NAME"); + }; + + /** + * Trims the trailing spaces in the attribute + * @param name of the attribute + * @return True if the attribute was found and trimmed + */ + virtual bool trim(const string& name); + friend ostream& operator<<(ostream& os, const Template& t); /** diff --git a/include/TransferManager.h b/include/TransferManager.h index 1b2b1265a6..a31a8484bb 100644 --- a/include/TransferManager.h +++ b/include/TransferManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -54,6 +54,7 @@ public: EPILOG_DELETE, EPILOG_DELETE_PREVIOUS, EPILOG_DELETE_STOP, + EPILOG_DELETE_BOTH, CHECKPOINT, DRIVER_CANCEL, FINALIZE @@ -138,6 +139,20 @@ public: VirtualMachine * vm, ostream& xfr); + /** + * This function generates the the epilog_delete sequence for current, + * front-end and previous hosts. + * @param vm pointer to VM, locked + * @param xfr stream to write the commands + * @param local true to delete the front-end + * @param previous true to delete the previous host + * + * @return 0 on success + */ + int epilog_delete_commands(VirtualMachine *vm, + ostream& xfr, + bool local, + bool previous); private: /** * Thread id for the Transfer Manager @@ -247,7 +262,8 @@ private: void epilog_stop_action(int vid); /** - * This function starts the epilog_delete sequence + * This function starts the epilog_delete sequence in the current host + * @param vid the Virtual Machine ID */ void epilog_delete_action(int vid) { @@ -256,22 +272,32 @@ private: /** * This function starts the epilog_delete_stop sequence on the local host + * i.e. the front-end (the VM is not running) + * @param vid the Virtual Machine ID */ void epilog_delete_stop_action(int vid) { epilog_delete_action(true, vid); } + /** + * This function starts the epilog_delete sequence on the previous host + * @param vid the Virtual Machine ID + */ + void epilog_delete_previous_action(int vid); + + /** + * This function starts the epilog_delete sequence on the current and + * previous hosts + * @param vid the Virtual Machine ID + */ + void epilog_delete_both_action(int vid); + /** * This function starts the epilog_delete sequence */ void epilog_delete_action(bool local, int vid); - /** - * This function starts the epilog_delete sequence on the previous host - */ - void epilog_delete_previous_action(int vid); - /** * This function starts the epilog sequence */ diff --git a/include/TransferManagerDriver.h b/include/TransferManagerDriver.h index 125193dcf6..beb0be2836 100644 --- a/include/TransferManagerDriver.h +++ b/include/TransferManagerDriver.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/User.h b/include/User.h index f8aa724fcc..10655eedf1 100644 --- a/include/User.h +++ b/include/User.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -173,6 +173,14 @@ public: */ Quotas quota; + /** + * Returns the UMASK template attribute (read as an octal number), or the + * default UMASK from oned.conf if it does not exist + * + * @return the UMASK to create new objects + */ + int get_umask() const; + private: // ------------------------------------------------------------------------- // Friends diff --git a/include/UserPool.h b/include/UserPool.h index fe8fd2c190..d81684c3ab 100644 --- a/include/UserPool.h +++ b/include/UserPool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/UserTemplate.h b/include/UserTemplate.h index c23ad3f0fb..6149d90458 100644 --- a/include/UserTemplate.h +++ b/include/UserTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/VMTemplate.h b/include/VMTemplate.h index b48f7ddb75..16b86330e8 100644 --- a/include/VMTemplate.h +++ b/include/VMTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -117,6 +117,7 @@ protected: int gid, const string& uname, const string& gname, + int umask, VirtualMachineTemplate * _template_contents); ~VMTemplate(); diff --git a/include/VMTemplatePool.h b/include/VMTemplatePool.h index 71c7d7bf73..1ac5e52751 100644 --- a/include/VMTemplatePool.h +++ b/include/VMTemplatePool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -36,6 +36,9 @@ public: * allocated for the object. * @param uid user id (the owner of the Template) * @param gid the id of the group this object is assigned to + * @param uname user name + * @param gname group name + * @param umask permissions umask * @param template_contents a VM Template object * @param oid the id assigned to the Template * @param error_str Returns the error reason, if any @@ -46,6 +49,7 @@ public: int gid, const string& uname, const string& gname, + int umask, VirtualMachineTemplate * template_contents, int * oid, string& error_str); @@ -118,7 +122,7 @@ private: */ PoolObjectSQL * create() { - return new VMTemplate(-1,-1,-1,"","",0); + return new VMTemplate(-1,-1,-1,"","",0,0); }; }; diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index e23debde4b..633e186516 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -81,14 +81,15 @@ public: SHUTDOWN = 12, CANCEL = 13, FAILURE = 14, - CLEANUP = 15, + CLEANUP_RESUBMIT = 15, UNKNOWN = 16, HOTPLUG = 17, SHUTDOWN_POWEROFF = 18, BOOT_UNKNOWN = 19, BOOT_POWEROFF = 20, BOOT_SUSPENDED = 21, - BOOT_STOPPED = 22 + BOOT_STOPPED = 22, + CLEANUP_DELETE = 23 }; // ------------------------------------------------------------------------- @@ -702,6 +703,13 @@ public: *(static_cast(obj_template))); }; + /** + * This function replaces the *user template*. + * @param tmpl_str new contents + * @param error string describing the error if any + * @return 0 on success + */ + int replace_template(const string& tmpl_str, string& error); // ------------------------------------------------------------------------ // States @@ -1044,6 +1052,12 @@ private: */ FileLog * _log; + /** + * User template to store custom metadata. This template can be updated + * + */ + Template * user_obj_template; + // ************************************************************************* // DataBase implementation (Private) // ************************************************************************* @@ -1207,6 +1221,7 @@ protected: int gid, const string& uname, const string& gname, + int umask, VirtualMachineTemplate * _vm_template); virtual ~VirtualMachine(); diff --git a/include/VirtualMachineHook.h b/include/VirtualMachineHook.h index 92c3773cea..743f196244 100644 --- a/include/VirtualMachineHook.h +++ b/include/VirtualMachineHook.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/VirtualMachineManager.h b/include/VirtualMachineManager.h index 42d1525a46..0191a366ba 100644 --- a/include/VirtualMachineManager.h +++ b/include/VirtualMachineManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -49,6 +49,9 @@ public: SHUTDOWN, CANCEL, CANCEL_PREVIOUS, + CLEANUP, + CLEANUP_BOTH, + CLEANUP_PREVIOUS, MIGRATE, RESTORE, REBOOT, @@ -257,6 +260,22 @@ private: void cancel_previous_action( int vid); + /** + * Cleanups a host (cancel VM + delete disk images). + * @param vid the id of the VM. + * @param cancel_previous if true the VM will be canceled in the previous + * host (only relevant to delete VM's in MIGRATE state) + */ + void cleanup_action( + int vid, bool cancel_previous); + + /** + * Cleanups the previous host (cancel VM + delete disk images). + * @param vid the id of the VM. + */ + void cleanup_previous_action( + int vid); + /** * Function to migrate (live) a VM (MIGRATE action). * @param vid the id of the VM. diff --git a/include/VirtualMachineManagerDriver.h b/include/VirtualMachineManagerDriver.h index 6c7d55f826..f6a1ae0f16 100644 --- a/include/VirtualMachineManagerDriver.h +++ b/include/VirtualMachineManagerDriver.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -30,7 +30,7 @@ using namespace std; * VirtualMachineManagerDriver provides a base class to implement VM Manager * Drivers. This class implements the protocol and recover functions * from the Mad interface. Classes derived from the VirtualMachineManagerDriver - * must implement the deployment function to generate specific VM + * must implement the deployment function to generate specific VM * deployment information for the unerlying MAD. */ class VirtualMachineManagerDriver : public Mad @@ -53,7 +53,7 @@ public: string& message); /** - * TODO: What do we need here? just poll the active VMs to recover + * TODO: What do we need here? just poll the active VMs to recover * connections? Or an specific recover action from the MAD? */ void recover(); @@ -67,25 +67,25 @@ public: virtual int deployment_description( const VirtualMachine * vm, const string& file_name) const = 0; - -protected: + +protected: /** - * Gets a configuration attr from driver configuration file (single + * Gets a configuration attr from driver configuration file (single * version) * @param name of config attribute * @param value of the attribute */ void get_default( - const char * name, + const char * name, string& value) const { string sn = name; - + driver_conf.get(sn,value); - } + } /** - * Gets a configuration attr from driver configuration file (vector + * Gets a configuration attr from driver configuration file (vector * version) * @param name of config vector attribute for the domain * @param vname of the attribute @@ -95,20 +95,20 @@ protected: const char * name, const char * vname, string& value) const; - -private: - /** + +private: + /** * Configuration file for the driver */ Template driver_conf; - + /** * Pointer to the Virtual Machine Pool, to access VMs */ VirtualMachinePool * vmpool; friend class VirtualMachineManager; - + /** * Sends a deploy request to the MAD: "DEPLOY ID XML_DRV_MSG" * @param oid the virtual machine id. @@ -169,6 +169,18 @@ private: write_drv("CANCEL", oid, drv_msg); } + /** + * Sends a cleanup request to the MAD: "CLEANUP ID XML_DRV_MSG" + * @param oid the virtual machine id. + * @param drv_msg xml data for the mad operation + */ + void cleanup ( + const int oid, + const string& drv_msg) const + { + write_drv("CLEANUP", oid, drv_msg); + } + /** * Sends a checkpoint request to the MAD: "CHECKPOINT ID XML_DRV_MSG" * @param oid the virtual machine id. @@ -263,7 +275,7 @@ private: ostringstream os; os << aname << " " << oid << " " << msg << endl; - + write(os); } }; diff --git a/include/VirtualMachinePool.h b/include/VirtualMachinePool.h index ea808432d5..e43f802cc9 100644 --- a/include/VirtualMachinePool.h +++ b/include/VirtualMachinePool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -46,10 +46,14 @@ public: * Function to allocate a new VM object * @param uid user id (the owner of the VM) * @param gid the id of the group this object is assigned to + * @param uname user name + * @param gname group name + * @param umask permissions umask * @param vm_template a VM Template object describing the VM * @param oid the id assigned to the VM (output) * @param error_str Returns the error reason, if any * @param on_hold flag to submit on hold + * * @return oid on success, -1 error inserting in DB or -2 error parsing * the template */ @@ -58,6 +62,7 @@ public: int gid, const string& uname, const string& gname, + int umask, VirtualMachineTemplate * vm_template, int * oid, string& error_str, @@ -249,7 +254,7 @@ private: */ PoolObjectSQL * create() { - return new VirtualMachine(-1,-1,-1,"","",0); + return new VirtualMachine(-1,-1,-1,"","",0,0); }; /** diff --git a/include/VirtualMachineTemplate.h b/include/VirtualMachineTemplate.h index 5e36fbbb8c..0f2575f3f6 100644 --- a/include/VirtualMachineTemplate.h +++ b/include/VirtualMachineTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/VirtualNetwork.h b/include/VirtualNetwork.h index a70063059c..7338d154de 100644 --- a/include/VirtualNetwork.h +++ b/include/VirtualNetwork.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -36,7 +36,7 @@ using namespace std; /* -------------------------------------------------------------------------- */ /** - * The Virtual Network class. It represents a Virtual Network at manages its + * The Virtual Network class. It represents a Virtual Network at manages its * leases. One lease is formed by one IP and one MAC address. * MAC address are derived from IP addresses. */ @@ -70,7 +70,7 @@ public: /** * Adds Leases to the virtual network (Only implemented for FIXED networks) * @param leases template in the form LEASES = [IP=XX, MAC=XX]. - * MAC is optional. The template can only contain one LEASE + * MAC is optional. The template can only contain one LEASE * definition. * @param error_msg If the action fails, this message contains the reason. * @return 0 on success @@ -78,7 +78,7 @@ public: int add_leases(VirtualNetworkTemplate * leases, string& error_msg); /** - * Removes Leases from the virtual network; if they are not used.(Only + * Removes Leases from the virtual network; if they are not used.(Only * implemented for FIXED networks) * @param leases template in the form LEASES = [IP=XX]. * The template can only contain one LEASE definition. @@ -146,7 +146,7 @@ public: }; /** - * Check if a VM is the owner of the ip + * Check if a VM is the owner of the ip * @param ip of the lease to be checked * @param vid the ID of the VM * @return true if the ip was already assigned @@ -216,7 +216,7 @@ private: * Name of the physical device the bridge should be attached to */ string phydev; - + /** * VLAN ID of the NIC */ @@ -299,6 +299,7 @@ private: int gid, const string& _uname, const string& _gname, + int _umask, int _cluster_id, const string& _cluster_name, VirtualNetworkTemplate * _vn_template = 0); @@ -326,8 +327,8 @@ private: * Reads the Virtual Network (identified with its OID) from the database. * @param db pointer to the db * @param name of the network - * @param uid of the owner - * + * @param uid of the owner + * * @return 0 on success */ int select(SqlDB * db, const string& name, int uid); diff --git a/include/VirtualNetworkPool.h b/include/VirtualNetworkPool.h index c7ed6e842d..cb4688448d 100644 --- a/include/VirtualNetworkPool.h +++ b/include/VirtualNetworkPool.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -45,6 +45,9 @@ public: * Function to allocate a new VNET object * @param uid user identifier * @param gid the id of the group this object is assigned to + * @param uname user name + * @param gname group name + * @param umask permissions umask * @param vn_template a VirtualNetworkTemplate describing the VNET * @param oid the id assigned to the VM (output) * @param cluster_id the id of the cluster this VNET will belong to @@ -57,6 +60,7 @@ public: int gid, const string& uname, const string& gname, + int umask, VirtualNetworkTemplate * vn_template, int * oid, int cluster_id, @@ -169,7 +173,7 @@ private: */ PoolObjectSQL * create() { - return new VirtualNetwork(-1,-1,"","",-1,"",0); + return new VirtualNetwork(-1,-1,"","",0,-1,"",0); }; /** diff --git a/include/VirtualNetworkTemplate.h b/include/VirtualNetworkTemplate.h index 4cd0d42a56..0f4d453638 100644 --- a/include/VirtualNetworkTemplate.h +++ b/include/VirtualNetworkTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/XMLDriver.h b/include/XMLDriver.h index f032893df5..dfb6d66ba2 100644 --- a/include/XMLDriver.h +++ b/include/XMLDriver.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/XenDriver.h b/include/XenDriver.h index c80be8405d..9d01e74f7a 100644 --- a/include/XenDriver.h +++ b/include/XenDriver.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/mem_collector.h b/include/mem_collector.h index 84246de38f..144f386012 100644 --- a/include/mem_collector.h +++ b/include/mem_collector.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/test/NebulaTest.h b/include/test/NebulaTest.h index 31697a5271..4a201de7ce 100644 --- a/include/test/NebulaTest.h +++ b/include/test/NebulaTest.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/test/OneUnitTest.h b/include/test/OneUnitTest.h index 6f83193053..f710d9c097 100644 --- a/include/test/OneUnitTest.h +++ b/include/test/OneUnitTest.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/include/test/PoolTest.h b/include/test/PoolTest.h index 5f9dc8f485..7cd1f868ff 100644 --- a/include/test/PoolTest.h +++ b/include/test/PoolTest.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/install.sh b/install.sh index ceb1cf4817..fe313a44eb 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -197,7 +197,7 @@ ETC_DIRS="$ETC_LOCATION/im_ec2 \ $ETC_LOCATION/cli" LIB_DIRS="$LIB_LOCATION/ruby \ - $LIB_LOCATION/ruby/OpenNebula \ + $LIB_LOCATION/ruby/opennebula \ $LIB_LOCATION/ruby/zona \ $LIB_LOCATION/ruby/cloud/ \ $LIB_LOCATION/ruby/cloud/econe \ @@ -227,6 +227,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/vnm/ebtables \ $VAR_LOCATION/remotes/vnm/fw \ $VAR_LOCATION/remotes/vnm/ovswitch \ + $VAR_LOCATION/remotes/vnm/ovswitch_brcompat \ $VAR_LOCATION/remotes/vnm/vmware \ $VAR_LOCATION/remotes/tm/ \ $VAR_LOCATION/remotes/tm/dummy \ @@ -358,26 +359,26 @@ SELF_SERVICE_DIRS="\ $LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/FontAwesome/font" OZONES_CLIENT_DIRS="$LIB_LOCATION/ruby \ - $LIB_LOCATION/ruby/OpenNebula \ + $LIB_LOCATION/ruby/opennebula \ $LIB_LOCATION/ruby/cli \ $LIB_LOCATION/ruby/cli/ozones_helper \ $LIB_LOCATION/ruby/zona" LIB_ECO_CLIENT_DIRS="$LIB_LOCATION/ruby \ - $LIB_LOCATION/ruby/OpenNebula \ + $LIB_LOCATION/ruby/opennebula \ $LIB_LOCATION/ruby/cloud/ \ $LIB_LOCATION/ruby/cloud/econe" LIB_OCCI_CLIENT_DIRS="$LIB_LOCATION/ruby \ - $LIB_LOCATION/ruby/OpenNebula \ + $LIB_LOCATION/ruby/opennebula \ $LIB_LOCATION/ruby/cloud/occi" LIB_MARKET_CLIENT_DIRS="$LIB_LOCATION/ruby \ - $LIB_LOCATION/ruby/OpenNebula \ + $LIB_LOCATION/ruby/opennebula \ $LIB_LOCATION/ruby/cloud/marketplace" LIB_OCA_CLIENT_DIRS="$LIB_LOCATION/ruby \ - $LIB_LOCATION/ruby/OpenNebula" + $LIB_LOCATION/ruby/opennebula" LIB_CLI_CLIENT_DIRS="$LIB_LOCATION/ruby/cli \ $LIB_LOCATION/ruby/cli/one_helper" @@ -407,7 +408,8 @@ INSTALL_FILES=( INCLUDE_FILES:$INCLUDE_LOCATION LIB_FILES:$LIB_LOCATION RUBY_LIB_FILES:$LIB_LOCATION/ruby - RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula + RUBY_AUTH_LIB_FILES:$LIB_LOCATION/ruby/opennebula + RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/opennebula MAD_RUBY_LIB_FILES:$LIB_LOCATION/ruby MAD_RUBY_LIB_FILES:$VAR_LOCATION/remotes MAD_SH_LIB_FILES:$LIB_LOCATION/sh @@ -450,6 +452,7 @@ INSTALL_FILES=( NETWORK_EBTABLES_FILES:$VAR_LOCATION/remotes/vnm/ebtables NETWORK_FW_FILES:$VAR_LOCATION/remotes/vnm/fw NETWORK_OVSWITCH_FILES:$VAR_LOCATION/remotes/vnm/ovswitch + NETWORK_OVSWITCH_BRCOMPAT_FILES:$VAR_LOCATION/remotes/vnm/ovswitch_brcompat NETWORK_VMWARE_FILES:$VAR_LOCATION/remotes/vnm/vmware EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples TGT_SHARE_FILES:$SHARE_LOCATION/tgt @@ -490,11 +493,11 @@ INSTALL_CLIENT_FILES=( OZONES_LIB_API_ZONA_FILES:$LIB_LOCATION/ruby/zona CLI_CONF_FILES:$ETC_LOCATION/cli OCA_LIB_FILES:$LIB_LOCATION/ruby - RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula + RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/opennebula ) INSTALL_SUNSTONE_RUBY_FILES=( - RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula + RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/opennebula OCA_LIB_FILES:$LIB_LOCATION/ruby ) @@ -543,7 +546,7 @@ INSTALL_SUNSTONE_ETC_FILES=( INSTALL_OZONES_RUBY_FILES=( OZONES_RUBY_LIB_FILES:$LIB_LOCATION/ruby - RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula + RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/opennebula ) INSTALL_OZONES_FILES=( @@ -675,8 +678,13 @@ RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \ src/mad/ruby/ssh_stream.rb \ src/vnm_mad/one_vnm.rb \ src/mad/ruby/Ganglia.rb \ - src/oca/ruby/OpenNebula.rb \ - src/authm_mad/remotes/ssh/ssh_auth.rb \ + src/oca/ruby/opennebula.rb" + +#------------------------------------------------------------------------------- +# Ruby auth library files, to be installed under $LIB_LOCATION/ruby/opennebula +#------------------------------------------------------------------------------- + +RUBY_AUTH_LIB_FILES="src/authm_mad/remotes/ssh/ssh_auth.rb \ src/authm_mad/remotes/server_x509/server_x509_auth.rb \ src/authm_mad/remotes/server_cipher/server_cipher_auth.rb \ src/authm_mad/remotes/ldap/ldap_auth.rb \ @@ -845,6 +853,11 @@ NETWORK_OVSWITCH_FILES="src/vnm_mad/remotes/ovswitch/clean \ src/vnm_mad/remotes/ovswitch/pre \ src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb" +NETWORK_OVSWITCH_BRCOMPAT_FILES="src/vnm_mad/remotes/ovswitch_brcompat/clean \ + src/vnm_mad/remotes/ovswitch_brcompat/post \ + src/vnm_mad/remotes/ovswitch_brcompat/pre \ + src/vnm_mad/remotes/ovswitch_brcompat/OpenvSwitch.rb" + NETWORK_VMWARE_FILES="src/vnm_mad/remotes/vmware/clean \ src/vnm_mad/remotes/vmware/post \ src/vnm_mad/remotes/vmware/pre \ @@ -1089,35 +1102,40 @@ INSTALL_GEMS_SHARE_FILE="share/install_gems/install_gems" #------------------------------------------------------------------------------- # OCA Files #------------------------------------------------------------------------------- -OCA_LIB_FILES="src/oca/ruby/OpenNebula.rb" +OCA_LIB_FILES="src/oca/ruby/opennebula.rb" -RUBY_OPENNEBULA_LIB_FILES="src/oca/ruby/OpenNebula/Host.rb \ - src/oca/ruby/OpenNebula/HostPool.rb \ - src/oca/ruby/OpenNebula/Pool.rb \ - src/oca/ruby/OpenNebula/User.rb \ - src/oca/ruby/OpenNebula/UserPool.rb \ - src/oca/ruby/OpenNebula/VirtualMachine.rb \ - src/oca/ruby/OpenNebula/VirtualMachinePool.rb \ - src/oca/ruby/OpenNebula/VirtualNetwork.rb \ - src/oca/ruby/OpenNebula/VirtualNetworkPool.rb \ - src/oca/ruby/OpenNebula/Image.rb \ - src/oca/ruby/OpenNebula/ImagePool.rb \ - src/oca/ruby/OpenNebula/Template.rb \ - src/oca/ruby/OpenNebula/TemplatePool.rb \ - src/oca/ruby/OpenNebula/Document.rb \ - src/oca/ruby/OpenNebula/DocumentPool.rb \ - src/oca/ruby/OpenNebula/DocumentJSON.rb \ - src/oca/ruby/OpenNebula/DocumentPoolJSON.rb \ - src/oca/ruby/OpenNebula/Group.rb \ - src/oca/ruby/OpenNebula/GroupPool.rb \ - src/oca/ruby/OpenNebula/Acl.rb \ - src/oca/ruby/OpenNebula/AclPool.rb \ - src/oca/ruby/OpenNebula/Datastore.rb \ - src/oca/ruby/OpenNebula/DatastorePool.rb \ - src/oca/ruby/OpenNebula/Cluster.rb \ - src/oca/ruby/OpenNebula/ClusterPool.rb \ - src/oca/ruby/OpenNebula/XMLUtils.rb \ - src/oca/ruby/OpenNebula/System.rb" +RUBY_OPENNEBULA_LIB_FILES="src/oca/ruby/opennebula/host.rb \ + src/oca/ruby/opennebula/host_pool.rb \ + src/oca/ruby/opennebula/pool.rb \ + src/oca/ruby/opennebula/user.rb \ + src/oca/ruby/opennebula/user_pool.rb \ + src/oca/ruby/opennebula/virtual_machine.rb \ + src/oca/ruby/opennebula/virtual_machine_pool.rb \ + src/oca/ruby/opennebula/virtual_network.rb \ + src/oca/ruby/opennebula/virtual_network_pool.rb \ + src/oca/ruby/opennebula/image.rb \ + src/oca/ruby/opennebula/image_pool.rb \ + src/oca/ruby/opennebula/template.rb \ + src/oca/ruby/opennebula/template_pool.rb \ + src/oca/ruby/opennebula/document.rb \ + src/oca/ruby/opennebula/document_pool.rb \ + src/oca/ruby/opennebula/document_json.rb \ + src/oca/ruby/opennebula/document_pool_json.rb \ + src/oca/ruby/opennebula/group.rb \ + src/oca/ruby/opennebula/group_pool.rb \ + src/oca/ruby/opennebula/acl.rb \ + src/oca/ruby/opennebula/acl_pool.rb \ + src/oca/ruby/opennebula/datastore.rb \ + src/oca/ruby/opennebula/datastore_pool.rb \ + src/oca/ruby/opennebula/cluster.rb \ + src/oca/ruby/opennebula/cluster_pool.rb \ + src/oca/ruby/opennebula/xml_utils.rb \ + src/oca/ruby/opennebula/client.rb \ + src/oca/ruby/opennebula/error.rb \ + src/oca/ruby/opennebula/pool_element.rb \ + src/oca/ruby/opennebula/xml_element.rb \ + src/oca/ruby/opennebula/xml_pool.rb \ + src/oca/ruby/opennebula/system.rb" #------------------------------------------------------------------------------- # Common Cloud Files diff --git a/share/doc/xsd/acct.xsd b/share/doc/xsd/acct.xsd index 824bbc25a0..d9b435b817 100644 --- a/share/doc/xsd/acct.xsd +++ b/share/doc/xsd/acct.xsd @@ -83,29 +83,30 @@ diff --git a/share/doc/xsd/test.sh b/share/doc/xsd/test.sh index 50d77e06a5..265f69025b 100755 --- a/share/doc/xsd/test.sh +++ b/share/doc/xsd/test.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/doc/xsd/vm.xsd b/share/doc/xsd/vm.xsd index ae3b333c6f..38bbf943c7 100644 --- a/share/doc/xsd/vm.xsd +++ b/share/doc/xsd/vm.xsd @@ -45,29 +45,30 @@ @@ -87,6 +88,7 @@ + diff --git a/share/etc/defaultrc b/share/etc/defaultrc index 08ef64c303..bbdaca8c98 100644 --- a/share/etc/defaultrc +++ b/share/etc/defaultrc @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/etc/oned.conf b/share/etc/oned.conf index de90413f55..f32a3254f0 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -465,6 +465,10 @@ HM_MAD = [ # ENABLE_OTHER_PERMISSIONS: Whether or not users can set the permissions for # 'other', so publishing or sharing resources with others. Users in the oneadmin # group will still be able to change these permissions. Values: YES or NO. +# +# DEFAULT_UMASK: Similar to Unix umask, sets the default resources permissions. +# Its format must be 3 octal digits. For example a umask of 137 will set +# the new object's permissions to 640 "um- u-- ---" #******************************************************************************* AUTH_MAD = [ @@ -476,6 +480,8 @@ SESSION_EXPIRATION_TIME = 900 #ENABLE_OTHER_PERMISSIONS = "YES" +DEFAULT_UMASK = 177 + #******************************************************************************* # Restricted Attributes Configuration #******************************************************************************* diff --git a/share/hooks/host_error.rb b/share/hooks/host_error.rb index a7eab104de..6d6dfa3fd9 100755 --- a/share/hooks/host_error.rb +++ b/share/hooks/host_error.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/man/SConstruct b/share/man/SConstruct index c051ff813f..4ac2b5d27b 100644 --- a/share/man/SConstruct +++ b/share/man/SConstruct @@ -1,7 +1,7 @@ # SConstruct for share/man # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/man/econe-allocate-address.1 b/share/man/econe-allocate-address.1 index 9db791f295..37d9208975 100644 --- a/share/man/econe-allocate-address.1 +++ b/share/man/econe-allocate-address.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-ALLOCATE\-ADDRESS" "1" "October 2012" "" "econe-allocate-address(1) -- Allocates a new elastic IP address for the user" +.TH "ECONE\-ALLOCATE\-ADDRESS" "1" "January 2013" "" "econe-allocate-address(1) -- Allocates a new elastic IP address for the user" . .SH "NAME" \fBecone\-allocate\-address\fR @@ -72,7 +72,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-associate-address.1 b/share/man/econe-associate-address.1 index 740cce5500..f5bb81edc0 100644 --- a/share/man/econe-associate-address.1 +++ b/share/man/econe-associate-address.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-ASSOCIATE\-ADDRESS" "1" "October 2012" "" "econe-associate-address(1) -- Associates a publicIP of the user with a given instance" +.TH "ECONE\-ASSOCIATE\-ADDRESS" "1" "January 2013" "" "econe-associate-address(1) -- Associates a publicIP of the user with a given instance" . .SH "NAME" \fBecone\-associate\-address\fR @@ -75,7 +75,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-attach-volume.1 b/share/man/econe-attach-volume.1 index 53a49ed2c0..590b092911 100644 --- a/share/man/econe-attach-volume.1 +++ b/share/man/econe-attach-volume.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-ATTACH\-VOLUME" "1" "October 2012" "" "econe-attach-volume(1) -- Attaches a DATABLOCK to an instance" +.TH "ECONE\-ATTACH\-VOLUME" "1" "January 2013" "" "econe-attach-volume(1) -- Attaches a DATABLOCK to an instance" . .SH "NAME" \fBecone\-attach\-volume\fR @@ -77,7 +77,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-create-keypair.1 b/share/man/econe-create-keypair.1 index 62296d18b2..058ecc78ae 100644 --- a/share/man/econe-create-keypair.1 +++ b/share/man/econe-create-keypair.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-CREATE\-KEYPAIR" "1" "October 2012" "" "econe-create-keypair(1) -- Creates the named keypair" +.TH "ECONE\-CREATE\-KEYPAIR" "1" "January 2013" "" "econe-create-keypair(1) -- Creates the named keypair" . .SH "NAME" \fBecone\-create\-keypair\fR @@ -75,7 +75,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-create-volume.1 b/share/man/econe-create-volume.1 index 9d72538c12..45be19bc2d 100644 --- a/share/man/econe-create-volume.1 +++ b/share/man/econe-create-volume.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-CREATE\-VOLUME" "1" "October 2012" "" "econe-create-volume(1) -- Creates a new DATABLOCK in OpenNebula" +.TH "ECONE\-CREATE\-VOLUME" "1" "January 2013" "" "econe-create-volume(1) -- Creates a new DATABLOCK in OpenNebula" . .SH "NAME" \fBecone\-create\-volume\fR @@ -73,7 +73,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-delete-keypair.1 b/share/man/econe-delete-keypair.1 index f9b3bee5a2..59884d0269 100644 --- a/share/man/econe-delete-keypair.1 +++ b/share/man/econe-delete-keypair.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-DELETE\-KEYPAIR" "1" "October 2012" "" "econe-delete-keypair(1) -- Deletes the named keypair, removes the associated keys" +.TH "ECONE\-DELETE\-KEYPAIR" "1" "January 2013" "" "econe-delete-keypair(1) -- Deletes the named keypair, removes the associated keys" . .SH "NAME" \fBecone\-delete\-keypair\fR @@ -75,7 +75,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-delete-volume.1 b/share/man/econe-delete-volume.1 index be7fdc858b..34c8e3b4eb 100644 --- a/share/man/econe-delete-volume.1 +++ b/share/man/econe-delete-volume.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-DELETE\-VOLUME" "1" "October 2012" "" "econe-delete-volume(1) -- Deletes an existing DATABLOCK" +.TH "ECONE\-DELETE\-VOLUME" "1" "January 2013" "" "econe-delete-volume(1) -- Deletes an existing DATABLOCK" . .SH "NAME" \fBecone\-delete\-volume\fR @@ -75,7 +75,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-describe-addresses.1 b/share/man/econe-describe-addresses.1 index e60ef40e6f..8bd4944b20 100644 --- a/share/man/econe-describe-addresses.1 +++ b/share/man/econe-describe-addresses.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-DESCRIBE\-ADDRESSES" "1" "October 2012" "" "econe-describe-addresses(1) -- Lists elastic IP addresses" +.TH "ECONE\-DESCRIBE\-ADDRESSES" "1" "January 2013" "" "econe-describe-addresses(1) -- Lists elastic IP addresses" . .SH "NAME" \fBecone\-describe\-addresses\fR @@ -72,7 +72,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-describe-images.1 b/share/man/econe-describe-images.1 index 06688ebefe..a5ebe6c179 100644 --- a/share/man/econe-describe-images.1 +++ b/share/man/econe-describe-images.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-DESCRIBE\-IMAGES" "1" "October 2012" "" "econe-describe-images(1) -- Lists all registered images belonging to one particular user" +.TH "ECONE\-DESCRIBE\-IMAGES" "1" "January 2013" "" "econe-describe-images(1) -- Lists all registered images belonging to one particular user" . .SH "SYNOPSIS" econe\-describe\-images \fIOPTIONS\fR @@ -69,7 +69,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-describe-instances.1 b/share/man/econe-describe-instances.1 index 606d2c8a9b..5ee0f2f889 100644 --- a/share/man/econe-describe-instances.1 +++ b/share/man/econe-describe-instances.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-DESCRIBE\-INSTANCES" "1" "October 2012" "" "econe-describe-instances(1) -- Outputs a list of launched images belonging to one particular user" +.TH "ECONE\-DESCRIBE\-INSTANCES" "1" "January 2013" "" "econe-describe-instances(1) -- Outputs a list of launched images belonging to one particular user" . .SH "NAME" \fBecone\-describe\-instances\fR @@ -72,7 +72,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-describe-keypairs.1 b/share/man/econe-describe-keypairs.1 index dfcf25d1e4..6ed7572c14 100644 --- a/share/man/econe-describe-keypairs.1 +++ b/share/man/econe-describe-keypairs.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-DESCRIBE\-KEYPAIRS" "1" "October 2012" "" "econe-describe-keypairs(1) -- List and describe the key pairs available to the user" +.TH "ECONE\-DESCRIBE\-KEYPAIRS" "1" "January 2013" "" "econe-describe-keypairs(1) -- List and describe the key pairs available to the user" . .SH "NAME" \fBecone\-describe\-keypairs\fR @@ -72,7 +72,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-describe-volumes.1 b/share/man/econe-describe-volumes.1 index 6c8b1c79d3..d5e29909c5 100644 --- a/share/man/econe-describe-volumes.1 +++ b/share/man/econe-describe-volumes.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-DESCRIBE\-VOLUMES" "1" "October 2012" "" "econe-describe-volumes(1) -- Describe all available DATABLOCKs for this user" +.TH "ECONE\-DESCRIBE\-VOLUMES" "1" "January 2013" "" "econe-describe-volumes(1) -- Describe all available DATABLOCKs for this user" . .SH "NAME" \fBecone\-describe\-volumes\fR @@ -72,7 +72,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-detach-volume.1 b/share/man/econe-detach-volume.1 index 63cd8af370..de0b00ba22 100644 --- a/share/man/econe-detach-volume.1 +++ b/share/man/econe-detach-volume.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-DETACH\-VOLUME" "1" "October 2012" "" "econe-detach-volume(1) -- Detaches a DATABLOCK from an instance" +.TH "ECONE\-DETACH\-VOLUME" "1" "January 2013" "" "econe-detach-volume(1) -- Detaches a DATABLOCK from an instance" . .SH "NAME" \fBecone\-detach\-volume\fR @@ -77,7 +77,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-disassociate-address.1 b/share/man/econe-disassociate-address.1 index 434a493593..6e055410fa 100644 --- a/share/man/econe-disassociate-address.1 +++ b/share/man/econe-disassociate-address.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-DISASSOCIATE\-ADDRESS" "1" "October 2012" "" "econe-disassociate-address(1) -- Disasociate a publicIP of the user currently associated with an instance" +.TH "ECONE\-DISASSOCIATE\-ADDRESS" "1" "January 2013" "" "econe-disassociate-address(1) -- Disasociate a publicIP of the user currently associated with an instance" . .SH "NAME" \fBecone\-disassociate\-address\fR @@ -75,7 +75,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-reboot-instances.1 b/share/man/econe-reboot-instances.1 index 97a9642e48..3db1b43d12 100644 --- a/share/man/econe-reboot-instances.1 +++ b/share/man/econe-reboot-instances.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-REBOOT\-INSTANCES" "1" "October 2012" "" "econe-reboot-instances(1) -- Reboots a set of virtual machines" +.TH "ECONE\-REBOOT\-INSTANCES" "1" "January 2013" "" "econe-reboot-instances(1) -- Reboots a set of virtual machines" . .SH "NAME" \fBecone\-reboot\-instances\fR @@ -89,7 +89,7 @@ The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-register.1 b/share/man/econe-register.1 index f7be522fe2..65a3d110b8 100644 --- a/share/man/econe-register.1 +++ b/share/man/econe-register.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-REGISTER" "1" "October 2012" "" "econe-register(1) -- Registers an image" +.TH "ECONE\-REGISTER" "1" "January 2013" "" "econe-register(1) -- Registers an image" . .SH "NAME" \fBecone\-register\fR @@ -75,7 +75,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-release-address.1 b/share/man/econe-release-address.1 index 28b8146951..bf32e67fd9 100644 --- a/share/man/econe-release-address.1 +++ b/share/man/econe-release-address.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-RELEASE\-ADDRESS" "1" "October 2012" "" "econe-release-address(1) -- Releases a publicIP of the user" +.TH "ECONE\-RELEASE\-ADDRESS" "1" "January 2013" "" "econe-release-address(1) -- Releases a publicIP of the user" . .SH "NAME" \fBecone\-release\-address\fR @@ -75,7 +75,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-run-instances.1 b/share/man/econe-run-instances.1 index 1e531b3c45..1072f60c7f 100644 --- a/share/man/econe-run-instances.1 +++ b/share/man/econe-run-instances.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-RUN\-INSTANCES" "1" "October 2012" "" "econe-run-instances(1) -- Runs an instance of a particular image (that needs to be referenced)" +.TH "ECONE\-RUN\-INSTANCES" "1" "January 2013" "" "econe-run-instances(1) -- Runs an instance of a particular image (that needs to be referenced)" . .SH "NAME" \fBecone\-run\-instances\fR @@ -80,7 +80,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-start-instances.1 b/share/man/econe-start-instances.1 index 6afd4ef38b..9692cce707 100644 --- a/share/man/econe-start-instances.1 +++ b/share/man/econe-start-instances.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-START\-INSTANCES" "1" "October 2012" "" "econe-start-instances(1) -- Starts a set of virtual machines" +.TH "ECONE\-START\-INSTANCES" "1" "January 2013" "" "econe-start-instances(1) -- Starts a set of virtual machines" . .SH "NAME" \fBecone\-start\-instances\fR @@ -89,7 +89,7 @@ The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-stop-instances.1 b/share/man/econe-stop-instances.1 index 5a9979cd6e..dd93dbbb85 100644 --- a/share/man/econe-stop-instances.1 +++ b/share/man/econe-stop-instances.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-STOP\-INSTANCES" "1" "October 2012" "" "econe-stop-instances(1) -- Stops a set of virtual machines" +.TH "ECONE\-STOP\-INSTANCES" "1" "January 2013" "" "econe-stop-instances(1) -- Stops a set of virtual machines" . .SH "NAME" \fBecone\-stop\-instances\fR @@ -89,7 +89,7 @@ The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-terminate-instances.1 b/share/man/econe-terminate-instances.1 index 1d3e3c8cce..52c06dc600 100644 --- a/share/man/econe-terminate-instances.1 +++ b/share/man/econe-terminate-instances.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-TERMINATE\-INSTANCES" "1" "October 2012" "" "econe-terminate-instances(1) -- Shutdowns a set of virtual machines (or cancel, depending on its state)" +.TH "ECONE\-TERMINATE\-INSTANCES" "1" "January 2013" "" "econe-terminate-instances(1) -- Shutdowns a set of virtual machines (or cancel, depending on its state)" . .SH "NAME" \fBecone\-terminate\-instances\fR @@ -89,7 +89,7 @@ The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/econe-upload.1 b/share/man/econe-upload.1 index a8f28ff851..5c200b4c11 100644 --- a/share/man/econe-upload.1 +++ b/share/man/econe-upload.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ECONE\-UPLOAD" "1" "October 2012" "" "econe-upload(1) -- Uploads an image to OpenNebula" +.TH "ECONE\-UPLOAD" "1" "January 2013" "" "econe-upload(1) -- Uploads an image to OpenNebula" . .SH "NAME" \fBecone\-upload\fR @@ -76,7 +76,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/occi-compute.1 b/share/man/occi-compute.1 index b119434547..ff0bdf73ee 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" "October 2012" "OpenNebula 3.9.0" "User Commands" +.TH OPENNEBULA "1" "January 2013" "OpenNebula 3.9.0" "User Commands" .SH NAME OpenNebula \- OCCI Manage Compute .SH SYNOPSIS @@ -69,7 +69,7 @@ attaches an storage to a given compute .IP detaches the target disk form the compute .SH COPYRIGHT -Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +Copyright 2002\-2013, OpenNebula Project (OpenNebula.org), C12G Labs .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 diff --git a/share/man/occi-instance-type.1 b/share/man/occi-instance-type.1 index aeaa10f847..b1c4ea97c6 100644 --- a/share/man/occi-instance-type.1 +++ b/share/man/occi-instance-type.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "October 2012" "OpenNebula 3.9.0" "User Commands" +.TH OPENNEBULA "1" "January 2013" "OpenNebula 3.9.0" "User Commands" .SH NAME OpenNebula \- OCCI Manage Instance .SH SYNOPSIS @@ -46,7 +46,7 @@ The password provided will not be hashed .IP lists available instance types .SH COPYRIGHT -Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +Copyright 2002\-2013, OpenNebula Project (OpenNebula.org), C12G Labs .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 diff --git a/share/man/occi-network.1 b/share/man/occi-network.1 index 0250f64252..d8badb50a2 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" "October 2012" "OpenNebula 3.9.0" "User Commands" +.TH OPENNEBULA "1" "January 2013" "OpenNebula 3.9.0" "User Commands" .SH NAME OpenNebula \- OCCI Manage Network .SH SYNOPSIS @@ -65,7 +65,7 @@ provided .IP deletes the virtual network idenfitied by .SH COPYRIGHT -Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +Copyright 2002\-2013, OpenNebula Project (OpenNebula.org), C12G Labs .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 diff --git a/share/man/occi-storage.1 b/share/man/occi-storage.1 index 9d2b7dd60f..84a03e2dd3 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" "October 2012" "OpenNebula 3.9.0" "User Commands" +.TH OPENNEBULA "1" "January 2013" "OpenNebula 3.9.0" "User Commands" .SH NAME OpenNebula \- OCCI Manage Storage .SH SYNOPSIS @@ -74,7 +74,7 @@ deletes the storage resource idenfitied by clones the storage resource idenfitied by in a new one using the given .SH COPYRIGHT -Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula.org) +Copyright 2002\-2013, OpenNebula Project (OpenNebula.org), C12G Labs .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 diff --git a/share/man/oneacct.1 b/share/man/oneacct.1 index 45884aacfa..6b761f86e6 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" "October 2012" "" "oneacct(1) -- OpenNebula Accounting Tool" +.TH "ONEACCT" "1" "January 2013" "" "oneacct(1) -- OpenNebula Accounting Tool" . .SH "NAME" \fBoneacct\fR @@ -15,7 +15,7 @@ \-s, \-\-start TIME Start date and time to take into account \-e, \-\-end TIME End date and time - \-u, \-\-user user User name or id to filter the results + \-u, \-\-userfilter user User name or id to filter the results \-g, \-\-group group Group name or id to filter the results \-H, \-\-host HOST Host name or id to filter the results \-\-xpath XPATH_EXPRESSION Xpath expression to filter the results\. For example: oneacct \-\-xpath \'HISTORY[ETIME>0]\' @@ -25,6 +25,9 @@ \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -75,7 +78,7 @@ String .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 a169f1b1d9..6fa4ee17c9 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" "October 2012" "" "oneacl(1) -- manages OpenNebula ACLs" +.TH "ONEACL" "1" "January 2013" "" "oneacl(1) -- manages OpenNebula ACLs" . .SH "NAME" \fBoneacl\fR @@ -18,6 +18,9 @@ \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -129,7 +132,7 @@ Comma\-separated list of OpenNebula ACL names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 42677c8874..abaa9724fc 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" "October 2012" "" "onecluster(1) -- manages OpenNebula clusters" +.TH "ONECLUSTER" "1" "January 2013" "" "onecluster(1) -- manages OpenNebula clusters" . .SH "NAME" \fBonecluster\fR @@ -15,12 +15,17 @@ \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command + \-f, \-\-filter x,y,z Filter data\. An array is specified with + column=value pairs\. \-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 + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -62,7 +67,7 @@ list .nf Lists Clusters in the pool -valid options: list, delay, xml, numeric, describe +valid options: list, delay, filter, xml, numeric, describe . .fi . @@ -302,7 +307,7 @@ OpenNebula DATASTORE name or id .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 b17dbe7b16..4957a20dd6 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" "October 2012" "" "onedatastore(1) -- manages OpenNebula datastores" +.TH "ONEDATASTORE" "1" "January 2013" "" "onedatastore(1) -- manages OpenNebula datastores" . .SH "NAME" \fBonedatastore\fR @@ -16,12 +16,17 @@ \-c, \-\-cluster id|name Selects the cluster \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command + \-f, \-\-filter x,y,z Filter data\. An array is specified with + column=value pairs\. \-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 + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -106,7 +111,7 @@ list .nf Lists Datastores in the pool -valid options: list, delay, xml, numeric, describe +valid options: list, delay, filter, xml, numeric, describe . .fi . @@ -262,7 +267,7 @@ OpenNebula USER name or id .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 c54f1a6014..70b74c69a1 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" "October 2012" "" "onedb(1) -- OpenNebula database migration tool" +.TH "ONEDB" "1" "January 2013" "" "onedb(1) -- OpenNebula database migration tool" . .SH "NAME" \fBonedb\fR diff --git a/share/man/onegroup.1 b/share/man/onegroup.1 index 2a0c614d4a..a466f70710 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" "October 2012" "" "onegroup(1) -- manages OpenNebula groups" +.TH "ONEGROUP" "1" "January 2013" "" "onegroup(1) -- manages OpenNebula groups" . .SH "NAME" \fBonegroup\fR @@ -15,12 +15,17 @@ \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command + \-f, \-\-filter x,y,z Filter data\. An array is specified with + column=value pairs\. \-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 + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -62,7 +67,7 @@ list .nf Lists Groups in the pool -valid options: list, delay, xml, numeric, describe +valid options: list, delay, filter, xml, numeric, describe . .fi . @@ -113,6 +118,21 @@ provided the editor will be launched to create new quotas\. . .IP "" 0 +. +.IP "\(bu" 4 +defaultquota [\fIfile\fR] +. +.IP "" 4 +. +.nf + +Sets the default quota limits for the groups\. If a path is not provided +the editor will be launched to modify the current default quotas\. +. +.fi +. +.IP "" 0 + . .IP "" 0 . @@ -191,7 +211,7 @@ Comma\-separated list of OpenNebula GROUP names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 63c06698f8..087c6598fa 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" "October 2012" "" "onehost(1) -- manages OpenNebula hosts" +.TH "ONEHOST" "1" "January 2013" "" "onehost(1) -- manages OpenNebula hosts" . .SH "NAME" \fBonehost\fR @@ -19,6 +19,8 @@ \-c, \-\-cluster id|name Selects the cluster \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command + \-f, \-\-filter x,y,z Filter data\. An array is specified with + column=value pairs\. \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs \-k, \-\-kilobytes Show units in kilobytes @@ -26,6 +28,9 @@ \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -127,7 +132,7 @@ list .nf Lists Hosts in the pool -valid options: list, delay, xml, numeric, kilobytes, describe +valid options: list, delay, filter, xml, numeric, kilobytes, describe . .fi . @@ -157,7 +162,7 @@ top .nf Lists Hosts continuously -valid options: list, delay, xml, numeric, kilobytes +valid options: list, delay, filter, xml, numeric, kilobytes . .fi . @@ -255,7 +260,7 @@ Comma\-separated list of OpenNebula HOST names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 3a84709a57..c79961a2dd 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" "October 2012" "" "oneimage(1) -- manages OpenNebula images" +.TH "ONEIMAGE" "1" "January 2013" "" "oneimage(1) -- manages OpenNebula images" . .SH "NAME" \fBoneimage\fR @@ -16,24 +16,33 @@ \-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 + \-\-type type Type of the new Image: OS, CDROM, DATABLOCK, KERNEL, RAMDISK, CONTEXT \-\-persistent Tells if the image will be persistent - \-\-prefix prefix Device prefix for the disk (eg\. hd, sd, xvd or vd) + \-\-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 + \-\-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\. + \-\-fstype fstype Type of file system to be built\. This can be + any value understood by mkfs unix command\. + \-\-dry Just print the template \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command + \-f, \-\-filter x,y,z Filter data\. An array is specified with + column=value pairs\. \-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 + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -66,7 +75,7 @@ Examples: 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 +valid options: datastore, name, description, type, persistent, prefix, target, path, driver, disk_type, source, size, fstype, dry . .fi . @@ -260,6 +269,20 @@ Changes the Image permissions . .IP "" 0 +. +.IP "\(bu" 4 +rename \fIimageid\fR \fIname\fR +. +.IP "" 4 +. +.nf + +Renames the Image +. +.fi +. +.IP "" 0 + . .IP "\(bu" 4 list [\fIfilterflag\fR] @@ -269,7 +292,7 @@ list [\fIfilterflag\fR] .nf Lists Images in the pool -valid options: list, delay, xml, numeric, describe +valid options: list, delay, filter, xml, numeric, describe . .fi . @@ -299,7 +322,7 @@ top [\fIfilterflag\fR] .nf Lists Images continuously -valid options: list, delay, xml, numeric, describe +valid options: list, delay, filter, xml, numeric, describe . .fi . @@ -426,11 +449,25 @@ user IMAGE of the user identified by the username . .IP "" 0 +. +.IP "\(bu" 4 +type +. +.IP "" 4 +. +.nf + +Image type: OS, CDROM, DATABLOCK, KERNEL, RAMDISK, CONTEXT +. +.fi +. +.IP "" 0 + . .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 db10eb0255..4da66629f9 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" "October 2012" "" "onetemplate(1) -- manages OpenNebula templates" +.TH "ONETEMPLATE" "1" "January 2013" "" "onetemplate(1) -- manages OpenNebula templates" . .SH "NAME" \fBonetemplate\fR @@ -16,21 +16,40 @@ \-\-name name Name of the new VM or TEMPLATE\. When instantiating multiple VMs you can use the"%i" wildcard to produce different names such as vm\-0, vm\-1\.\.\. - \-\-cpu cpu CPU percentage reserved for the VM (1=100% one CPU) + \-\-cpu cpu CPU percentage reserved for the VM (1=100% one + CPU) + \-\-vcpu vcpu Number of virtualized CPUs \-\-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 + \-\-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 + \-\-vnc Add VNC server to the VM + \-\-ssh [file] Add an ssh public key to the context\. If the + file is omited then the user variable + SSH_PUBLIC_KEY will be used\. + \-\-net_context Add network contextualization parameters + \-\-context line1,line2,line3 Lines to add to the context section + \-\-boot device Select boot device (hd|fd|cdrom|network) + \-\-dry Just print the template \-m, \-\-multiple x Instance multiple VMs + \-\-hold Creates the new VM on hold state instead of pending \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command + \-f, \-\-filter x,y,z Filter data\. An array is specified with + column=value pairs\. \-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 + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -57,8 +76,8 @@ Examples: \- using two disks: - onevm create \-\-name "test vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch,data -valid options: name, cpu, arch, memory, disk, network, raw + onetempate create \-\-name "test vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch,data +valid options: name, cpu, vcpu, arch, memory, disk, network, raw, vnc, ssh, net_context, context, boot, dry . .fi . @@ -102,7 +121,7 @@ instantiate \fItemplateid\fR Creates a new VM instance from the given Template\. This VM can be managed with the \'onevm\' command -valid options: name, multiple +valid options: name, multiple, hold . .fi . @@ -196,6 +215,20 @@ be launched to modify the current content\. . .IP "" 0 +. +.IP "\(bu" 4 +rename \fItemplateid\fR \fIname\fR +. +.IP "" 4 +. +.nf + +Renames the Template +. +.fi +. +.IP "" 0 + . .IP "\(bu" 4 list [\fIfilterflag\fR] @@ -205,7 +238,7 @@ list [\fIfilterflag\fR] .nf Lists Templates in the pool -valid options: list, delay, xml, numeric, describe +valid options: list, delay, filter, xml, numeric, describe . .fi . @@ -235,7 +268,7 @@ top [\fIfilterflag\fR] .nf Lists Templates continuously -valid options: list, delay, xml, numeric, describe +valid options: list, delay, filter, xml, numeric, describe . .fi . @@ -366,7 +399,7 @@ user VMTEMPLATE of the user identified by the username .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 d13021eb3f..ae09e42817 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" "October 2012" "" "oneuser(1) -- manages OpenNebula users" +.TH "ONEUSER" "1" "January 2013" "" "oneuser(1) -- manages OpenNebula users" . .SH "NAME" \fBoneuser\fR @@ -14,7 +14,8 @@ .nf \-r, \-\-read\-file Read password from file - \-\-sha1 The password will be hashed using the sha1 algorithm + \-\-sha1 The password will be hashed using the sha1 + algorithm \-\-ssh SSH Auth system \-\-x509 x509 Auth system for x509 certificates \-k, \-\-key path_to_private_key_pem Path to the Private Key of the User @@ -25,12 +26,17 @@ \-\-time x Token duration in seconds, defaults to 3600 (1 h) \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command + \-f, \-\-filter x,y,z Filter data\. An array is specified with + column=value pairs\. \-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 + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -101,6 +107,41 @@ provided the editor will be launched to create new quotas\. . .IP "" 0 +. +.IP "\(bu" 4 +defaultquota [\fIfile\fR] +. +.IP "" 4 +. +.nf + +Sets the default quota limits for the users\. If a path is not provided +the editor will be launched to modify the current default quotas\. +. +.fi +. +.IP "" 0 + +. +.IP "\(bu" 4 +umask \fIrange|userid_list\fR [\fImask\fR] +. +.IP "" 4 +. +.nf + +Changes the umask used to create the default permissions\. In a similar +way to the Unix umask command, the expected value is a three\-digit +base\-8 number\. Each digit is a mask that disables permissions for the +owner, group and other, respectively\. + +If mask is not given, or if it is an empty string, the umask will +be unset +. +.fi +. +.IP "" 0 + . .IP "\(bu" 4 login \fIusername\fR @@ -214,7 +255,7 @@ list .nf Lists Users in the pool -valid options: list, delay, xml, numeric, describe +valid options: list, delay, filter, xml, numeric, describe . .fi . @@ -355,7 +396,7 @@ User password .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 06d80561ea..14eb0a0b6a 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" "October 2012" "" "onevdc(1) -- manages OpenNebula Virtual DataCenters" +.TH "ONEVDC" "1" "January 2013" "" "onevdc(1) -- manages OpenNebula Virtual DataCenters" . .SH "NAME" \fBonevdc\fR @@ -178,7 +178,7 @@ VDC ID .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 bb0c2de4c1..f2a42b03ec 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" "October 2012" "" "onevm(1) -- manages OpenNebula virtual machines" +.TH "ONEVM" "1" "January 2013" "" "onevm(1) -- manages OpenNebula virtual machines" . .SH "NAME" \fBonevm\fR @@ -14,19 +14,36 @@ .nf \-m, \-\-multiple x Instance multiple VMs + \-\-hold Creates the new VM on hold state instead of pending \-\-name name Name for the new VM - \-\-cpu cpu CPU percentage reserved for the VM (1=100% one CPU) + \-\-cpu cpu CPU percentage reserved for the VM (1=100% one + CPU) + \-\-vcpu vcpu Number of virtualized CPUs \-\-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 + \-\-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 + \-\-vnc Add VNC server to the VM + \-\-ssh [file] Add an ssh public key to the context\. If the + file is omited then the user variable + SSH_PUBLIC_KEY will be used\. + \-\-net_context Add network contextualization parameters + \-\-context line1,line2,line3 Lines to add to the context section + \-\-boot device Select boot device (hd|fd|cdrom|network) + \-\-dry Just print the template \-t, \-\-type type Type of the new Image + \-e, \-\-enforce Enforce that the host capacity is not exceeded \-f, \-\-file file Selects the template file \-i, \-\-image id|name Selects the image - \-t, \-\-target type Device where the image will be attached + \-t, \-\-target target 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 + \-f, \-\-filter x,y,z Filter data\. An array is specified with + column=value pairs\. \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs \-k, \-\-kilobytes Show units in kilobytes @@ -34,6 +51,9 @@ \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -63,7 +83,22 @@ Examples: \- 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 +valid options: multiple, hold, name, cpu, vcpu, arch, memory, disk, network, raw, vnc, ssh, net_context, context, boot, dry +. +.fi +. +.IP "" 0 + +. +.IP "\(bu" 4 +update \fIvmid\fR [\fIfile\fR] +. +.IP "" 4 +. +.nf + +Update the user template contents\. If a path is not provided the +editor will be launched to modify the current content\. . .fi . @@ -217,6 +252,7 @@ deployment, in a standard installation the Scheduler is in charge of this decision States: PENDING +valid options: enforce . .fi . @@ -233,6 +269,7 @@ livemigrate \fIrange|vmid_list\fR \fIhostid\fR Migrates the given running VM to another Host without downtime States: RUNNING +valid options: enforce . .fi . @@ -249,6 +286,7 @@ migrate \fIrange|vmid_list\fR \fIhostid\fR Saves the given running VM and starts it again in the specified Host States: RUNNING +valid options: enforce . .fi . @@ -465,6 +503,20 @@ States: RUNNING . .IP "" 0 +. +.IP "\(bu" 4 +rename \fIvmid\fR \fIname\fR +. +.IP "" 4 +. +.nf + +Renames the VM +. +.fi +. +.IP "" 0 + . .IP "\(bu" 4 list [\fIfilterflag\fR] @@ -474,7 +526,7 @@ list [\fIfilterflag\fR] .nf Lists VMs in the pool -valid options: list, delay, xml, numeric, kilobytes, describe +valid options: list, delay, filter, xml, numeric, kilobytes, describe . .fi . @@ -504,7 +556,7 @@ top [\fIfilterflag\fR] .nf Lists Images continuously -valid options: list, delay, xml, numeric, kilobytes +valid options: list, delay, filter, xml, numeric, kilobytes . .fi . @@ -663,7 +715,7 @@ Integer .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 b88e71361b..3b0b8bc7f7 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" "October 2012" "" "onevnet(1) -- manages OpenNebula networks" +.TH "ONEVNET" "1" "January 2013" "" "onevnet(1) -- manages OpenNebula networks" . .SH "NAME" \fBonevnet\fR @@ -16,6 +16,8 @@ \-c, \-\-cluster id|name Selects the cluster \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command + \-f, \-\-filter x,y,z Filter data\. An array is specified with + column=value pairs\. \-x, \-\-xml Show the resource in xml format \-n, \-\-numeric Do not translate user and group IDs \-k, \-\-kilobytes Show units in kilobytes @@ -23,6 +25,9 @@ \-v, \-\-verbose Verbose mode \-h, \-\-help Show this message \-V, \-\-version Show version and copyright information + \-\-user name User name used to connect to OpenNebula + \-\-password password Password to authenticate with OpenNebula + \-\-endpoint endpoint URL of OpenNebula xmlrpc frontend . .fi . @@ -194,7 +199,7 @@ list [\fIfilterflag\fR] .nf Lists Virtual Networks in the pool -valid options: list, delay, xml, numeric, kilobytes, describe +valid options: list, delay, filter, xml, numeric, kilobytes, describe . .fi . @@ -230,6 +235,20 @@ be launched to modify the current content\. . .IP "" 0 +. +.IP "\(bu" 4 +rename \fIvnetid\fR \fIname\fR +. +.IP "" 4 +. +.nf + +Renames the Virtual Network +. +.fi +. +.IP "" 0 + . .IP "" 0 . @@ -355,7 +374,7 @@ user VNET of the user identified by the username .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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 aee046ad94..3bb5dbc4fe 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" "October 2012" "" "onezone(1) -- manages OpenNebula zones" +.TH "ONEZONE" "1" "January 2013" "" "onezone(1) -- manages OpenNebula zones" . .SH "NAME" \fBonezone\fR @@ -148,7 +148,7 @@ Zone ID .IP "" 0 . .SH "LICENSE" -OpenNebula 3\.9\.0 Copyright 2002\-2012, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.9\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .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/router/init.rb b/share/router/init.rb index 9d49eaa5fe..fbae8b5b1b 100644 --- a/share/router/init.rb +++ b/share/router/init.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/rubygems/SConstruct b/share/rubygems/SConstruct index dfd637daab..0a2dcd197f 100644 --- a/share/rubygems/SConstruct +++ b/share/rubygems/SConstruct @@ -1,7 +1,7 @@ # SConstruct for share/scripts/rubygems # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/rubygems/generate b/share/rubygems/generate index a6c17e7f7b..a7313b843d 100755 --- a/share/rubygems/generate +++ b/share/rubygems/generate @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -21,7 +21,7 @@ require 'tmpdir' DEFAULTS={ - :version => "3.8.0", + :version => "3.9.0.beta", :date => Time.now.strftime("%Y-%m-%d"), :dependencies => [] } @@ -51,8 +51,9 @@ GEM_DESCRIPTION={ :oca => { :name => 'oca', :files => [ - ['src/oca/ruby/OpenNebula.rb', '/lib'], - ['src/oca/ruby/OpenNebula/*.rb', '/lib/OpenNebula'], + ['src/oca/ruby/opennebula.rb', '/lib'], + ['src/oca/ruby/opennebula/*.rb', '/lib/opennebula'], + ['src/authm_mad/remotes/**/*.rb', '/lib/opennebula'], ['NOTICE', ''], ['LICENSE', ''] ], diff --git a/share/scons/get_xmlrpc_config b/share/scons/get_xmlrpc_config index d54325a66e..bf2e2a66eb 100755 --- a/share/scons/get_xmlrpc_config +++ b/share/scons/get_xmlrpc_config @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scons/lex_bison.py b/share/scons/lex_bison.py index 3f427b6303..48b59cff1d 100644 --- a/share/scons/lex_bison.py +++ b/share/scons/lex_bison.py @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scons/po2json.rb b/share/scons/po2json.rb index 9153736f34..46dbd89579 100755 --- a/share/scons/po2json.rb +++ b/share/scons/po2json.rb @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/centos-5/context/init.sh b/share/scripts/centos-5/context/init.sh index 3f90d7a59a..2e9f7be97e 100644 --- a/share/scripts/centos-5/context/init.sh +++ b/share/scripts/centos-5/context/init.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/centos-5/net-vmcontext/vmcontext b/share/scripts/centos-5/net-vmcontext/vmcontext index a195a6749a..5e7966d70b 100755 --- a/share/scripts/centos-5/net-vmcontext/vmcontext +++ b/share/scripts/centos-5/net-vmcontext/vmcontext @@ -4,7 +4,7 @@ # description: network reconfigure # # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/context-packages/SConstruct b/share/scripts/context-packages/SConstruct index ea3b26fa60..2c6324e31f 100644 --- a/share/scripts/context-packages/SConstruct +++ b/share/scripts/context-packages/SConstruct @@ -1,7 +1,7 @@ # SConstruct for share/scripts/context-packages # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/context-packages/base/etc/init.d/vmcontext b/share/scripts/context-packages/base/etc/init.d/vmcontext index 7fb86899f0..b05cf93d5d 100755 --- a/share/scripts/context-packages/base/etc/init.d/vmcontext +++ b/share/scripts/context-packages/base/etc/init.d/vmcontext @@ -4,7 +4,7 @@ # description: network reconfigure # # -------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L. # +# Copyright 2010-2013, C12G Labs S.L. # # # # 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 # diff --git a/share/scripts/context-packages/base/etc/one-context.d/01-dns b/share/scripts/context-packages/base/etc/one-context.d/01-dns index bd78ac4bf3..b72277f68e 100755 --- a/share/scripts/context-packages/base/etc/one-context.d/01-dns +++ b/share/scripts/context-packages/base/etc/one-context.d/01-dns @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L. # +# Copyright 2010-2013, C12G Labs S.L. # # # # 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 # diff --git a/share/scripts/context-packages/base/etc/one-context.d/02-ssh_public_key b/share/scripts/context-packages/base/etc/one-context.d/02-ssh_public_key index 1771a8e6e9..c87c96a430 100755 --- a/share/scripts/context-packages/base/etc/one-context.d/02-ssh_public_key +++ b/share/scripts/context-packages/base/etc/one-context.d/02-ssh_public_key @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L. # +# Copyright 2010-2013, C12G Labs S.L. # # # # 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 # diff --git a/share/scripts/context-packages/base_deb/etc/one-context.d/00-network b/share/scripts/context-packages/base_deb/etc/one-context.d/00-network index 0b91783943..d386181efa 100755 --- a/share/scripts/context-packages/base_deb/etc/one-context.d/00-network +++ b/share/scripts/context-packages/base_deb/etc/one-context.d/00-network @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L. # +# Copyright 2010-2013, C12G Labs S.L. # # # # 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 # diff --git a/share/scripts/context-packages/base_rpm/etc/one-context.d/00-network b/share/scripts/context-packages/base_rpm/etc/one-context.d/00-network index 47ac455148..92e630b645 100755 --- a/share/scripts/context-packages/base_rpm/etc/one-context.d/00-network +++ b/share/scripts/context-packages/base_rpm/etc/one-context.d/00-network @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L. # +# Copyright 2010-2013, C12G Labs S.L. # # # # 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 # diff --git a/share/scripts/context-packages/generate.sh b/share/scripts/context-packages/generate.sh index 246feedb88..3033859003 100755 --- a/share/scripts/context-packages/generate.sh +++ b/share/scripts/context-packages/generate.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L. # +# Copyright 2010-2013, C12G Labs S.L. # # # # 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 # diff --git a/share/scripts/context-packages/postinstall b/share/scripts/context-packages/postinstall index 1b47c1c6fb..0a277b1293 100755 --- a/share/scripts/context-packages/postinstall +++ b/share/scripts/context-packages/postinstall @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L. # +# Copyright 2010-2013, C12G Labs S.L. # # # # 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 # diff --git a/share/scripts/debian/context/init.sh b/share/scripts/debian/context/init.sh index 0b55ea93b2..e7eccbb4eb 100644 --- a/share/scripts/debian/context/init.sh +++ b/share/scripts/debian/context/init.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/debian/net-vmcontext/vmcontext b/share/scripts/debian/net-vmcontext/vmcontext index a0144c7296..72d9076cb2 100755 --- a/share/scripts/debian/net-vmcontext/vmcontext +++ b/share/scripts/debian/net-vmcontext/vmcontext @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/ganglia/push_ganglia b/share/scripts/ganglia/push_ganglia index ce5316e06a..ed7a90f989 100755 --- a/share/scripts/ganglia/push_ganglia +++ b/share/scripts/ganglia/push_ganglia @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/one b/share/scripts/one index 4f3514cd06..503cec61c6 100755 --- a/share/scripts/one +++ b/share/scripts/one @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/openSUSE/context/init.sh b/share/scripts/openSUSE/context/init.sh index db1cd90308..11d90e95cf 100644 --- a/share/scripts/openSUSE/context/init.sh +++ b/share/scripts/openSUSE/context/init.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/openSUSE/net-vmcontext/vmcontext b/share/scripts/openSUSE/net-vmcontext/vmcontext index 7e51b8879f..3d17da24f6 100755 --- a/share/scripts/openSUSE/net-vmcontext/vmcontext +++ b/share/scripts/openSUSE/net-vmcontext/vmcontext @@ -4,7 +4,7 @@ # description: network reconfigure # # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/ttylinux/context/init.sh b/share/scripts/ttylinux/context/init.sh index 3008708b9f..335316cf0d 100644 --- a/share/scripts/ttylinux/context/init.sh +++ b/share/scripts/ttylinux/context/init.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/ttylinux/net-vmcontext/vmcontexttty b/share/scripts/ttylinux/net-vmcontext/vmcontexttty index f0418533b6..f5f7075b93 100755 --- a/share/scripts/ttylinux/net-vmcontext/vmcontexttty +++ b/share/scripts/ttylinux/net-vmcontext/vmcontexttty @@ -4,7 +4,7 @@ # description: network reconfigure # # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/ubuntu/context/init.sh b/share/scripts/ubuntu/context/init.sh index e647eea0a7..33385d508c 100644 --- a/share/scripts/ubuntu/context/init.sh +++ b/share/scripts/ubuntu/context/init.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/ubuntu/net-vmcontext/README b/share/scripts/ubuntu/net-vmcontext/README index dd850ec6ec..6cff01b10a 100755 --- a/share/scripts/ubuntu/net-vmcontext/README +++ b/share/scripts/ubuntu/net-vmcontext/README @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/ubuntu/net-vmcontext/vmcontext b/share/scripts/ubuntu/net-vmcontext/vmcontext index a0144c7296..72d9076cb2 100755 --- a/share/scripts/ubuntu/net-vmcontext/vmcontext +++ b/share/scripts/ubuntu/net-vmcontext/vmcontext @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/share/scripts/vmcontext.sh b/share/scripts/vmcontext.sh index 28148290f8..fa9b311744 100755 --- a/share/scripts/vmcontext.sh +++ b/share/scripts/vmcontext.sh @@ -14,7 +14,7 @@ ### END INIT INFO # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/acl/AclManager.cc b/src/acl/AclManager.cc index 69f180be68..b455da5ee5 100644 --- a/src/acl/AclManager.cc +++ b/src/acl/AclManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -168,6 +168,19 @@ const bool AclManager::authorize( resource_gid_req = AclRule::NONE_ID; } + long long resource_cid_req; + + if ( obj_perms.cid >= 0 ) + { + resource_cid_req = obj_perms.obj_type | + AclRule::CLUSTER_ID | + obj_perms.cid; + } + else + { + resource_cid_req = AclRule::NONE_ID; + } + long long resource_all_req = obj_perms.obj_type | AclRule::ALL_ID; long long rights_req = op; @@ -179,6 +192,10 @@ const bool AclManager::authorize( AclRule::GROUP_ID | 0x00000000FFFFFFFFLL; + long long resource_cid_mask = obj_perms.obj_type | + AclRule::CLUSTER_ID | + 0x00000000FFFFFFFFLL; + // Create a temporal rule, to log the request long long log_resource; @@ -190,6 +207,10 @@ const bool AclManager::authorize( { log_resource = resource_gid_req; } + else if ( obj_perms.cid >= 0 ) + { + log_resource = resource_cid_req; + } else { log_resource = resource_all_req; @@ -226,10 +247,12 @@ const bool AclManager::authorize( auth = match_rules_wrapper(user_req, resource_oid_req, resource_gid_req, + resource_cid_req, resource_all_req, rights_req, resource_oid_mask, resource_gid_mask, + resource_cid_mask, tmp_rules); if ( auth == true ) { @@ -244,10 +267,12 @@ const bool AclManager::authorize( auth = match_rules_wrapper(user_req, resource_oid_req, resource_gid_req, + resource_cid_req, resource_all_req, rights_req, resource_oid_mask, resource_gid_mask, + resource_cid_mask, tmp_rules); if ( auth == true ) { @@ -262,10 +287,12 @@ const bool AclManager::authorize( auth = match_rules_wrapper(user_req, resource_oid_req, resource_gid_req, + resource_cid_req, resource_all_req, rights_req, resource_oid_mask, resource_gid_mask, + resource_cid_mask, tmp_rules); if ( auth == true ) { @@ -285,10 +312,12 @@ bool AclManager::match_rules_wrapper( long long user_req, long long resource_oid_req, long long resource_gid_req, + long long resource_cid_req, long long resource_all_req, long long rights_req, long long individual_obj_type, long long group_obj_type, + long long cluster_obj_type, multimap &tmp_rules) { bool auth = false; @@ -298,10 +327,12 @@ bool AclManager::match_rules_wrapper( user_req, resource_oid_req, resource_gid_req, + resource_cid_req, resource_all_req, rights_req, individual_obj_type, group_obj_type, + cluster_obj_type, tmp_rules); if ( auth == true ) @@ -316,10 +347,12 @@ bool AclManager::match_rules_wrapper( user_req, resource_oid_req, resource_gid_req, + resource_cid_req, resource_all_req, rights_req, individual_obj_type, group_obj_type, + cluster_obj_type, acl_rules); unlock(); @@ -334,10 +367,12 @@ bool AclManager::match_rules( long long user_req, long long resource_oid_req, long long resource_gid_req, + long long resource_cid_req, long long resource_all_req, long long rights_req, long long resource_oid_mask, long long resource_gid_mask, + long long resource_cid_mask, multimap &rules) { @@ -370,6 +405,9 @@ bool AclManager::match_rules( || // Or rule's object type and individual object ID match ( ( it->second->resource & resource_oid_mask ) == resource_oid_req ) + || + // Or rule's object type and cluster object ID match + ( ( it->second->resource & resource_cid_mask ) == resource_cid_req ) ); if ( auth == true ) @@ -586,6 +624,20 @@ void AclManager::del_gid_rules(int gid) /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ +void AclManager::del_cid_rules(int cid) +{ + long long request = AclRule::CLUSTER_ID | cid; + long long resource_gid_mask = AclRule::CLUSTER_ID | + 0x00000000FFFFFFFFLL; + + // Delete rules that match + // __ __/%cid __ + del_resource_matching_rules(request, resource_gid_mask); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + void AclManager::del_resource_rules(int oid, PoolObjectSQL::ObjectType obj_type) { long long request = obj_type | @@ -669,7 +721,8 @@ void AclManager::reverse_search(int uid, AuthRequest::Operation op, bool& all, vector& oids, - vector& gids) + vector& gids, + vector& cids) { ostringstream oss; @@ -681,6 +734,7 @@ void AclManager::reverse_search(int uid, long long resource_oid_req = obj_type | AclRule::INDIVIDUAL_ID; long long resource_gid_req = obj_type | AclRule::GROUP_ID; long long resource_all_req = obj_type | AclRule::ALL_ID; + long long resource_cid_req = obj_type | AclRule::CLUSTER_ID; long long rights_req = op; long long resource_oid_mask = @@ -689,6 +743,9 @@ void AclManager::reverse_search(int uid, long long resource_gid_mask = ( obj_type | AclRule::GROUP_ID ); + long long resource_cid_mask = + ( obj_type | AclRule::CLUSTER_ID ); + // Create a temporal rule, to log the request long long log_resource; @@ -751,6 +808,13 @@ void AclManager::reverse_search(int uid, { oids.push_back(it->second->resource_id()); } + + // Rule grants permission for all objects of a cluster + if ( ( it->second->resource & resource_cid_mask ) == resource_cid_req ) + { + cids.push_back(it->second->resource_id()); + } + } } @@ -760,6 +824,7 @@ void AclManager::reverse_search(int uid, { oids.clear(); gids.clear(); + cids.clear(); } } } diff --git a/src/acl/AclRule.cc b/src/acl/AclRule.cc index 561b8634e3..6233168c7a 100644 --- a/src/acl/AclRule.cc +++ b/src/acl/AclRule.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -17,13 +17,14 @@ #include "AclRule.h" #include "AuthRequest.h" #include "PoolObjectSQL.h" - + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ const long long AclRule::INDIVIDUAL_ID = 0x0000000100000000LL; const long long AclRule::GROUP_ID = 0x0000000200000000LL; const long long AclRule::ALL_ID = 0x0000000400000000LL; +const long long AclRule::CLUSTER_ID = 0x0000000800000000LL; const long long AclRule::NONE_ID = 0x1000000000000000LL; @@ -49,6 +50,11 @@ const AuthRequest::Operation AclRule::auth_operations[] = { AuthRequest::CREATE }; +const long long AclRule::INVALID_CLUSTER_OBJECTS = + PoolObjectSQL::VM | PoolObjectSQL::IMAGE | PoolObjectSQL::USER | + PoolObjectSQL::TEMPLATE | PoolObjectSQL::GROUP | PoolObjectSQL::ACL | + PoolObjectSQL::CLUSTER | PoolObjectSQL::DOCUMENT; + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -56,6 +62,7 @@ bool AclRule::malformed(string& error_str) const { ostringstream oss; bool error = false; + long long resource_type; // Check user @@ -122,7 +129,11 @@ bool AclRule::malformed(string& error_str) const // Check resource - if ( (resource & INDIVIDUAL_ID) != 0 && (resource & GROUP_ID) != 0 ) + if ( ( (resource & INDIVIDUAL_ID) != 0 && (resource & 0xF00000000LL) != INDIVIDUAL_ID ) || + ( (resource & GROUP_ID) != 0 && (resource & 0xF00000000LL) != GROUP_ID ) || + ( (resource & CLUSTER_ID) != 0 && (resource & 0xF00000000LL) != CLUSTER_ID ) || + ( (resource & ALL_ID) != 0 && (resource & 0xF00000000LL) != ALL_ID ) + ) { if ( error ) { @@ -130,10 +141,13 @@ bool AclRule::malformed(string& error_str) const } error = true; - oss << "[resource] INDIVIDUAL (#) and GROUP (@) bits are exclusive"; + oss << "[resource] INDIVIDUAL (#), GROUP (@), CLUSTER (%) " + << "and ALL (*) bits are exclusive"; } - if ( (resource & INDIVIDUAL_ID) != 0 && (resource & ALL_ID) != 0 ) + resource_type = resource_code() & 0xFFFFFFF000000000LL; + + if ((resource & CLUSTER_ID) && (resource_type & INVALID_CLUSTER_OBJECTS)) { if ( error ) { @@ -141,10 +155,13 @@ bool AclRule::malformed(string& error_str) const } error = true; - oss << "[resource] INDIVIDUAL (#) and ALL (*) bits are exclusive"; + oss << "[resource] CLUSTER(%) selector can be applied only to " + << PoolObjectSQL::type_to_str(PoolObjectSQL::DATASTORE) << ", " + << PoolObjectSQL::type_to_str(PoolObjectSQL::HOST) << " and " + << PoolObjectSQL::type_to_str(PoolObjectSQL::NET) << " types"; } - if ( (resource & GROUP_ID) != 0 && (resource & ALL_ID) != 0 ) + if ( (resource & 0xF00000000LL) == 0 ) { if ( error ) { @@ -152,18 +169,7 @@ bool AclRule::malformed(string& error_str) const } error = true; - oss << "[resource] GROUP (@) and ALL (*) bits are exclusive"; - } - - if ( (resource & 0x700000000LL) == 0 ) - { - if ( error ) - { - oss << "; "; - } - - error = true; - oss << "[resource] is missing one of the INDIVIDUAL, GROUP or ALL bits"; + oss << "[resource] is missing one of the INDIVIDUAL, GROUP, CLUSTER or ALL bits"; } if ( resource_id() < 0 ) @@ -294,6 +300,10 @@ void AclRule::build_str() { oss << "#" << resource_id(); } + else if ( (resource & CLUSTER_ID) != 0 ) + { + oss << "%" << resource_id(); + } else if ( (resource & ALL_ID) != 0 ) { oss << "*"; @@ -302,7 +312,7 @@ void AclRule::build_str() { oss << "??"; } - + oss << " "; prefix = false; @@ -360,7 +370,7 @@ int AclRule::from_xml(xmlNodePtr node) break; } - xmlNodePtr elem = acl->children; + xmlNodePtr elem = acl->children; if ( elem->type != XML_TEXT_NODE ) { diff --git a/src/acl/SConstruct b/src/acl/SConstruct index 1a115fba08..568bd3499f 100644 --- a/src/acl/SConstruct +++ b/src/acl/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/authm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/authm/AuthManager.cc b/src/authm/AuthManager.cc index c7ba3b694b..2eaa4dc507 100644 --- a/src/authm/AuthManager.cc +++ b/src/authm/AuthManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/authm/AuthManagerDriver.cc b/src/authm/AuthManagerDriver.cc index b83858497d..d4b4b93b5f 100644 --- a/src/authm/AuthManagerDriver.cc +++ b/src/authm/AuthManagerDriver.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/authm/SConstruct b/src/authm/SConstruct index a327a94f39..1d11fafa0d 100644 --- a/src/authm/SConstruct +++ b/src/authm/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/authm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/authm/test/AuthManagerTest.cc b/src/authm/test/AuthManagerTest.cc index d5c709aa2f..f2834c7b36 100644 --- a/src/authm/test/AuthManagerTest.cc +++ b/src/authm/test/AuthManagerTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/authm/test/SConstruct b/src/authm/test/SConstruct index 3d7c89cba9..0ca18a3858 100644 --- a/src/authm/test/SConstruct +++ b/src/authm/test/SConstruct @@ -1,4 +1,4 @@ -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/authm/test/dummy b/src/authm/test/dummy index c3fa9f79ee..56a2d8474b 100755 --- a/src/authm/test/dummy +++ b/src/authm/test/dummy @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/authm_mad/one_auth_mad b/src/authm_mad/one_auth_mad index 837f5b9390..492970da97 100755 --- a/src/authm_mad/one_auth_mad +++ b/src/authm_mad/one_auth_mad @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/authm_mad/one_auth_mad.rb b/src/authm_mad/one_auth_mad.rb index b440c0791d..172275d1db 100755 --- a/src/authm_mad/one_auth_mad.rb +++ b/src/authm_mad/one_auth_mad.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/authm_mad/remotes/dummy/authenticate b/src/authm_mad/remotes/dummy/authenticate index 0917ac6d84..d0c9c24dc2 100755 --- a/src/authm_mad/remotes/dummy/authenticate +++ b/src/authm_mad/remotes/dummy/authenticate @@ -1,7 +1,7 @@ #!/usr/bin/env bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/authm_mad/remotes/ldap/authenticate b/src/authm_mad/remotes/ldap/authenticate index 516c3e37b1..0beea92d5a 100755 --- a/src/authm_mad/remotes/ldap/authenticate +++ b/src/authm_mad/remotes/ldap/authenticate @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # ---------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L # +# Copyright 2010-2013, C12G Labs S.L # # # # 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 # @@ -29,7 +29,7 @@ end $: << RUBY_LIB_LOCATION require 'yaml' -require 'ldap_auth' +require 'opennebula/ldap_auth' require 'uri' if defined?(URI::Parser) @@ -66,7 +66,7 @@ order.each do |server_name| end begin - ldap=LdapAuth.new(server_conf) + ldap=OpenNebula::LdapAuth.new(server_conf) user_name=ldap.find_user(user) diff --git a/src/authm_mad/remotes/ldap/ldap_auth.conf b/src/authm_mad/remotes/ldap/ldap_auth.conf index 3b97f1e92e..400ccd50aa 100644 --- a/src/authm_mad/remotes/ldap/ldap_auth.conf +++ b/src/authm_mad/remotes/ldap/ldap_auth.conf @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L # +# Copyright 2010-2013, C12G Labs S.L # # # # 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 # diff --git a/src/authm_mad/remotes/ldap/ldap_auth.rb b/src/authm_mad/remotes/ldap/ldap_auth.rb index 7f3293c269..498c2bc9bc 100644 --- a/src/authm_mad/remotes/ldap/ldap_auth.rb +++ b/src/authm_mad/remotes/ldap/ldap_auth.rb @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L # +# Copyright 2010-2013, C12G Labs S.L # # # # 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 # @@ -17,7 +17,9 @@ require 'rubygems' require 'net/ldap' -class LdapAuth +module OpenNebula; end + +class OpenNebula::LdapAuth def initialize(options) @options={ :host => 'localhost', diff --git a/src/authm_mad/remotes/ldap/test/ldap_auth_spec.rb b/src/authm_mad/remotes/ldap/test/ldap_auth_spec.rb index 62b72dc9ac..bf5edfee73 100644 --- a/src/authm_mad/remotes/ldap/test/ldap_auth_spec.rb +++ b/src/authm_mad/remotes/ldap/test/ldap_auth_spec.rb @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L # +# Copyright 2010-2013, C12G Labs S.L # # # # 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 # diff --git a/src/authm_mad/remotes/plain/authenticate b/src/authm_mad/remotes/plain/authenticate index 36489712fd..8981d7b265 100755 --- a/src/authm_mad/remotes/plain/authenticate +++ b/src/authm_mad/remotes/plain/authenticate @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/authm_mad/remotes/server_cipher/authenticate b/src/authm_mad/remotes/server_cipher/authenticate index 9973e6e5ba..812932bf2a 100755 --- a/src/authm_mad/remotes/server_cipher/authenticate +++ b/src/authm_mad/remotes/server_cipher/authenticate @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -28,7 +28,7 @@ end $: << RUBY_LIB_LOCATION -require 'server_cipher_auth' +require 'opennebula/server_cipher_auth' require 'scripts_common' user = ARGV[0] # username as registered in OpenNebula @@ -38,7 +38,7 @@ secret = ARGV[2] # Base64 encoded secret as obtained from login_token #OpenNebula.log_debug("Authenticating #{user}, with password #{pass} (#{secret})") begin - server_auth = ServerCipherAuth.new_driver + server_auth = OpenNebula::ServerCipherAuth.new_driver rc = server_auth.authenticate(user, pass, secret) rescue => e OpenNebula.error_message e.message @@ -50,4 +50,4 @@ if rc == true else OpenNebula.error_message rc exit -1 -end \ No newline at end of file +end diff --git a/src/authm_mad/remotes/server_cipher/server_cipher_auth.rb b/src/authm_mad/remotes/server_cipher/server_cipher_auth.rb index 22ed7239fd..78476efa7d 100644 --- a/src/authm_mad/remotes/server_cipher/server_cipher_auth.rb +++ b/src/authm_mad/remotes/server_cipher/server_cipher_auth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -20,10 +20,12 @@ require 'digest/sha1' require 'base64' require 'fileutils' +module OpenNebula; end + # Server authentication class. This method can be used by OpenNebula services # to let access authenticated users by other means. It is based on OpenSSL # symmetric ciphers -class ServerCipherAuth +class OpenNebula::ServerCipherAuth ########################################################################### #Constants with paths to relevant files and defaults ########################################################################### @@ -142,4 +144,5 @@ class ServerCipherAuth return rc end -end \ No newline at end of file +end + diff --git a/src/authm_mad/remotes/server_x509/authenticate b/src/authm_mad/remotes/server_x509/authenticate index 77be2ea3f5..bcb789ab7f 100755 --- a/src/authm_mad/remotes/server_x509/authenticate +++ b/src/authm_mad/remotes/server_x509/authenticate @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -28,7 +28,7 @@ end $: << RUBY_LIB_LOCATION -require 'server_x509_auth' +require 'opennebula/server_x509_auth' require 'scripts_common' user = ARGV[0] # username as registered in OpenNebula @@ -38,7 +38,7 @@ secret = ARGV[2] # Base64 encoded secret as obtained from login_token #OpenNebula.log_debug("Authenticating #{user}, with password #{pass} (#{secret})") begin - server_auth = ServerX509Auth.new + server_auth = OpenNebula::ServerX509Auth.new dsecret = Base64::decode64(secret) rc = server_auth.authenticate(user, pass, dsecret) diff --git a/src/authm_mad/remotes/server_x509/server_x509_auth.rb b/src/authm_mad/remotes/server_x509/server_x509_auth.rb index 27c1df42ee..6799e43fd6 100644 --- a/src/authm_mad/remotes/server_x509/server_x509_auth.rb +++ b/src/authm_mad/remotes/server_x509/server_x509_auth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -18,12 +18,14 @@ require 'openssl' require 'base64' require 'fileutils' -require 'x509_auth' +require 'opennebula/x509_auth' + +module OpenNebula; end # Server authentication class. This authmethod can be used by opennebula services # to let access authenticated users by other means. It is based on x509 server # certificates -class ServerX509Auth < X509Auth +class OpenNebula::ServerX509Auth < OpenNebula::X509Auth ########################################################################### #Constants with paths to relevant files and defaults ########################################################################### @@ -61,7 +63,7 @@ class ServerX509Auth < X509Auth ########################################################################### # Creates a ServerCipher for client and driver sage - class << ServerX509Auth + class << OpenNebula::ServerX509Auth alias :new_client :new alias :new_driver :new end @@ -99,4 +101,4 @@ class ServerX509Auth < X509Auth return e.message end end -end \ No newline at end of file +end diff --git a/src/authm_mad/remotes/ssh/authenticate b/src/authm_mad/remotes/ssh/authenticate index d272ec0b57..e93e1abf02 100755 --- a/src/authm_mad/remotes/ssh/authenticate +++ b/src/authm_mad/remotes/ssh/authenticate @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -28,7 +28,7 @@ end $: << RUBY_LIB_LOCATION -require 'ssh_auth' +require 'opennebula/ssh_auth' require 'scripts_common' user = ARGV[0] @@ -37,7 +37,7 @@ secret = ARGV[2] #OpenNebula.log_debug("Authenticating #{user}, with password #{pass} (#{secret})") begin - ssh_auth = SshAuth.new(:public_key=>pass) + ssh_auth = OpenNebula::SshAuth.new(:public_key=>pass) rescue Exception => e OpenNebula.error_message e.message exit -1 diff --git a/src/authm_mad/remotes/ssh/ssh_auth.rb b/src/authm_mad/remotes/ssh/ssh_auth.rb index 7a322337cf..0b8275b115 100644 --- a/src/authm_mad/remotes/ssh/ssh_auth.rb +++ b/src/authm_mad/remotes/ssh/ssh_auth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -20,10 +20,12 @@ require 'openssl' require 'base64' require 'fileutils' +module OpenNebula; end + # SSH key authentication class. It can be used as a driver for auth_mad # as auth method is defined. It also holds some helper methods to be used # by oneauth command -class SshAuth +class OpenNebula::SshAuth LOGIN_PATH = ENV['HOME']+'/.one/one_ssh' # Initialize SshAuth object diff --git a/src/authm_mad/remotes/x509/authenticate b/src/authm_mad/remotes/x509/authenticate index 5722049887..ffa2d95c7e 100755 --- a/src/authm_mad/remotes/x509/authenticate +++ b/src/authm_mad/remotes/x509/authenticate @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -28,7 +28,7 @@ end $: << RUBY_LIB_LOCATION -require 'x509_auth' +require 'opennebula/x509_auth' require 'scripts_common' user = ARGV[0] # username as registered in OpenNebula @@ -44,7 +44,7 @@ begin token = asecret[0] certs = asecret[1..-1] - x509_auth = X509Auth.new(:certs_pem=>certs) + x509_auth = OpenNebula::X509Auth.new(:certs_pem=>certs) rc = x509_auth.authenticate(user, pass, token) rescue => e diff --git a/src/authm_mad/remotes/x509/x509_auth.rb b/src/authm_mad/remotes/x509/x509_auth.rb index cad0ca7f29..5e261745e7 100644 --- a/src/authm_mad/remotes/x509/x509_auth.rb +++ b/src/authm_mad/remotes/x509/x509_auth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -19,10 +19,12 @@ require 'base64' require 'fileutils' require 'yaml' +module OpenNebula; end + # X509 authentication class. It can be used as a driver for auth_mad # as auth method is defined. It also holds some helper methods to be used # by oneauth command -class X509Auth +class OpenNebula::X509Auth ########################################################################### #Constants with paths to relevant files and defaults ########################################################################### diff --git a/src/cli/cli_helper.rb b/src/cli/cli_helper.rb index 4518d633b3..ff095ffdc5 100644 --- a/src/cli/cli_helper.rb +++ b/src/cli/cli_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/command_parser.rb b/src/cli/command_parser.rb index 9094183cd4..e434958d83 100644 --- a/src/cli/command_parser.rb +++ b/src/cli/command_parser.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/one_helper.rb b/src/cli/one_helper.rb index 8330a43446..d8052e31a1 100644 --- a/src/cli/one_helper.rb +++ b/src/cli/one_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -16,13 +16,13 @@ require 'cli_helper' -require 'OpenNebula' +require 'opennebula' include OpenNebula module OpenNebulaHelper ONE_VERSION=<<-EOT OpenNebula #{OpenNebula::VERSION} -Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs 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 @@ -623,7 +623,7 @@ EOT end end - def OpenNebulaHelper.update_template(id, resource, path=nil) + def OpenNebulaHelper.update_template(id, resource, path=nil, xpath='TEMPLATE') unless path require 'tempfile' @@ -637,7 +637,7 @@ EOT exit -1 end - tmp << resource.template_str + tmp << resource.template_like_str(xpath) tmp.flush editor_path = ENV["EDITOR"] ? ENV["EDITOR"] : EDITOR_PATH diff --git a/src/cli/one_helper/oneacct_helper.rb b/src/cli/one_helper/oneacct_helper.rb index ffd08c048f..385c1f7921 100644 --- a/src/cli/one_helper/oneacct_helper.rb +++ b/src/cli/one_helper/oneacct_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,6 +15,7 @@ #--------------------------------------------------------------------------- # require 'one_helper' +require 'optparse/time' class AcctHelper < OpenNebulaHelper::OneHelper START_TIME = { @@ -22,7 +23,7 @@ class AcctHelper < OpenNebulaHelper::OneHelper :short => "-s TIME", :large => "--start TIME" , :description => "Start date and time to take into account", - :format => String # TODO Time + :format => Time } END_TIME = { @@ -30,7 +31,7 @@ class AcctHelper < OpenNebulaHelper::OneHelper :short => "-e TIME", :large => "--end TIME" , :description => "End date and time", - :format => String # TODO Time + :format => Time } USERFILTER = { @@ -144,7 +145,7 @@ class AcctHelper < OpenNebulaHelper::OneHelper default :VID, :HOSTNAME, :REASON, :START_TIME, :END_TIME, :MEMORY, :CPU, :NET_RX, :NET_TX end - def self.print_start_enc_time_header(start_time, end_time) + def self.print_start_end_time_header(start_time, end_time) print "Showing active history records from " CLIHelper.scr_bold diff --git a/src/cli/one_helper/oneacl_helper.rb b/src/cli/one_helper/oneacl_helper.rb index 989be55de1..aaf009190b 100644 --- a/src/cli/one_helper/oneacl_helper.rb +++ b/src/cli/one_helper/oneacl_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/one_helper/onecluster_helper.rb b/src/cli/one_helper/onecluster_helper.rb index 2cd5716f2d..6e521607be 100644 --- a/src/cli/one_helper/onecluster_helper.rb +++ b/src/cli/one_helper/onecluster_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -96,12 +96,13 @@ class OneClusterHelper < OpenNebulaHelper::OneHelper end def format_resource(cluster) - str="%-15s: %-20s" + str="%-18s: %-20s" str_h1="%-80s" CLIHelper.print_header(str_h1 % "CLUSTER #{cluster['ID']} INFORMATION") puts str % ["ID", cluster.id.to_s] puts str % ["NAME", cluster.name] + puts str % ["SYSTEM DS", cluster['SYSTEM_DS']] puts CLIHelper.print_header(str_h1 % "CLUSTER TEMPLATE", false) diff --git a/src/cli/one_helper/onedatastore_helper.rb b/src/cli/one_helper/onedatastore_helper.rb index 3123cf18f0..72e141a188 100644 --- a/src/cli/one_helper/onedatastore_helper.rb +++ b/src/cli/one_helper/onedatastore_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/one_helper/onegroup_helper.rb b/src/cli/one_helper/onegroup_helper.rb index 7bbcaa44dc..f9271bba9a 100644 --- a/src/cli/one_helper/onegroup_helper.rb +++ b/src/cli/one_helper/onegroup_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/one_helper/onehost_helper.rb b/src/cli/one_helper/onehost_helper.rb index e52c4a1704..7382b70e37 100644 --- a/src/cli/one_helper/onehost_helper.rb +++ b/src/cli/one_helper/onehost_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/one_helper/oneimage_helper.rb b/src/cli/one_helper/oneimage_helper.rb index 0155273a64..c0772bbfc5 100644 --- a/src/cli/one_helper/oneimage_helper.rb +++ b/src/cli/one_helper/oneimage_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -323,9 +323,12 @@ class OneImageHelper < OpenNebulaHelper::OneHelper end template=create_image_variables( - options, template_options-[:persistent, :dry]) + options, template_options-[:persistent, :dry, :prefix]) template<<"PERSISTENT=YES\n" if options[:persistent] + if options[:prefix] + template<<"DEV_PREFIX=\"#{options[:prefix]}\"\n" + end [0, template] end diff --git a/src/cli/one_helper/onequota_helper.rb b/src/cli/one_helper/onequota_helper.rb index 5925c0d6da..3290d76306 100644 --- a/src/cli/one_helper/onequota_helper.rb +++ b/src/cli/one_helper/onequota_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/one_helper/onetemplate_helper.rb b/src/cli/one_helper/onetemplate_helper.rb index 4480283b5e..425e25d2d3 100644 --- a/src/cli/one_helper/onetemplate_helper.rb +++ b/src/cli/one_helper/onetemplate_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/one_helper/oneuser_helper.rb b/src/cli/one_helper/oneuser_helper.rb index 8a04444ada..60e2143cb9 100644 --- a/src/cli/one_helper/oneuser_helper.rb +++ b/src/cli/one_helper/oneuser_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -60,10 +60,10 @@ class OneUserHelper < OpenNebulaHelper::OneHelper return -1, "You have to specify the --key option" end - require 'ssh_auth' + require 'opennebula/ssh_auth' begin - auth = SshAuth.new(:private_key=>options[:key]) + auth = OpenNebula::SshAuth.new(:private_key=>options[:key]) rescue Exception => e return -1, e.message end @@ -74,11 +74,11 @@ class OneUserHelper < OpenNebulaHelper::OneHelper return -1, "You have to specify the --cert option" end - require 'x509_auth' + require 'opennebula/x509_auth' begin cert = [File.read(options[:cert])] - auth = X509Auth.new(:certs_pem=>cert) + auth = OpenNebula::X509Auth.new(:certs_pem=>cert) rescue Exception => e return -1, e.message end @@ -92,17 +92,17 @@ class OneUserHelper < OpenNebulaHelper::OneHelper def self.login(username, options) case options[:driver] when OpenNebula::User::SSH_AUTH - require 'ssh_auth' + require 'opennebula/ssh_auth' options[:key] ||= ENV['HOME']+'/.ssh/id_rsa' begin - auth = SshAuth.new(:private_key=>options[:key]) + auth = OpenNebula::SshAuth.new(:private_key=>options[:key]) rescue Exception => e return -1, e.message end when OpenNebula::User::X509_AUTH - require 'x509_auth' + require 'opennebula/x509_auth' options[:cert] ||= ENV['X509_USER_CERT'] options[:key] ||= ENV['X509_USER_KEY'] @@ -111,12 +111,12 @@ class OneUserHelper < OpenNebulaHelper::OneHelper certs = [File.read(options[:cert])] key = File.read(options[:key]) - auth = X509Auth.new(:certs_pem=>certs, :key_pem=>key) + auth = OpenNebula::X509Auth.new(:certs_pem=>certs, :key_pem=>key) rescue Exception => e return -1, e.message end when OpenNebula::User::X509_PROXY_AUTH - require 'x509_auth' + require 'opennebula/x509_auth' options[:proxy] ||= ENV['X509_PROXY_CERT'] @@ -129,7 +129,7 @@ class OneUserHelper < OpenNebulaHelper::OneHelper rc = proxy.match(/(-+BEGIN RSA PRIVATE KEY-+\n[^-]*\n-+END RSA PRIVATE KEY-+)/) key= rc[1] - auth = X509Auth.new(:certs_pem=>certs, :key_pem=>key) + auth = OpenNebula::X509Auth.new(:certs_pem=>certs, :key_pem=>key) rescue => e return -1, e.message end diff --git a/src/cli/one_helper/onevm_helper.rb b/src/cli/one_helper/onevm_helper.rb index e540239f9f..41f1646da2 100644 --- a/src/cli/one_helper/onevm_helper.rb +++ b/src/cli/one_helper/onevm_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -215,9 +215,15 @@ class OneVMHelper < OpenNebulaHelper::OneHelper CLIHelper.print_header(str_h1 % "VIRTUAL MACHINE TEMPLATE",false) puts vm.template_str - if vm.has_elements?("/VM/HISTORY_RECORDS") + if vm.has_elements?("/VM/USER_TEMPLATE") puts + CLIHelper.print_header(str_h1 % "USER TEMPLATE",false) + puts vm.template_like_str('USER_TEMPLATE') + end + + if vm.has_elements?("/VM/HISTORY_RECORDS") + puts CLIHelper.print_header(str_h1 % "VIRTUAL MACHINE HISTORY",false) format_history(vm) diff --git a/src/cli/one_helper/onevnet_helper.rb b/src/cli/one_helper/onevnet_helper.rb index 90902d28cc..8b1ad69dfc 100644 --- a/src/cli/one_helper/onevnet_helper.rb +++ b/src/cli/one_helper/onevnet_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/oneacct b/src/cli/oneacct index 178a39db7e..a880c36357 100755 --- a/src/cli/oneacct +++ b/src/cli/oneacct @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -48,8 +48,8 @@ cmd = CommandParser::CmdParser.new(ARGV) do main do filter_flag = (options[:userfilter] || VirtualMachinePool::INFO_ALL) - start_time = options[:start] ? options[:start].to_i : -1 - end_time = options[:end] ? options[:end].to_i : -1 + start_time = options[:start_time] ? options[:start_time].to_i : -1 + end_time = options[:end_time] ? options[:end_time].to_i : -1 common_opts = { :start_time => start_time, diff --git a/src/cli/oneacl b/src/cli/oneacl index 9ad216f9a5..3e5994ebcf 100755 --- a/src/cli/oneacl +++ b/src/cli/oneacl @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/onecluster b/src/cli/onecluster index 0362d908bb..a389067566 100755 --- a/src/cli/onecluster +++ b/src/cli/onecluster @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/onedatastore b/src/cli/onedatastore index 9f58d16f6c..5e2b449ed2 100755 --- a/src/cli/onedatastore +++ b/src/cli/onedatastore @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/onegroup b/src/cli/onegroup index 660bb7cebb..26471938d2 100755 --- a/src/cli/onegroup +++ b/src/cli/onegroup @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/onehost b/src/cli/onehost index 364dfcaf61..896f0aad3f 100755 --- a/src/cli/onehost +++ b/src/cli/onehost @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/oneimage b/src/cli/oneimage index 4a78d3b33e..0c1dc39dfc 100755 --- a/src/cli/oneimage +++ b/src/cli/oneimage @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/onetemplate b/src/cli/onetemplate index b1cc925e06..6ca92950b2 100755 --- a/src/cli/onetemplate +++ b/src/cli/onetemplate @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cli/oneuser b/src/cli/oneuser index 357cfa4887..fdebb37639 100755 --- a/src/cli/oneuser +++ b/src/cli/oneuser @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -270,6 +270,39 @@ cmd=CommandParser::CmdParser.new(ARGV) do exit 0 end + umask_desc = <<-EOT.unindent + Changes the umask used to create the default permissions. In a similar + way to the Unix umask command, the expected value is a three-digit + base-8 number. Each digit is a mask that disables permissions for the + owner, group and other, respectively. + + If mask is not given, or if it is an empty string, the umask will + be unset + EOT + + command :umask, umask_desc, [:range, :userid_list], [:mask, nil] do + helper.perform_actions(args[0],options, + "umask changed") do |user| + + rc = user.info + + if OpenNebula.is_error?(rc) + puts rc.message + exit -1 + end + + user.delete_element('/USER/TEMPLATE/UMASK') + + tmp_str = user.template_str + + if !args[1].nil? && args[1] != "" + tmp_str << "\nUMASK = #{args[1]}" + end + + user.update(tmp_str) + end + end + login_desc = <<-EOT.unindent Creates the Login token for authentication Examples: diff --git a/src/cli/onevm b/src/cli/onevm index 04fd4a414f..913518457c 100755 --- a/src/cli/onevm +++ b/src/cli/onevm @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -174,6 +174,18 @@ cmd=CommandParser::CmdParser.new(ARGV) do exit_code end + update_desc = <<-EOT.unindent + Update the user template contents. If a path is not provided the + editor will be launched to modify the current content. + EOT + + command :update, update_desc, :vmid, [:file, nil] do + helper.perform_action(args[0],options,"modified") do |vm| + str = OpenNebulaHelper.update_template(args[0], vm, args[1],'USER_TEMPLATE') + vm.update(str) + end + end + delete_desc = <<-EOT.unindent Deletes the given VM diff --git a/src/cli/onevnet b/src/cli/onevnet index d931f3ce0b..2ada4c1e75 100755 --- a/src/cli/onevnet +++ b/src/cli/onevnet @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/common/CloudAuth.rb b/src/cloud/common/CloudAuth.rb index ddc1a4fa78..89bca96587 100644 --- a/src/cloud/common/CloudAuth.rb +++ b/src/cloud/common/CloudAuth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -67,7 +67,7 @@ class CloudAuth end begin - require core_auth[0] + require "opennebula/#{core_auth[0]}" @server_auth = Kernel.const_get(core_auth[1]).new_client rescue => e raise e.message @@ -158,4 +158,4 @@ class CloudAuth raise rc.message if OpenNebula.is_error?(rc) } end -end \ No newline at end of file +end diff --git a/src/cloud/common/CloudAuth/EC2CloudAuth.rb b/src/cloud/common/CloudAuth/EC2CloudAuth.rb index 8bae4cd704..8515602dc1 100644 --- a/src/cloud/common/CloudAuth/EC2CloudAuth.rb +++ b/src/cloud/common/CloudAuth/EC2CloudAuth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/common/CloudAuth/OCCICloudAuth.rb b/src/cloud/common/CloudAuth/OCCICloudAuth.rb index 8ad6fa07a6..015d96e6a6 100644 --- a/src/cloud/common/CloudAuth/OCCICloudAuth.rb +++ b/src/cloud/common/CloudAuth/OCCICloudAuth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/common/CloudAuth/OpenNebulaCloudAuth.rb b/src/cloud/common/CloudAuth/OpenNebulaCloudAuth.rb index 33cb080898..48b026c0b7 100644 --- a/src/cloud/common/CloudAuth/OpenNebulaCloudAuth.rb +++ b/src/cloud/common/CloudAuth/OpenNebulaCloudAuth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/common/CloudAuth/SunstoneCloudAuth.rb b/src/cloud/common/CloudAuth/SunstoneCloudAuth.rb index 1ac866ef6d..39f495afcf 100644 --- a/src/cloud/common/CloudAuth/SunstoneCloudAuth.rb +++ b/src/cloud/common/CloudAuth/SunstoneCloudAuth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/common/CloudAuth/X509CloudAuth.rb b/src/cloud/common/CloudAuth/X509CloudAuth.rb index c6174e2358..e2f51873eb 100644 --- a/src/cloud/common/CloudAuth/X509CloudAuth.rb +++ b/src/cloud/common/CloudAuth/X509CloudAuth.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/common/CloudClient.rb b/src/cloud/common/CloudClient.rb index 1b797468e2..c89cf669e1 100644 --- a/src/cloud/common/CloudClient.rb +++ b/src/cloud/common/CloudClient.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -201,7 +201,7 @@ module CloudCLI def version_text version=< file_list.txt diff --git a/src/cloud/occi/lib/ui/locale/languages/SConstruct b/src/cloud/occi/lib/ui/locale/languages/SConstruct index 22e9a8ad31..994062f922 100644 --- a/src/cloud/occi/lib/ui/locale/languages/SConstruct +++ b/src/cloud/occi/lib/ui/locale/languages/SConstruct @@ -1,7 +1,7 @@ # SConstruct for share/man # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/occi/lib/ui/locale/languages/cs_CZ.po b/src/cloud/occi/lib/ui/locale/languages/cs_CZ.po index 049cde29d7..d42ec5f063 100644 --- a/src/cloud/occi/lib/ui/locale/languages/cs_CZ.po +++ b/src/cloud/occi/lib/ui/locale/languages/cs_CZ.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/de.po b/src/cloud/occi/lib/ui/locale/languages/de.po index 3d1c5dba98..3d6a94815d 100644 --- a/src/cloud/occi/lib/ui/locale/languages/de.po +++ b/src/cloud/occi/lib/ui/locale/languages/de.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/el_GR.po b/src/cloud/occi/lib/ui/locale/languages/el_GR.po index 45f294db42..67b3a27a35 100644 --- a/src/cloud/occi/lib/ui/locale/languages/el_GR.po +++ b/src/cloud/occi/lib/ui/locale/languages/el_GR.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/en_US.po b/src/cloud/occi/lib/ui/locale/languages/en_US.po index 2aec480492..1c2607f7b4 100644 --- a/src/cloud/occi/lib/ui/locale/languages/en_US.po +++ b/src/cloud/occi/lib/ui/locale/languages/en_US.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # diff --git a/src/cloud/occi/lib/ui/locale/languages/es_ES.po b/src/cloud/occi/lib/ui/locale/languages/es_ES.po index b96b5df32d..90afc84c5a 100644 --- a/src/cloud/occi/lib/ui/locale/languages/es_ES.po +++ b/src/cloud/occi/lib/ui/locale/languages/es_ES.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/fa_IR.po b/src/cloud/occi/lib/ui/locale/languages/fa_IR.po index fabb9928d5..b17f830a3a 100644 --- a/src/cloud/occi/lib/ui/locale/languages/fa_IR.po +++ b/src/cloud/occi/lib/ui/locale/languages/fa_IR.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/fr_CA.po b/src/cloud/occi/lib/ui/locale/languages/fr_CA.po index 5278622d8f..d83fb001af 100644 --- a/src/cloud/occi/lib/ui/locale/languages/fr_CA.po +++ b/src/cloud/occi/lib/ui/locale/languages/fr_CA.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/fr_FR.po b/src/cloud/occi/lib/ui/locale/languages/fr_FR.po index f07f8e0286..0062b99079 100644 --- a/src/cloud/occi/lib/ui/locale/languages/fr_FR.po +++ b/src/cloud/occi/lib/ui/locale/languages/fr_FR.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/gl.po b/src/cloud/occi/lib/ui/locale/languages/gl.po index e849f93663..c5ec975f49 100644 --- a/src/cloud/occi/lib/ui/locale/languages/gl.po +++ b/src/cloud/occi/lib/ui/locale/languages/gl.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/it_IT.po b/src/cloud/occi/lib/ui/locale/languages/it_IT.po index ec0983beab..7c3ca4b83b 100644 --- a/src/cloud/occi/lib/ui/locale/languages/it_IT.po +++ b/src/cloud/occi/lib/ui/locale/languages/it_IT.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/nl_NL.po b/src/cloud/occi/lib/ui/locale/languages/nl_NL.po index b51d8bf6bb..1528b71b46 100644 --- a/src/cloud/occi/lib/ui/locale/languages/nl_NL.po +++ b/src/cloud/occi/lib/ui/locale/languages/nl_NL.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/pt_BR.po b/src/cloud/occi/lib/ui/locale/languages/pt_BR.po index 419f67fd79..98a7e9ea65 100644 --- a/src/cloud/occi/lib/ui/locale/languages/pt_BR.po +++ b/src/cloud/occi/lib/ui/locale/languages/pt_BR.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/pt_PT.po b/src/cloud/occi/lib/ui/locale/languages/pt_PT.po index 3af5192681..1207fba4f8 100644 --- a/src/cloud/occi/lib/ui/locale/languages/pt_PT.po +++ b/src/cloud/occi/lib/ui/locale/languages/pt_PT.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/ru_RU.po b/src/cloud/occi/lib/ui/locale/languages/ru_RU.po index 9fc313831b..7aca937bd4 100644 --- a/src/cloud/occi/lib/ui/locale/languages/ru_RU.po +++ b/src/cloud/occi/lib/ui/locale/languages/ru_RU.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/sk_SK.po b/src/cloud/occi/lib/ui/locale/languages/sk_SK.po index ce864fe9cd..9a3bf82f0f 100644 --- a/src/cloud/occi/lib/ui/locale/languages/sk_SK.po +++ b/src/cloud/occi/lib/ui/locale/languages/sk_SK.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/languages/zh_TW.po b/src/cloud/occi/lib/ui/locale/languages/zh_TW.po index 8f758dc14c..ec8d979efd 100644 --- a/src/cloud/occi/lib/ui/locale/languages/zh_TW.po +++ b/src/cloud/occi/lib/ui/locale/languages/zh_TW.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/cloud/occi/lib/ui/locale/messages.pot b/src/cloud/occi/lib/ui/locale/messages.pot index f5b4b87f72..b76bce7a50 100644 --- a/src/cloud/occi/lib/ui/locale/messages.pot +++ b/src/cloud/occi/lib/ui/locale/messages.pot @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # diff --git a/src/cloud/occi/lib/ui/locale/upgrade_po_translations.sh b/src/cloud/occi/lib/ui/locale/upgrade_po_translations.sh index 38c0b3a505..2d2a0dd4ea 100755 --- a/src/cloud/occi/lib/ui/locale/upgrade_po_translations.sh +++ b/src/cloud/occi/lib/ui/locale/upgrade_po_translations.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/occi/lib/ui/public/css/application.css b/src/cloud/occi/lib/ui/public/css/application.css index faad452b97..5918b0591f 100644 --- a/src/cloud/occi/lib/ui/public/css/application.css +++ b/src/cloud/occi/lib/ui/public/css/application.css @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/css/layout.css b/src/cloud/occi/lib/ui/public/css/layout.css index 6f113e7c6b..45d5022025 100644 --- a/src/cloud/occi/lib/ui/public/css/layout.css +++ b/src/cloud/occi/lib/ui/public/css/layout.css @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/css/login.css b/src/cloud/occi/lib/ui/public/css/login.css index 63d50e9a45..997590aa42 100644 --- a/src/cloud/occi/lib/ui/public/css/login.css +++ b/src/cloud/occi/lib/ui/public/css/login.css @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/customize/custom.js b/src/cloud/occi/lib/ui/public/customize/custom.js index c0d592ef65..edfc75f4b1 100644 --- a/src/cloud/occi/lib/ui/public/customize/custom.js +++ b/src/cloud/occi/lib/ui/public/customize/custom.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/js/layout.js b/src/cloud/occi/lib/ui/public/js/layout.js index 673ad5892d..1c72ef789b 100644 --- a/src/cloud/occi/lib/ui/public/js/layout.js +++ b/src/cloud/occi/lib/ui/public/js/layout.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/js/locale.js b/src/cloud/occi/lib/ui/public/js/locale.js index 792772954f..77eeca4cc9 100644 --- a/src/cloud/occi/lib/ui/public/js/locale.js +++ b/src/cloud/occi/lib/ui/public/js/locale.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/js/login.js b/src/cloud/occi/lib/ui/public/js/login.js index b7b80e5908..3cd77acb69 100644 --- a/src/cloud/occi/lib/ui/public/js/login.js +++ b/src/cloud/occi/lib/ui/public/js/login.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/js/occi.js b/src/cloud/occi/lib/ui/public/js/occi.js index 8c4780455d..2b4ef0a648 100644 --- a/src/cloud/occi/lib/ui/public/js/occi.js +++ b/src/cloud/occi/lib/ui/public/js/occi.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/js/plugins/compute.js b/src/cloud/occi/lib/ui/public/js/plugins/compute.js index 602e28264c..02e5ebb8c7 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/compute.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/compute.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/js/plugins/configuration.js b/src/cloud/occi/lib/ui/public/js/plugins/configuration.js index 01738a07cf..be4dcc64fe 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/configuration.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/configuration.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/js/plugins/dashboard.js b/src/cloud/occi/lib/ui/public/js/plugins/dashboard.js index ce7647d22c..ffe0e27323 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/dashboard.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/dashboard.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/js/plugins/network.js b/src/cloud/occi/lib/ui/public/js/plugins/network.js index 609151d206..bf37b4873e 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/network.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/network.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/lib/ui/public/js/plugins/storage.js b/src/cloud/occi/lib/ui/public/js/plugins/storage.js index c8d73f35aa..4110a3032a 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/storage.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/storage.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cloud/occi/test/spec/occi_spec.rb b/src/cloud/occi/test/spec/occi_spec.rb index ba35ae94dd..a68b0c1b37 100644 --- a/src/cloud/occi/test/spec/occi_spec.rb +++ b/src/cloud/occi/test/spec/occi_spec.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/occi/test/spec/spec_helper.rb b/src/cloud/occi/test/spec/spec_helper.rb index 0d7423a2fc..acb8be43bb 100644 --- a/src/cloud/occi/test/spec/spec_helper.rb +++ b/src/cloud/occi/test/spec/spec_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/occi/test/spec/user_spec.rb b/src/cloud/occi/test/spec/user_spec.rb index 805419e8f6..e2bc4c0b0a 100644 --- a/src/cloud/occi/test/spec/user_spec.rb +++ b/src/cloud/occi/test/spec/user_spec.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/occi/test/spec/vm_saveas_spec.rb b/src/cloud/occi/test/spec/vm_saveas_spec.rb index 21752739bc..337e8889be 100644 --- a/src/cloud/occi/test/spec/vm_saveas_spec.rb +++ b/src/cloud/occi/test/spec/vm_saveas_spec.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cloud/occi/test/test.sh b/src/cloud/occi/test/test.sh index 4b5a3d7e4f..96a44d0a7f 100755 --- a/src/cloud/occi/test/test.sh +++ b/src/cloud/occi/test/test.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/cluster/Cluster.cc b/src/cluster/Cluster.cc index 8c25673843..22a07c6dc4 100644 --- a/src/cluster/Cluster.cc +++ b/src/cluster/Cluster.cc @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -45,7 +45,8 @@ Cluster::Cluster( PoolObjectSQL(id,CLUSTER,name,-1,-1,"","",table), hosts("HOSTS"), datastores("DATASTORES"), - vnets("VNETS") + vnets("VNETS"), + system_ds(DatastorePool::SYSTEM_DS_ID) { if (cl_template != 0) { @@ -113,6 +114,69 @@ string& Cluster::get_ds_location(string &ds_location) return ds_location; } +/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------ */ + +int Cluster::add_datastore(int id, Datastore::DatastoreType ds_type, string& error_msg) +{ + if ( id == DatastorePool::SYSTEM_DS_ID ) + { + ostringstream oss; + oss << "Datastore "<< DatastorePool::SYSTEM_DS_ID + << " cannot be added to any cluster."; + + error_msg = oss.str(); + + return -1; + } + + if ( ds_type == Datastore::SYSTEM_DS ) + { + if ( system_ds != DatastorePool::SYSTEM_DS_ID ) + { + ostringstream oss; + oss << "Cluster " << oid << " already contains the System Datastore " + << system_ds << "."; + + error_msg = oss.str(); + + return -1; + } + } + + int rc = datastores.add_collection_id(id); + + if ( rc < 0 ) + { + error_msg = "Datastore ID is already in the cluster set."; + } + else if ( ds_type == Datastore::SYSTEM_DS ) + { + system_ds = id; + } + + return rc; +} + +/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------ */ + +int Cluster::del_datastore(int id, string& error_msg) +{ + int rc = datastores.del_collection_id(id); + + if ( rc < 0 ) + { + error_msg = "Datastore ID is not part of the cluster set."; + } + else if ( system_ds == id ) + { + system_ds = DatastorePool::SYSTEM_DS_ID; + } + + return rc; +} + /* ************************************************************************ */ /* Cluster :: Database Access Functions */ /* ************************************************************************ */ @@ -215,8 +279,9 @@ string& Cluster::to_xml(string& xml) const oss << "" << - "" << oid << "" << - "" << name << "" << + "" << oid << "" << + "" << name << "" << + "" << system_ds << "" << hosts.to_xml(host_collection_xml) << datastores.to_xml(ds_collection_xml) << @@ -241,8 +306,9 @@ int Cluster::from_xml(const string& xml) update_from_str(xml); // Get class base attributes - rc += xpath(oid, "/CLUSTER/ID", -1); - rc += xpath(name,"/CLUSTER/NAME", "not_found"); + rc += xpath(oid, "/CLUSTER/ID", -1); + rc += xpath(name, "/CLUSTER/NAME", "not_found"); + rc += xpath(system_ds, "/CLUSTER/SYSTEM_DS", -1); // Set oneadmin as the owner set_user(0,""); diff --git a/src/cluster/ClusterPool.cc b/src/cluster/ClusterPool.cc index b3ff69e26c..ee3af88eb6 100644 --- a/src/cluster/ClusterPool.cc +++ b/src/cluster/ClusterPool.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/cluster/SConstruct b/src/cluster/SConstruct index c088beebc3..840eb593ff 100644 --- a/src/cluster/SConstruct +++ b/src/cluster/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/group # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/common/ActionManager.cc b/src/common/ActionManager.cc index dd1504effc..8b69282f1d 100644 --- a/src/common/ActionManager.cc +++ b/src/common/ActionManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/common/Attribute.cc b/src/common/Attribute.cc index 2c90fa90c8..9b374f3962 100644 --- a/src/common/Attribute.cc +++ b/src/common/Attribute.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -20,6 +20,7 @@ #include "Attribute.h" +#define TO_UPPER(S) transform(S.begin(),S.end(),S.begin(),(int(*)(int))toupper) const char * VectorAttribute::magic_sep = "@^_^@"; const int VectorAttribute::magic_sep_size = 5; @@ -145,7 +146,7 @@ void VectorAttribute::unmarshall(const string& sattr, const char * _sep) { continue; } - + if ( mpos + 1 == tmp.size() ) { attribute_value.insert(make_pair(tmp.substr(0,mpos),"")); @@ -154,7 +155,7 @@ void VectorAttribute::unmarshall(const string& sattr, const char * _sep) { attribute_value.insert(make_pair(tmp.substr(0,mpos), tmp.substr(mpos+1))); - } + } } } /* -------------------------------------------------------------------------- */ @@ -173,12 +174,12 @@ void VectorAttribute::replace(const string& name, const string& value) map::iterator it; it = attribute_value.find(name); - + if ( it != attribute_value.end() ) { attribute_value.erase(it); } - + attribute_value.insert(make_pair(name,value)); } @@ -215,6 +216,37 @@ string VectorAttribute::vector_value(const char *name) const return it->second; } } +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +int VectorAttribute::vector_value(const char *name, bool& value) const +{ + map::const_iterator it; + + value = false; + it = attribute_value.find(name); + + if (it == attribute_value.end()) + { + return -1; + } + + if (it->second.empty()) + { + return -1; + } + + string tmp = it->second; + + TO_UPPER(tmp); + + if (tmp == "YES") + { + value = true; + } + + return 0; +} /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ diff --git a/src/common/SConstruct b/src/common/SConstruct index e4dc088b57..3b24d2edac 100644 --- a/src/common/SConstruct +++ b/src/common/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/common # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/common/SSLTools.cc b/src/common/SSLTools.cc index 14e4926c51..469f26127b 100644 --- a/src/common/SSLTools.cc +++ b/src/common/SSLTools.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/common/mem_collector.c b/src/common/mem_collector.c index d351359365..e96263f3fa 100644 --- a/src/common/mem_collector.c +++ b/src/common/mem_collector.c @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/common/test/SConstruct b/src/common/test/SConstruct index d1775b677d..76bb4f4ce5 100644 --- a/src/common/test/SConstruct +++ b/src/common/test/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/common/test/action_manager.cc b/src/common/test/action_manager.cc index f8629b8c99..9ba00fdd21 100644 --- a/src/common/test/action_manager.cc +++ b/src/common/test/action_manager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/common/test/mem_collector.cc b/src/common/test/mem_collector.cc index 402d94c789..b9d251a308 100644 --- a/src/common/test/mem_collector.cc +++ b/src/common/test/mem_collector.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/common/test/single_attribute.cc b/src/common/test/single_attribute.cc index 3fbdcc0038..4787cbd083 100644 --- a/src/common/test/single_attribute.cc +++ b/src/common/test/single_attribute.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/common/test/vector_attribute.cc b/src/common/test/vector_attribute.cc index 0b52afa843..c10c3f0115 100644 --- a/src/common/test/vector_attribute.cc +++ b/src/common/test/vector_attribute.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/datastore/Datastore.cc b/src/datastore/Datastore.cc index 6e93122920..261766788a 100644 --- a/src/datastore/Datastore.cc +++ b/src/datastore/Datastore.cc @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -24,13 +24,13 @@ const char * Datastore::table = "datastore_pool"; const char * Datastore::db_names = - "oid, name, body, uid, gid, owner_u, group_u, other_u"; + "oid, name, body, uid, gid, owner_u, group_u, other_u, cid"; const char * Datastore::db_bootstrap = "CREATE TABLE IF NOT EXISTS datastore_pool (" "oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, " "gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, " - "UNIQUE(name))"; + "cid INTEGER, UNIQUE(name))"; /* ************************************************************************ */ /* Datastore :: Constructor/Destructor */ @@ -41,6 +41,7 @@ Datastore::Datastore( int gid, const string& uname, const string& gname, + int umask, DatastoreTemplate* ds_template, int cluster_id, const string& cluster_name): @@ -52,8 +53,6 @@ Datastore::Datastore( base_path(""), type(IMAGE_DS) { - group_u = 1; - if (ds_template != 0) { obj_template = ds_template; @@ -62,6 +61,10 @@ Datastore::Datastore( { obj_template = new DatastoreTemplate; } + + set_umask(umask); + + group_u = 1; } /* ------------------------------------------------------------------------ */ @@ -265,7 +268,8 @@ int Datastore::insert_replace(SqlDB *db, bool replace, string& error_str) << gid << "," << owner_u << "," << group_u << "," - << other_u << ")"; + << other_u << "," + << cluster_id << ")"; rc = db->exec(oss); @@ -411,18 +415,67 @@ int Datastore::replace_template(const string& tmpl_str, string& error_str) string new_tm_mad; string s_ds_type; - int rc; + DatastoreType new_ds_type; + Template * new_tmpl = new DatastoreTemplate; - rc = PoolObjectSQL::replace_template(tmpl_str, error_str); - - if ( rc != 0 ) + if ( new_tmpl == 0 ) { - return rc; + error_str = "Cannot allocate a new template"; + return -1; } - get_template_attribute("DS_MAD", new_ds_mad); - get_template_attribute("TYPE", s_ds_type); + if ( new_tmpl->parse_str_or_xml(tmpl_str, error_str) != 0 ) + { + delete new_tmpl; + return -1; + } + /* ---------------------------------------------------------------------- */ + /* Set the TYPE of the Datastore (class & template) */ + /* ---------------------------------------------------------------------- */ + + new_tmpl->get("TYPE", s_ds_type); + + if (!s_ds_type.empty()) + { + new_ds_type = str_to_type(s_ds_type); + + if (get_cluster_id() != ClusterPool::NONE_CLUSTER_ID)//It's in a cluster + { + if (type == SYSTEM_DS && new_ds_type != SYSTEM_DS) + { + error_str = "Datastore is associated to a cluster, and it is " + "the SYSTEM_DS, remove it from cluster first to " + "update its type."; + + delete new_tmpl; + return -1; + } + else if (new_ds_type == SYSTEM_DS && type != SYSTEM_DS) + { + error_str = "Datastore is associated to a cluster, cannot set " + "type to SYSTEM_DS. Remove it from cluster first " + "to update its type."; + + delete new_tmpl; + return -1; + } + } + } + else //No TYPE in the new Datastore template + { + new_ds_type = type; + } + + /* --- Update the Datastore template --- */ + + delete obj_template; + + obj_template = new_tmpl; + + /* ---------------------------------------------------------------------- */ + /* Set the TYPE of the Datastore (class & template) */ + /* ---------------------------------------------------------------------- */ if ( oid == DatastorePool::SYSTEM_DS_ID ) { @@ -430,15 +483,23 @@ int Datastore::replace_template(const string& tmpl_str, string& error_str) } else { - type = str_to_type(s_ds_type); - - replace_template_attribute("TYPE", type_to_str(type)); + type = new_ds_type; } + replace_template_attribute("TYPE", type_to_str(type)); + + /* ---------------------------------------------------------------------- */ + /* Set the DS_MAD of the Datastore (class & template) */ + /* ---------------------------------------------------------------------- */ + if ( type == SYSTEM_DS ) { new_ds_mad = "-"; } + else + { + get_template_attribute("DS_MAD", new_ds_mad); + } if ( !new_ds_mad.empty() ) { @@ -447,6 +508,10 @@ int Datastore::replace_template(const string& tmpl_str, string& error_str) replace_template_attribute("DS_MAD", ds_mad); + /* ---------------------------------------------------------------------- */ + /* Set the TM_MAD of the Datastore (class & template) */ + /* ---------------------------------------------------------------------- */ + get_template_attribute("TM_MAD", new_tm_mad); if ( !new_tm_mad.empty() ) diff --git a/src/datastore/DatastorePool.cc b/src/datastore/DatastorePool.cc index 676e894357..deee907538 100644 --- a/src/datastore/DatastorePool.cc +++ b/src/datastore/DatastorePool.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -47,7 +47,6 @@ DatastorePool::DatastorePool(SqlDB * db): if (get_lastOID() == -1) //lastOID is set in PoolSQL::init_cb { DatastoreTemplate * ds_tmpl; - Datastore * ds; int rc; @@ -71,6 +70,7 @@ DatastorePool::DatastorePool(SqlDB * db): GroupPool::ONEADMIN_ID, UserPool::oneadmin_name, GroupPool::ONEADMIN_NAME, + 0137, ds_tmpl, &rc, ClusterPool::NONE_CLUSTER_ID, @@ -104,6 +104,7 @@ DatastorePool::DatastorePool(SqlDB * db): GroupPool::ONEADMIN_ID, UserPool::oneadmin_name, GroupPool::ONEADMIN_NAME, + 0133, ds_tmpl, &rc, ClusterPool::NONE_CLUSTER_ID, @@ -115,18 +116,6 @@ DatastorePool::DatastorePool(SqlDB * db): goto error_bootstrap; } - ds = get(rc, true); - - ds->set_permissions( - -1,-1,-1, - -1,-1,-1, - 1,-1,-1, - error_str); - - update(ds); - - ds->unlock(); - // --------------------------------------------------------------------- // Create the default file datastore // --------------------------------------------------------------------- @@ -149,6 +138,7 @@ DatastorePool::DatastorePool(SqlDB * db): GroupPool::ONEADMIN_ID, UserPool::oneadmin_name, GroupPool::ONEADMIN_NAME, + 0133, ds_tmpl, &rc, ClusterPool::NONE_CLUSTER_ID, @@ -160,18 +150,6 @@ DatastorePool::DatastorePool(SqlDB * db): goto error_bootstrap; } - ds = get(rc, true); - - ds->set_permissions( - -1,-1,-1, - -1,-1,-1, - 1,-1,-1, - error_str); - - update(ds); - - ds->unlock(); - // User created datastores will start from ID 100 set_update_lastOID(99); } @@ -194,6 +172,7 @@ int DatastorePool::allocate( int gid, const string& uname, const string& gname, + int umask, DatastoreTemplate * ds_template, int * oid, int cluster_id, @@ -205,7 +184,7 @@ int DatastorePool::allocate( string name; ostringstream oss; - ds = new Datastore(uid, gid, uname, gname, + ds = new Datastore(uid, gid, uname, gname, umask, ds_template, cluster_id, cluster_name); // ------------------------------------------------------------------------- diff --git a/src/datastore/SConstruct b/src/datastore/SConstruct index 36514ca0b9..6dd5e51b1b 100644 --- a/src/datastore/SConstruct +++ b/src/datastore/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/datastore # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/one_datastore b/src/datastore_mad/one_datastore index ba5653805b..60214272a6 100755 --- a/src/datastore_mad/one_datastore +++ b/src/datastore_mad/one_datastore @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/one_datastore.rb b/src/datastore_mad/one_datastore.rb index 641b7aac7b..626572ea4c 100755 --- a/src/datastore_mad/one_datastore.rb +++ b/src/datastore_mad/one_datastore.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- */ -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 */ diff --git a/src/datastore_mad/remotes/common/clone b/src/datastore_mad/remotes/common/clone index d7c7603f18..d49d2e23b0 100755 --- a/src/datastore_mad/remotes/common/clone +++ b/src/datastore_mad/remotes/common/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/common/stat b/src/datastore_mad/remotes/common/stat index 855ecae00b..38a660e8f7 100755 --- a/src/datastore_mad/remotes/common/stat +++ b/src/datastore_mad/remotes/common/stat @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/downloader.sh b/src/datastore_mad/remotes/downloader.sh index bca92689b4..1c876b275f 100755 --- a/src/datastore_mad/remotes/downloader.sh +++ b/src/datastore_mad/remotes/downloader.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/dummy/clone b/src/datastore_mad/remotes/dummy/clone index 9cf7239279..68be032375 100755 --- a/src/datastore_mad/remotes/dummy/clone +++ b/src/datastore_mad/remotes/dummy/clone @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/dummy/cp b/src/datastore_mad/remotes/dummy/cp index 9cf7239279..68be032375 100755 --- a/src/datastore_mad/remotes/dummy/cp +++ b/src/datastore_mad/remotes/dummy/cp @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/dummy/mkfs b/src/datastore_mad/remotes/dummy/mkfs index 9cf7239279..68be032375 100755 --- a/src/datastore_mad/remotes/dummy/mkfs +++ b/src/datastore_mad/remotes/dummy/mkfs @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/dummy/rm b/src/datastore_mad/remotes/dummy/rm index 6c1cd9257d..e9e0ad4f34 100755 --- a/src/datastore_mad/remotes/dummy/rm +++ b/src/datastore_mad/remotes/dummy/rm @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/dummy/stat b/src/datastore_mad/remotes/dummy/stat index 390fb72944..883f11a0f4 100755 --- a/src/datastore_mad/remotes/dummy/stat +++ b/src/datastore_mad/remotes/dummy/stat @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/fs/cp b/src/datastore_mad/remotes/fs/cp index 61a2f6bf5e..e5d8dd73cb 100755 --- a/src/datastore_mad/remotes/fs/cp +++ b/src/datastore_mad/remotes/fs/cp @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/fs/mkfs b/src/datastore_mad/remotes/fs/mkfs index d1340e3445..568f32f04d 100755 --- a/src/datastore_mad/remotes/fs/mkfs +++ b/src/datastore_mad/remotes/fs/mkfs @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/fs/rm b/src/datastore_mad/remotes/fs/rm index 4bedba1d15..62058a5c53 100755 --- a/src/datastore_mad/remotes/fs/rm +++ b/src/datastore_mad/remotes/fs/rm @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/iscsi/clone b/src/datastore_mad/remotes/iscsi/clone index e0055a085b..792491e09e 100755 --- a/src/datastore_mad/remotes/iscsi/clone +++ b/src/datastore_mad/remotes/iscsi/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/iscsi/cp b/src/datastore_mad/remotes/iscsi/cp index c9a73b5bd3..dd8e69d518 100755 --- a/src/datastore_mad/remotes/iscsi/cp +++ b/src/datastore_mad/remotes/iscsi/cp @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/iscsi/iscsi.conf b/src/datastore_mad/remotes/iscsi/iscsi.conf index c4e7ec18e3..2b56cde7e1 100644 --- a/src/datastore_mad/remotes/iscsi/iscsi.conf +++ b/src/datastore_mad/remotes/iscsi/iscsi.conf @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/iscsi/mkfs b/src/datastore_mad/remotes/iscsi/mkfs index e2f5e6fdd3..ea5e220d37 100755 --- a/src/datastore_mad/remotes/iscsi/mkfs +++ b/src/datastore_mad/remotes/iscsi/mkfs @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/iscsi/rm b/src/datastore_mad/remotes/iscsi/rm index e1f898d9eb..9268c9eb38 100755 --- a/src/datastore_mad/remotes/iscsi/rm +++ b/src/datastore_mad/remotes/iscsi/rm @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/libfs.sh b/src/datastore_mad/remotes/libfs.sh index 280e3a94c4..9d9a2d8847 100644 --- a/src/datastore_mad/remotes/libfs.sh +++ b/src/datastore_mad/remotes/libfs.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/lvm/clone b/src/datastore_mad/remotes/lvm/clone index 8af3b3bbdf..e04c9b703f 100755 --- a/src/datastore_mad/remotes/lvm/clone +++ b/src/datastore_mad/remotes/lvm/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/lvm/cp b/src/datastore_mad/remotes/lvm/cp index 28d2a533e7..74ea475255 100755 --- a/src/datastore_mad/remotes/lvm/cp +++ b/src/datastore_mad/remotes/lvm/cp @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/lvm/lvm.conf b/src/datastore_mad/remotes/lvm/lvm.conf index 534ae1db85..c063085ade 100644 --- a/src/datastore_mad/remotes/lvm/lvm.conf +++ b/src/datastore_mad/remotes/lvm/lvm.conf @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/lvm/mkfs b/src/datastore_mad/remotes/lvm/mkfs index 5eb699d9ce..adea971511 100755 --- a/src/datastore_mad/remotes/lvm/mkfs +++ b/src/datastore_mad/remotes/lvm/mkfs @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/lvm/rm b/src/datastore_mad/remotes/lvm/rm index 5b01159919..ba629cd015 100755 --- a/src/datastore_mad/remotes/lvm/rm +++ b/src/datastore_mad/remotes/lvm/rm @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/vmfs/clone b/src/datastore_mad/remotes/vmfs/clone index 39c259fa13..fbe6f190c3 100755 --- a/src/datastore_mad/remotes/vmfs/clone +++ b/src/datastore_mad/remotes/vmfs/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/vmfs/cp b/src/datastore_mad/remotes/vmfs/cp index 90a8a254be..3d9895c51c 100755 --- a/src/datastore_mad/remotes/vmfs/cp +++ b/src/datastore_mad/remotes/vmfs/cp @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/vmfs/mkfs b/src/datastore_mad/remotes/vmfs/mkfs index a76c503239..cf70ddcee9 100755 --- a/src/datastore_mad/remotes/vmfs/mkfs +++ b/src/datastore_mad/remotes/vmfs/mkfs @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/vmfs/rm b/src/datastore_mad/remotes/vmfs/rm index a5a6b1eed2..29738acfaf 100755 --- a/src/datastore_mad/remotes/vmfs/rm +++ b/src/datastore_mad/remotes/vmfs/rm @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/vmfs/vmfs.conf b/src/datastore_mad/remotes/vmfs/vmfs.conf index 34add2dd41..92211d06db 100644 --- a/src/datastore_mad/remotes/vmfs/vmfs.conf +++ b/src/datastore_mad/remotes/vmfs/vmfs.conf @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/vmware/cp b/src/datastore_mad/remotes/vmware/cp index 7f22712a75..5964296c5e 100755 --- a/src/datastore_mad/remotes/vmware/cp +++ b/src/datastore_mad/remotes/vmware/cp @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -102,7 +102,7 @@ http://*|https://* ) ;; esac -if [ ! -f $DST/disk.vmdk ]; then +if [ -d "$DST" -a ! -f "$DST/disk.vmdk" ]; then BASE_DISK_FILE=`ls $DST | grep -v '\-\(flat\|delta\|s[0-9]*\)\.vmdk$'` diff --git a/src/datastore_mad/remotes/vmware/mkfs b/src/datastore_mad/remotes/vmware/mkfs index 13cd67afdf..9b31586d49 100755 --- a/src/datastore_mad/remotes/vmware/mkfs +++ b/src/datastore_mad/remotes/vmware/mkfs @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/vmware/rm b/src/datastore_mad/remotes/vmware/rm index bb3ac1601f..8126d04480 100755 --- a/src/datastore_mad/remotes/vmware/rm +++ b/src/datastore_mad/remotes/vmware/rm @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/datastore_mad/remotes/xpath.rb b/src/datastore_mad/remotes/xpath.rb index d17f6f8a5d..ac91f5d52f 100755 --- a/src/datastore_mad/remotes/xpath.rb +++ b/src/datastore_mad/remotes/xpath.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- */ -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 */ diff --git a/src/dm/DispatchManager.cc b/src/dm/DispatchManager.cc index efdb55d3a2..cc2fef385d 100644 --- a/src/dm/DispatchManager.cc +++ b/src/dm/DispatchManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/dm/DispatchManagerActions.cc b/src/dm/DispatchManagerActions.cc index c5f642d280..eb3ad8e235 100644 --- a/src/dm/DispatchManagerActions.cc +++ b/src/dm/DispatchManagerActions.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -868,7 +868,7 @@ int DispatchManager::resubmit(int vid) case VirtualMachine::FAILED: //Cleanup VM host files vm->log("DiM", Log::INFO, "New VM state is CLEANUP."); - vm->set_state(VirtualMachine::CLEANUP); + vm->set_state(VirtualMachine::CLEANUP_RESUBMIT); vm->set_state(VirtualMachine::ACTIVE); vmpool->update(vm); diff --git a/src/dm/DispatchManagerStates.cc b/src/dm/DispatchManagerStates.cc index 98053f2565..f363f50af6 100644 --- a/src/dm/DispatchManagerStates.cc +++ b/src/dm/DispatchManagerStates.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -161,7 +161,7 @@ void DispatchManager::done_action(int vid) if ((dm_state == VirtualMachine::ACTIVE) && (lcm_state == VirtualMachine::EPILOG || lcm_state == VirtualMachine::CANCEL || - lcm_state == VirtualMachine::CLEANUP )) + lcm_state == VirtualMachine::CLEANUP_DELETE)) { vm->set_state(VirtualMachine::DONE); @@ -180,11 +180,11 @@ void DispatchManager::done_action(int vid) uid = vm->get_uid(); gid = vm->get_gid(); tmpl = vm->clone_template(); - + vm->unlock(); Quotas::vm_del(uid, gid, tmpl); - + delete tmpl; } else @@ -196,7 +196,7 @@ void DispatchManager::done_action(int vid) vm->unlock(); } - + return; } @@ -247,7 +247,7 @@ void DispatchManager::resubmit_action(int vid) return; } - if (vm->get_lcm_state() == VirtualMachine::CLEANUP) + if (vm->get_lcm_state() == VirtualMachine::CLEANUP_RESUBMIT) { vm->set_state(VirtualMachine::LCM_INIT); diff --git a/src/dm/SConstruct b/src/dm/SConstruct index 5e42c448f9..50b4341793 100644 --- a/src/dm/SConstruct +++ b/src/dm/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/vm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/document/Document.cc b/src/document/Document.cc index ea6e630007..b6481e9010 100644 --- a/src/document/Document.cc +++ b/src/document/Document.cc @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -25,6 +25,7 @@ Document::Document( int id, int _gid, const string& _uname, const string& _gname, + int _umask, int _type, Template * _template_contents): PoolObjectSQL(id,DOCUMENT,"",_uid,_gid,_uname,_gname,table), type(_type) @@ -37,6 +38,8 @@ Document::Document( int id, { obj_template = new Template; } + + set_umask(_umask); } /* ------------------------------------------------------------------------ */ diff --git a/src/document/SConstruct b/src/document/SConstruct index f11904d074..11c8128522 100644 --- a/src/document/SConstruct +++ b/src/document/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/document # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/group/Group.cc b/src/group/Group.cc index 02588502b2..2f4910a099 100644 --- a/src/group/Group.cc +++ b/src/group/Group.cc @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/group/GroupPool.cc b/src/group/GroupPool.cc index b7138c54b5..9d89354544 100644 --- a/src/group/GroupPool.cc +++ b/src/group/GroupPool.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/group/SConstruct b/src/group/SConstruct index 72dabada4f..0b31ef62a2 100644 --- a/src/group/SConstruct +++ b/src/group/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/group # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/group/test/GroupPoolTest.cc b/src/group/test/GroupPoolTest.cc index 01d663fdbd..60f4238ab6 100644 --- a/src/group/test/GroupPoolTest.cc +++ b/src/group/test/GroupPoolTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/group/test/SConstruct b/src/group/test/SConstruct index 2439c9babc..09b3d5dac8 100644 --- a/src/group/test/SConstruct +++ b/src/group/test/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 diff --git a/src/hm/Hook.cc b/src/hm/Hook.cc index b21a24b323..0ca992003f 100644 --- a/src/hm/Hook.cc +++ b/src/hm/Hook.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/hm/HookManager.cc b/src/hm/HookManager.cc index f49a21ea92..6c2310d515 100644 --- a/src/hm/HookManager.cc +++ b/src/hm/HookManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/hm/HookManagerDriver.cc b/src/hm/HookManagerDriver.cc index 83a8e62e24..9f49ba55ea 100644 --- a/src/hm/HookManagerDriver.cc +++ b/src/hm/HookManagerDriver.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/hm/SConstruct b/src/hm/SConstruct index b5d62c88f2..f3dd3688bf 100755 --- a/src/hm/SConstruct +++ b/src/hm/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/hm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/hm_mad/hmrc b/src/hm_mad/hmrc index 1e12168116..90c559ab5d 100644 --- a/src/hm_mad/hmrc +++ b/src/hm_mad/hmrc @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/hm_mad/one_hm b/src/hm_mad/one_hm index eff8f2e295..27cfe92f5e 100755 --- a/src/hm_mad/one_hm +++ b/src/hm_mad/one_hm @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/hm_mad/one_hm.rb b/src/hm_mad/one_hm.rb index 1c0df8a728..6c055f0cb8 100755 --- a/src/hm_mad/one_hm.rb +++ b/src/hm_mad/one_hm.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/hm_mad/test/dummy b/src/hm_mad/test/dummy index e5232114ca..ae2453d9d7 100755 --- a/src/hm_mad/test/dummy +++ b/src/hm_mad/test/dummy @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/host/Host.cc b/src/host/Host.cc index f6c9fe7743..e8fd0c4684 100644 --- a/src/host/Host.cc +++ b/src/host/Host.cc @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -62,12 +62,12 @@ Host::~Host() const char * Host::table = "host_pool"; const char * Host::db_names = - "oid, name, body, state, last_mon_time, uid, gid, owner_u, group_u, other_u"; + "oid, name, body, state, last_mon_time, uid, gid, owner_u, group_u, other_u, cid"; const char * Host::db_bootstrap = "CREATE TABLE IF NOT EXISTS host_pool (" "oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, state INTEGER, " "last_mon_time INTEGER, uid INTEGER, gid INTEGER, owner_u INTEGER, " - "group_u INTEGER, other_u INTEGER, UNIQUE(name))"; + "group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name))"; const char * Host::monit_table = "host_monitoring"; @@ -136,7 +136,8 @@ int Host::insert_replace(SqlDB *db, bool replace, string& error_str) << gid << "," << owner_u << "," << group_u << "," - << other_u << ")"; + << other_u << "," + << cluster_id << ")"; rc = db->exec(oss); diff --git a/src/host/HostHook.cc b/src/host/HostHook.cc index 2cdbeffc54..134116930d 100644 --- a/src/host/HostHook.cc +++ b/src/host/HostHook.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/host/HostPool.cc b/src/host/HostPool.cc index 2bf113f4a0..762550e6d6 100644 --- a/src/host/HostPool.cc +++ b/src/host/HostPool.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -57,7 +57,6 @@ HostPool::HostPool(SqlDB* db, string on; string cmd; string arg; - string rmt; bool remote; bool state_hook = false; @@ -70,7 +69,7 @@ HostPool::HostPool(SqlDB* db, on = vattr->vector_value("ON"); cmd = vattr->vector_value("COMMAND"); arg = vattr->vector_value("ARGUMENTS"); - rmt = vattr->vector_value("REMOTE"); + vattr->vector_value("REMOTE", remote); transform (on.begin(),on.end(),on.begin(),(int(*)(int))toupper); @@ -90,33 +89,21 @@ HostPool::HostPool(SqlDB* db, name = cmd; } - remote = false; - - if ( !rmt.empty() ) - { - transform(rmt.begin(),rmt.end(),rmt.begin(),(int(*)(int))toupper); - - if ( rmt == "YES" ) - { - remote = true; - } - } - if (cmd[0] != '/') { ostringstream cmd_os; if ( remote ) { - cmd_os << hook_location << "/" << cmd; + cmd_os << hook_location << "/" << cmd; } else { cmd_os << remotes_location << "/hooks/" << cmd; - } + } cmd = cmd_os.str(); - } + } if ( on == "CREATE" ) { diff --git a/src/host/HostShare.cc b/src/host/HostShare.cc index 81a1864ad1..7e9832b4d0 100644 --- a/src/host/HostShare.cc +++ b/src/host/HostShare.cc @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------*/ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/host/SConstruct b/src/host/SConstruct index 3c0b857325..9c39f598cc 100644 --- a/src/host/SConstruct +++ b/src/host/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/vm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/host/test/HostHookTest.cc b/src/host/test/HostHookTest.cc index f3d8932073..1564b591e6 100644 --- a/src/host/test/HostHookTest.cc +++ b/src/host/test/HostHookTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/host/test/HostPoolTest.cc b/src/host/test/HostPoolTest.cc index 2bb8623c73..64c9fef251 100644 --- a/src/host/test/HostPoolTest.cc +++ b/src/host/test/HostPoolTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/host/test/NebulaTestHost.h b/src/host/test/NebulaTestHost.h index fa9c5c839e..df3a4cd3c4 100644 --- a/src/host/test/NebulaTestHost.h +++ b/src/host/test/NebulaTestHost.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/host/test/SConstruct b/src/host/test/SConstruct index c1359e3518..0d92a1dbf8 100644 --- a/src/host/test/SConstruct +++ b/src/host/test/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/host/test # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im/InformationManager.cc b/src/im/InformationManager.cc index 0b2ecc2aea..b3fb10f42b 100644 --- a/src/im/InformationManager.cc +++ b/src/im/InformationManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/im/InformationManagerDriver.cc b/src/im/InformationManagerDriver.cc index 990638f0f3..56489a48f2 100644 --- a/src/im/InformationManagerDriver.cc +++ b/src/im/InformationManagerDriver.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/im/SConstruct b/src/im/SConstruct index 19045828e7..217720e533 100755 --- a/src/im/SConstruct +++ b/src/im/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/im # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/dummy/one_im_dummy b/src/im_mad/dummy/one_im_dummy index 4f33b23cbe..a79e7e851e 100755 --- a/src/im_mad/dummy/one_im_dummy +++ b/src/im_mad/dummy/one_im_dummy @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/dummy/one_im_dummy.rb b/src/im_mad/dummy/one_im_dummy.rb index 6e34cabb58..da3bb2150b 100755 --- a/src/im_mad/dummy/one_im_dummy.rb +++ b/src/im_mad/dummy/one_im_dummy.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/ec2/im_ec2rc b/src/im_mad/ec2/im_ec2rc index 1e12168116..90c559ab5d 100644 --- a/src/im_mad/ec2/im_ec2rc +++ b/src/im_mad/ec2/im_ec2rc @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/ec2/one_im_ec2 b/src/im_mad/ec2/one_im_ec2 index c42810c643..7f8b1345f9 100755 --- a/src/im_mad/ec2/one_im_ec2 +++ b/src/im_mad/ec2/one_im_ec2 @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/ec2/one_im_ec2.rb b/src/im_mad/ec2/one_im_ec2.rb index b0a0f01836..6a978f8dae 100755 --- a/src/im_mad/ec2/one_im_ec2.rb +++ b/src/im_mad/ec2/one_im_ec2.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/im_exec/one_im_exec b/src/im_mad/im_exec/one_im_exec index 9e73f5990e..d54602a47c 100755 --- a/src/im_mad/im_exec/one_im_exec +++ b/src/im_mad/im_exec/one_im_exec @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/im_exec/one_im_exec.rb b/src/im_mad/im_exec/one_im_exec.rb index a6c98e3fa7..cb8c496296 100755 --- a/src/im_mad/im_exec/one_im_exec.rb +++ b/src/im_mad/im_exec/one_im_exec.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/im_exec/one_im_sh b/src/im_mad/im_exec/one_im_sh index 8ff231bca3..4f4b991866 100755 --- a/src/im_mad/im_exec/one_im_sh +++ b/src/im_mad/im_exec/one_im_sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/im_exec/one_im_ssh b/src/im_mad/im_exec/one_im_ssh index 2a7fe3f17d..1d0698d008 100755 --- a/src/im_mad/im_exec/one_im_ssh +++ b/src/im_mad/im_exec/one_im_ssh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/remotes/kvm.d/architecture.sh b/src/im_mad/remotes/kvm.d/architecture.sh index 146fefa486..b203be16c3 100755 --- a/src/im_mad/remotes/kvm.d/architecture.sh +++ b/src/im_mad/remotes/kvm.d/architecture.sh @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/remotes/kvm.d/cpu.sh b/src/im_mad/remotes/kvm.d/cpu.sh index 5a635ae24a..b0a4a76555 100755 --- a/src/im_mad/remotes/kvm.d/cpu.sh +++ b/src/im_mad/remotes/kvm.d/cpu.sh @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/remotes/kvm.d/kvm.rb b/src/im_mad/remotes/kvm.d/kvm.rb index b8ca924aca..70d75b1c7d 100755 --- a/src/im_mad/remotes/kvm.d/kvm.rb +++ b/src/im_mad/remotes/kvm.d/kvm.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/remotes/kvm.d/name.sh b/src/im_mad/remotes/kvm.d/name.sh index c58156197a..ea9f65692d 100755 --- a/src/im_mad/remotes/kvm.d/name.sh +++ b/src/im_mad/remotes/kvm.d/name.sh @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/remotes/run_probes b/src/im_mad/remotes/run_probes index 7afe8c7b48..0f55fa1998 100755 --- a/src/im_mad/remotes/run_probes +++ b/src/im_mad/remotes/run_probes @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/remotes/vmware.d/vmware.rb b/src/im_mad/remotes/vmware.d/vmware.rb index cd02f42fbe..28a5547752 100755 --- a/src/im_mad/remotes/vmware.d/vmware.rb +++ b/src/im_mad/remotes/vmware.d/vmware.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # ---------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L # +# Copyright 2010-2013, C12G Labs S.L # # # # 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 # @@ -41,7 +41,7 @@ ENV['LANG'] = 'C' require "scripts_common" require 'yaml' require "CommandManager" -require 'OpenNebula' +require 'opennebula' include OpenNebula begin diff --git a/src/im_mad/remotes/xen.d/architecture.sh b/src/im_mad/remotes/xen.d/architecture.sh index 146fefa486..b203be16c3 100755 --- a/src/im_mad/remotes/xen.d/architecture.sh +++ b/src/im_mad/remotes/xen.d/architecture.sh @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/remotes/xen.d/cpu.sh b/src/im_mad/remotes/xen.d/cpu.sh index 5a635ae24a..b0a4a76555 100755 --- a/src/im_mad/remotes/xen.d/cpu.sh +++ b/src/im_mad/remotes/xen.d/cpu.sh @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/remotes/xen.d/name.sh b/src/im_mad/remotes/xen.d/name.sh index c58156197a..ea9f65692d 100755 --- a/src/im_mad/remotes/xen.d/name.sh +++ b/src/im_mad/remotes/xen.d/name.sh @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/im_mad/remotes/xen.d/xen.rb b/src/im_mad/remotes/xen.d/xen.rb index f11260a804..5a32098509 100755 --- a/src/im_mad/remotes/xen.d/xen.rb +++ b/src/im_mad/remotes/xen.d/xen.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/image/Image.cc b/src/image/Image.cc index 0548a02797..f87a0be23e 100644 --- a/src/image/Image.cc +++ b/src/image/Image.cc @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -38,6 +38,7 @@ Image::Image(int _uid, int _gid, const string& _uname, const string& _gname, + int _umask, ImageTemplate * _image_template): PoolObjectSQL(-1,IMAGE,"",_uid,_gid,_uname,_gname,table), type(OS), @@ -64,6 +65,8 @@ Image::Image(int _uid, { obj_template = new ImageTemplate; } + + set_umask(_umask); } Image::~Image() @@ -474,6 +477,8 @@ int Image::disk_attribute( VectorAttribute * disk, string driver; string disk_attr_type; + bool ro; + ostringstream iid; img_type = type; @@ -484,13 +489,17 @@ int Image::disk_attribute( VectorAttribute * disk, string template_target; string template_driver; + string template_ptype; get_template_attribute("TARGET", template_target); get_template_attribute("DRIVER", template_driver); + get_template_attribute("PERSISTENT_TYPE", template_ptype); - //--------------------------------------------------------------------------- - // DEV_PREFIX ATTRIBUTE - //--------------------------------------------------------------------------- + TO_UPPER(template_ptype); + + //--------------------------------------------------------------------------- + // DEV_PREFIX ATTRIBUTE + //--------------------------------------------------------------------------- if ( dev_prefix.empty() ) //DEV_PEFIX not in DISK, check for it in IMAGE { get_template_attribute("DEV_PREFIX", dev_prefix); @@ -503,9 +512,9 @@ int Image::disk_attribute( VectorAttribute * disk, disk->replace("DEV_PREFIX", dev_prefix); } - //--------------------------------------------------------------------------- - // BASE DISK ATTRIBUTES - //--------------------------------------------------------------------------- + //-------------------------------------------------------------------------- + // BASE DISK ATTRIBUTES + //-------------------------------------------------------------------------- disk->replace("IMAGE", name); disk->replace("IMAGE_ID", iid.str()); disk->replace("SOURCE", source); @@ -515,44 +524,71 @@ int Image::disk_attribute( VectorAttribute * disk, disk->replace("DRIVER",template_driver); } - //--------------------------------------------------------------------------- - // TYPE, READONLY, CLONE, and SAVE attributes - //--------------------------------------------------------------------------- + //-------------------------------------------------------------------------- + // READONLY attribute + //-------------------------------------------------------------------------- + if ( type == CDROM || template_ptype == "IMMUTABLE" ) + { + disk->replace("READONLY", "YES"); + } + else if ( disk->vector_value("READONLY", ro) != 0 ) + { + if ( get_template_attribute("READONLY", ro) ) + { + disk->replace("READONLY", ro); + } + else + { + disk->replace("READONLY", "NO"); + } + } + + //-------------------------------------------------------------------------- + // CLONE & SAVE attributes + //-------------------------------------------------------------------------- if ( persistent_img ) { - disk->replace("CLONE","NO"); - disk->replace("SAVE","YES"); - disk->replace("PERSISTENT","YES"); + disk->replace("PERSISTENT", "YES"); + disk->replace("CLONE", "NO"); + + if ( template_ptype == "IMMUTABLE" ) + { + disk->replace("SAVE", "NO"); + } + else + { + disk->replace("SAVE", "YES"); + } } else { - disk->replace("CLONE","YES"); - disk->replace("SAVE","NO"); + disk->replace("CLONE", "YES"); + disk->replace("SAVE", "NO"); } + //-------------------------------------------------------------------------- + // TYPE attribute + //-------------------------------------------------------------------------- switch(type) { case OS: case DATABLOCK: //Type is FILE or BLOCK as inherited from the DS - disk_attr_type = disk_type_to_str(disk_type); - disk->replace("READONLY","NO"); + disk_attr_type = disk_type_to_str(disk_type); break; case CDROM: //Always use CDROM type for these ones - disk_attr_type = "CDROM"; - disk->replace("READONLY","YES"); + disk_attr_type = "CDROM"; break; default: //Other file types should not be never a DISK break; } - disk->replace("TYPE",disk_attr_type); + disk->replace("TYPE", disk_attr_type); - //--------------------------------------------------------------------------- + //-------------------------------------------------------------------------- // TARGET attribute - //--------------------------------------------------------------------------- - + //-------------------------------------------------------------------------- // TARGET defined in the Image template, but not in the DISK attribute if ( target.empty() && !template_target.empty() ) { diff --git a/src/image/ImageManager.cc b/src/image/ImageManager.cc index d3a9744cd2..aa128c081d 100644 --- a/src/image/ImageManager.cc +++ b/src/image/ImageManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/image/ImageManagerActions.cc b/src/image/ImageManagerActions.cc index dfcc911403..9a1a17a245 100644 --- a/src/image/ImageManagerActions.cc +++ b/src/image/ImageManagerActions.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/image/ImageManagerDriver.cc b/src/image/ImageManagerDriver.cc index da7a6bb1e3..a252e219ae 100644 --- a/src/image/ImageManagerDriver.cc +++ b/src/image/ImageManagerDriver.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/image/ImagePool.cc b/src/image/ImagePool.cc index 5473b188d2..1ca4984d97 100644 --- a/src/image/ImagePool.cc +++ b/src/image/ImagePool.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -67,6 +67,7 @@ int ImagePool::allocate ( int gid, const string& uname, const string& gname, + int umask, ImageTemplate * img_template, int ds_id, const string& ds_name, @@ -86,7 +87,7 @@ int ImagePool::allocate ( string type; ostringstream oss; - img = new Image(uid, gid, uname, gname, img_template); + img = new Image(uid, gid, uname, gname, umask, img_template); // ------------------------------------------------------------------------- // Check name & duplicates diff --git a/src/image/ImageTemplate.cc b/src/image/ImageTemplate.cc index 3ef5145020..802569bfc0 100644 --- a/src/image/ImageTemplate.cc +++ b/src/image/ImageTemplate.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/image/SConstruct b/src/image/SConstruct index 26d5f70e35..db33b27a96 100644 --- a/src/image/SConstruct +++ b/src/image/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/vm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/image/test/ImagePoolTest.cc b/src/image/test/ImagePoolTest.cc index 01e00378e2..e2dd1c22e9 100644 --- a/src/image/test/ImagePoolTest.cc +++ b/src/image/test/ImagePoolTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/image/test/SConstruct b/src/image/test/SConstruct index b1f7b9ac8a..670d2ec087 100644 --- a/src/image/test/SConstruct +++ b/src/image/test/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 diff --git a/src/lcm/LifeCycleActions.cc b/src/lcm/LifeCycleActions.cc index 3833945405..d0827f8491 100644 --- a/src/lcm/LifeCycleActions.cc +++ b/src/lcm/LifeCycleActions.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -573,6 +573,7 @@ void LifeCycleManager::delete_action(int vid) Nebula& nd = Nebula::instance(); DispatchManager * dm = nd.get_dm(); + TransferManager * tm = nd.get_tm(); vm = vmpool->get(vid,true); @@ -581,17 +582,41 @@ void LifeCycleManager::delete_action(int vid) return; } - if ( vm->get_state() == VirtualMachine::ACTIVE && - (vm->get_lcm_state() != VirtualMachine::LCM_INIT && - vm->get_lcm_state() != VirtualMachine::CLEANUP)) - { - clean_up_vm(vm); - dm->trigger(DispatchManager::DONE,vid); - } - else + if ( vm->get_state() != VirtualMachine::ACTIVE ) { - vm->log("LCM", Log::ERROR, "delete_action, VM in a wrong state."); + vm->log("LCM", Log::ERROR, "clean_action, VM in a wrong state."); + vm->unlock(); + + return; + } + + switch(vm->get_lcm_state()) + { + case VirtualMachine::LCM_INIT: + vm->log("LCM", Log::ERROR, "clean_action, VM in a wrong state."); + break; + + case VirtualMachine::CLEANUP_RESUBMIT: + case VirtualMachine::CLEANUP_DELETE: + vm->set_state(VirtualMachine::CLEANUP_DELETE); + vmpool->update(vm); + + dm->trigger(DispatchManager::DONE, vid); + break; + + case VirtualMachine::FAILURE: + vm->set_state(VirtualMachine::CLEANUP_DELETE); + vmpool->update(vm); + + tm->trigger(TransferManager::EPILOG_DELETE,vid); + dm->trigger(DispatchManager::DONE, vid); + break; + + default: + clean_up_vm(vm, true); + dm->trigger(DispatchManager::DONE, vid); + break; } vm->unlock(); @@ -606,6 +631,10 @@ void LifeCycleManager::clean_action(int vid) { VirtualMachine * vm; + Nebula& nd = Nebula::instance(); + DispatchManager * dm = nd.get_dm(); + TransferManager * tm = nd.get_tm(); + vm = vmpool->get(vid,true); if ( vm == 0 ) @@ -613,16 +642,35 @@ void LifeCycleManager::clean_action(int vid) return; } - - if ( vm->get_state() == VirtualMachine::ACTIVE && - (vm->get_lcm_state() != VirtualMachine::LCM_INIT && - vm->get_lcm_state() != VirtualMachine::CLEANUP)) - { - clean_up_vm(vm); - } - else + if ( vm->get_state() != VirtualMachine::ACTIVE ) { vm->log("LCM", Log::ERROR, "clean_action, VM in a wrong state."); + vm->unlock(); + + return; + } + + switch(vm->get_lcm_state()) + { + case VirtualMachine::LCM_INIT: + case VirtualMachine::CLEANUP_DELETE: + vm->log("LCM", Log::ERROR, "clean_action, VM in a wrong state."); + break; + + case VirtualMachine::CLEANUP_RESUBMIT: + dm->trigger(DispatchManager::RESUBMIT, vid); + break; + + case VirtualMachine::FAILURE: + vm->set_state(VirtualMachine::CLEANUP_RESUBMIT); + vmpool->update(vm); + + tm->trigger(TransferManager::EPILOG_DELETE,vid); + break; + + default: + clean_up_vm(vm, false); + break; } vm->unlock(); @@ -631,7 +679,7 @@ void LifeCycleManager::clean_action(int vid) /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -void LifeCycleManager::clean_up_vm(VirtualMachine * vm) +void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose) { int cpu, mem, disk; time_t the_time = time(0); @@ -646,7 +694,15 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm) vm->log("LCM", Log::INFO, "New VM state is CLEANUP."); - vm->set_state(VirtualMachine::CLEANUP); + if (dispose) + { + vm->set_state(VirtualMachine::CLEANUP_DELETE); + } + else + { + vm->set_state(VirtualMachine::CLEANUP_RESUBMIT); + } + vm->set_resched(false); vmpool->update(vm); @@ -683,9 +739,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm) vmpool->update_history(vm); vmm->trigger(VirtualMachineManager::DRIVER_CANCEL,vid); - vmm->trigger(VirtualMachineManager::CANCEL,vid); - - tm->trigger(TransferManager::EPILOG_DELETE,vid); + vmm->trigger(VirtualMachineManager::CLEANUP,vid); break; case VirtualMachine::MIGRATE: @@ -701,11 +755,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm) hpool->del_capacity(vm->get_previous_hid(), vm->get_oid(), cpu, mem, disk); vmm->trigger(VirtualMachineManager::DRIVER_CANCEL,vid); - - vmm->trigger(VirtualMachineManager::CANCEL,vid); - vmm->trigger(VirtualMachineManager::CANCEL_PREVIOUS,vid); - - tm->trigger(TransferManager::EPILOG_DELETE,vid); + vmm->trigger(VirtualMachineManager::CLEANUP_BOTH,vid); break; case VirtualMachine::SAVE_STOP: @@ -714,9 +764,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm) vmpool->update_history(vm); vmm->trigger(VirtualMachineManager::DRIVER_CANCEL,vid); - vmm->trigger(VirtualMachineManager::CANCEL,vid); - - tm->trigger(TransferManager::EPILOG_DELETE,vid); + vmm->trigger(VirtualMachineManager::CLEANUP,vid); break; case VirtualMachine::SAVE_MIGRATE: @@ -732,9 +780,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm) hpool->del_capacity(vm->get_previous_hid(), vm->get_oid(), cpu, mem, disk); vmm->trigger(VirtualMachineManager::DRIVER_CANCEL,vid); - vmm->trigger(VirtualMachineManager::CANCEL_PREVIOUS,vid); - - tm->trigger(TransferManager::EPILOG_DELETE_PREVIOUS,vid); + vmm->trigger(VirtualMachineManager::CLEANUP_PREVIOUS,vid); break; case VirtualMachine::PROLOG_MIGRATE: @@ -742,8 +788,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm) vmpool->update_history(vm); tm->trigger(TransferManager::DRIVER_CANCEL,vid); - tm->trigger(TransferManager::EPILOG_DELETE,vid); - tm->trigger(TransferManager::EPILOG_DELETE_PREVIOUS,vid); + tm->trigger(TransferManager::EPILOG_DELETE_BOTH,vid); break; case VirtualMachine::EPILOG_STOP: @@ -755,12 +800,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm) tm->trigger(TransferManager::EPILOG_DELETE,vid); break; - case VirtualMachine::FAILURE: - vmpool->update_history(vm); - tm->trigger(TransferManager::EPILOG_DELETE,vid); - break; - - default: //LCM_INIT,CLEANUP + default: //LCM_INIT,CLEANUP_RESUBMIT, CLEANUP_DELETE, FAILURE break; } } diff --git a/src/lcm/LifeCycleManager.cc b/src/lcm/LifeCycleManager.cc index d763b5dac8..326da9c36f 100644 --- a/src/lcm/LifeCycleManager.cc +++ b/src/lcm/LifeCycleManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -145,6 +145,14 @@ void LifeCycleManager::trigger(Actions action, int _vid) aname = "DETACH_FAILURE"; break; + case CLEANUP_SUCCESS: + aname = "CLEANUP_SUCCESS"; + break; + + case CLEANUP_FAILURE: + aname = "CLEANUP_FAILURE"; + break; + case DEPLOY: aname = "DEPLOY"; break; @@ -298,6 +306,14 @@ void LifeCycleManager::do_action(const string &action, void * arg) { detach_failure_action(vid); } + else if (action == "CLEANUP_SUCCESS") + { + cleanup_callback_action(vid); + } + else if (action == "CLEANUP_FAILURE") + { + cleanup_callback_action(vid); + } else if (action == "DEPLOY") { deploy_action(vid); diff --git a/src/lcm/LifeCycleStates.cc b/src/lcm/LifeCycleStates.cc index f675572258..8c17bcd206 100644 --- a/src/lcm/LifeCycleStates.cc +++ b/src/lcm/LifeCycleStates.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -722,7 +722,7 @@ void LifeCycleManager::epilog_success_action(int vid) { action = DispatchManager::DONE; } - else if ( state == VirtualMachine::CLEANUP ) + else if ( state == VirtualMachine::CLEANUP_RESUBMIT ) { dm->trigger(DispatchManager::RESUBMIT, vid); @@ -762,6 +762,42 @@ void LifeCycleManager::epilog_success_action(int vid) /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ +void LifeCycleManager::cleanup_callback_action(int vid) +{ + Nebula& nd = Nebula::instance(); + DispatchManager * dm = nd.get_dm(); + + VirtualMachine * vm; + + VirtualMachine::LcmState state; + + vm = vmpool->get(vid,true); + + if ( vm == 0 ) + { + return; + } + + state = vm->get_lcm_state(); + + if ( state == VirtualMachine::CLEANUP_RESUBMIT ) + { + dm->trigger(DispatchManager::RESUBMIT, vid); + + } + else + { + vm->log("LCM",Log::ERROR,"cleanup_callback_action, VM in a wrong state"); + } + + vm->unlock(); + + return; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + void LifeCycleManager::epilog_failure_action(int vid) { VirtualMachine * vm; @@ -774,7 +810,7 @@ void LifeCycleManager::epilog_failure_action(int vid) return; } - if ( vm->get_lcm_state() == VirtualMachine::CLEANUP ) + if ( vm->get_lcm_state() == VirtualMachine::CLEANUP_RESUBMIT ) { Nebula& nd = Nebula::instance(); DispatchManager * dm = nd.get_dm(); diff --git a/src/lcm/SConstruct b/src/lcm/SConstruct index c309a5344f..922704b762 100644 --- a/src/lcm/SConstruct +++ b/src/lcm/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/vm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/lcm/test/DummyManager.h b/src/lcm/test/DummyManager.h index bbed8166a2..9fab509cf3 100644 --- a/src/lcm/test/DummyManager.h +++ b/src/lcm/test/DummyManager.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/lcm/test/LifeCycleManagerTest.cc b/src/lcm/test/LifeCycleManagerTest.cc index 3ba2c1e2d0..d545c4e73c 100644 --- a/src/lcm/test/LifeCycleManagerTest.cc +++ b/src/lcm/test/LifeCycleManagerTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/lcm/test/NebulaTestLCM.h b/src/lcm/test/NebulaTestLCM.h index 6d388debb1..04e8a153e8 100644 --- a/src/lcm/test/NebulaTestLCM.h +++ b/src/lcm/test/NebulaTestLCM.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/lcm/test/SConstruct b/src/lcm/test/SConstruct index bd5dc5bfd2..45e65fcb23 100644 --- a/src/lcm/test/SConstruct +++ b/src/lcm/test/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/lcm/test # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/log/Log.cc b/src/log/Log.cc index 6780e2de68..a8a77b2126 100644 --- a/src/log/Log.cc +++ b/src/log/Log.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/log/NebulaLog.cc b/src/log/NebulaLog.cc index 2ee2b508f0..df6f7cdcaa 100644 --- a/src/log/NebulaLog.cc +++ b/src/log/NebulaLog.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/log/SConstruct b/src/log/SConstruct index 32c3201757..b7c05fb822 100644 --- a/src/log/SConstruct +++ b/src/log/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/log # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/mad/Mad.cc b/src/mad/Mad.cc index e33c04cfdb..0f5ef2750e 100644 --- a/src/mad/Mad.cc +++ b/src/mad/Mad.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/mad/MadManager.cc b/src/mad/MadManager.cc index 287b61c0ba..ead10b39d6 100644 --- a/src/mad/MadManager.cc +++ b/src/mad/MadManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/mad/SConstruct b/src/mad/SConstruct index 8439c4f263..060d9af7a7 100644 --- a/src/mad/SConstruct +++ b/src/mad/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/mad # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/mad/ruby/ActionManager.rb b/src/mad/ruby/ActionManager.rb index 88e7079a44..e013fa4e34 100644 --- a/src/mad/ruby/ActionManager.rb +++ b/src/mad/ruby/ActionManager.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- */ -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 */ diff --git a/src/mad/ruby/CommandManager.rb b/src/mad/ruby/CommandManager.rb index fff4ca3929..16ba8eecef 100644 --- a/src/mad/ruby/CommandManager.rb +++ b/src/mad/ruby/CommandManager.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index f179a55d03..d462db9cc1 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/mad/ruby/Ganglia.rb b/src/mad/ruby/Ganglia.rb index e7ba2701d3..668f667b34 100644 --- a/src/mad/ruby/Ganglia.rb +++ b/src/mad/ruby/Ganglia.rb @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 97cf5dd134..e25ae7bdb2 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/mad/ruby/VirtualMachineDriver.rb b/src/mad/ruby/VirtualMachineDriver.rb index 335b63a03a..e53762c3d8 100644 --- a/src/mad/ruby/VirtualMachineDriver.rb +++ b/src/mad/ruby/VirtualMachineDriver.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -42,6 +42,7 @@ class VirtualMachineDriver < OpenNebulaDriver :log => "LOG", :attach_disk => "ATTACHDISK", :detach_disk => "DETACHDISK", + :cleanup => "CLEANUP" } POLL_ATTRIBUTE = { @@ -89,6 +90,7 @@ class VirtualMachineDriver < OpenNebulaDriver register_action(ACTION[:poll].to_sym, method("poll")) register_action(ACTION[:attach_disk].to_sym, method("attach_disk")) register_action(ACTION[:detach_disk].to_sym, method("detach_disk")) + register_action(ACTION[:cleanup].to_sym, method("cleanup")) end # Decodes the encoded XML driver message received from the core @@ -168,6 +170,11 @@ class VirtualMachineDriver < OpenNebulaDriver send_message(ACTION[:detach_disk],RESULT[:failure],id,error) end + def cleanup(id, drv_message) + error = "Action not implemented by driver #{self.class}" + send_message(ACTION[:cleanup],RESULT[:failure],id,error) + end + private # Interface to handle the pending events from the ActionManager Interface def delete_running_action(action_id) diff --git a/src/mad/ruby/scripts_common.rb b/src/mad/ruby/scripts_common.rb index 5288ab6e54..2824c2de98 100644 --- a/src/mad/ruby/scripts_common.rb +++ b/src/mad/ruby/scripts_common.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index 85bbb1427c..e10293dd91 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/mad/sh/madcommon.sh b/src/mad/sh/madcommon.sh index 5ac13551a2..2b171c191c 100644 --- a/src/mad/sh/madcommon.sh +++ b/src/mad/sh/madcommon.sh @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/mad/sh/scripts_common.sh b/src/mad/sh/scripts_common.sh index cb1979019a..c8d7a26ced 100644 --- a/src/mad/sh/scripts_common.sh +++ b/src/mad/sh/scripts_common.sh @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/mad/test/dummy b/src/mad/test/dummy index df4f999d96..6a44103353 100755 --- a/src/mad/test/dummy +++ b/src/mad/test/dummy @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/mad/utils/SConstruct b/src/mad/utils/SConstruct index f9479f344a..4df299a2f2 100644 --- a/src/mad/utils/SConstruct +++ b/src/mad/utils/SConstruct @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L # +# Copyright 2010-2013, C12G Labs S.L # # # # 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 # diff --git a/src/mad/utils/tty_expect.c b/src/mad/utils/tty_expect.c index e81d662933..a00ebe286e 100644 --- a/src/mad/utils/tty_expect.c +++ b/src/mad/utils/tty_expect.c @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2010-2012, C12G Labs S.L. */ +/* Copyright 2010-2013, C12G Labs S.L. */ /* */ /* 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 */ diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index 29654dc696..d69d34427a 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/nebula/NebulaTemplate.cc b/src/nebula/NebulaTemplate.cc index 578d359167..b16af0641e 100644 --- a/src/nebula/NebulaTemplate.cc +++ b/src/nebula/NebulaTemplate.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -225,6 +225,7 @@ void OpenNebulaTemplate::set_conf_default() #******************************************************************************* # SESSION_EXPIRATION_TIME # ENABLE_OTHER_PERMISSIONS +# DEFAULT_UMASK #******************************************************************************* */ // SESSION_EXPIRATION_TIME @@ -238,5 +239,11 @@ void OpenNebulaTemplate::set_conf_default() attribute = new SingleAttribute("ENABLE_OTHER_PERMISSIONS",value); conf_default.insert(make_pair(attribute->name(),attribute)); + + // DEFAULT_UMASK + value = "177"; + + attribute = new SingleAttribute("DEFAULT_UMASK",value); + conf_default.insert(make_pair(attribute->name(),attribute)); } diff --git a/src/nebula/SConstruct b/src/nebula/SConstruct index 2483ba74d2..aef1674a7d 100644 --- a/src/nebula/SConstruct +++ b/src/nebula/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/nebula # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/nebula/SystemDB.cc b/src/nebula/SystemDB.cc index 444033a917..8c8178f9bb 100644 --- a/src/nebula/SystemDB.cc +++ b/src/nebula/SystemDB.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/nebula/oned.cc b/src/nebula/oned.cc index cfe7968607..39101586a0 100644 --- a/src/nebula/oned.cc +++ b/src/nebula/oned.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -44,7 +44,7 @@ static const char * susage = static void print_license() { - cout<< "Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org)\n\n" + cout<< "Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs\n\n" << Nebula::version() << " is distributed and licensed for use under the" << " terms of the\nApache License, Version 2.0 " << "(http://www.apache.org/licenses/LICENSE-2.0).\n"; diff --git a/src/oca/java/build.sh b/src/oca/java/build.sh index 14d3ad1694..425708b9b8 100755 --- a/src/oca/java/build.sh +++ b/src/oca/java/build.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -83,8 +83,8 @@ do_documentation() -doctitle 'OpenNebula Cloud API Specification' \ -header 'OpenNebula
Cloud API' \ -bottom 'Visit OpenNebula.org
Copyright 2002-2012 © -OpenNebula Project Leads (OpenNebula.org).' +href="http://opennebula.org/">OpenNebula.org
Copyright 2002-2013 © +OpenNebula Project (OpenNebula.org), C12G Labs.' } do_jar() diff --git a/src/oca/java/share/examples/SessionInit.java b/src/oca/java/share/examples/SessionInit.java index 9d01ce8771..6d9fd2a088 100644 --- a/src/oca/java/share/examples/SessionInit.java +++ b/src/oca/java/share/examples/SessionInit.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/share/examples/UserSample.java b/src/oca/java/share/examples/UserSample.java index a1a0b5acee..4154d9462a 100644 --- a/src/oca/java/share/examples/UserSample.java +++ b/src/oca/java/share/examples/UserSample.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/share/examples/VMachineSample.java b/src/oca/java/share/examples/VMachineSample.java index 56ec256da5..aaedce071a 100644 --- a/src/oca/java/share/examples/VMachineSample.java +++ b/src/oca/java/share/examples/VMachineSample.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/Client.java b/src/oca/java/src/org/opennebula/client/Client.java index 7d4c87ad83..1c0233a605 100644 --- a/src/oca/java/src/org/opennebula/client/Client.java +++ b/src/oca/java/src/org/opennebula/client/Client.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/ClientConfigurationException.java b/src/oca/java/src/org/opennebula/client/ClientConfigurationException.java index 34f05a1054..fa8a1d76d8 100644 --- a/src/oca/java/src/org/opennebula/client/ClientConfigurationException.java +++ b/src/oca/java/src/org/opennebula/client/ClientConfigurationException.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/OneException.java b/src/oca/java/src/org/opennebula/client/OneException.java index 679782d228..509efcd34b 100644 --- a/src/oca/java/src/org/opennebula/client/OneException.java +++ b/src/oca/java/src/org/opennebula/client/OneException.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/OneResponse.java b/src/oca/java/src/org/opennebula/client/OneResponse.java index 52ac04c178..b5242ebe2d 100644 --- a/src/oca/java/src/org/opennebula/client/OneResponse.java +++ b/src/oca/java/src/org/opennebula/client/OneResponse.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/OneSystem.java b/src/oca/java/src/org/opennebula/client/OneSystem.java index 88c61edf19..433e8a523d 100644 --- a/src/oca/java/src/org/opennebula/client/OneSystem.java +++ b/src/oca/java/src/org/opennebula/client/OneSystem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/Pool.java b/src/oca/java/src/org/opennebula/client/Pool.java index 6afc200198..49472a15ae 100644 --- a/src/oca/java/src/org/opennebula/client/Pool.java +++ b/src/oca/java/src/org/opennebula/client/Pool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/PoolElement.java b/src/oca/java/src/org/opennebula/client/PoolElement.java index 28f1831772..c5caf3a5b5 100644 --- a/src/oca/java/src/org/opennebula/client/PoolElement.java +++ b/src/oca/java/src/org/opennebula/client/PoolElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/acl/Acl.java b/src/oca/java/src/org/opennebula/client/acl/Acl.java index bd82d71312..3b257b387b 100644 --- a/src/oca/java/src/org/opennebula/client/acl/Acl.java +++ b/src/oca/java/src/org/opennebula/client/acl/Acl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,6 +52,7 @@ public class Acl extends PoolElement{ tmpUsers.put("#", 0x0000000100000000L); tmpUsers.put("@", 0x0000000200000000L); tmpUsers.put("*", 0x0000000400000000L); + tmpUsers.put("%", 0x0000000800000000L); USERS = Collections.unmodifiableMap(tmpUsers); @@ -339,7 +340,7 @@ public class Acl extends PoolElement{ */ private static long calculateIds(String id) throws RuleParseException { - if( !id.matches("^([#@]\\d+|\\*)$") ) + if( !id.matches("^([#@%]\\d+|\\*)$") ) { throw new RuleParseException("ID string '" + id + "' malformed"); } diff --git a/src/oca/java/src/org/opennebula/client/acl/AclPool.java b/src/oca/java/src/org/opennebula/client/acl/AclPool.java index 05022419a9..1ce82b07d0 100644 --- a/src/oca/java/src/org/opennebula/client/acl/AclPool.java +++ b/src/oca/java/src/org/opennebula/client/acl/AclPool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/acl/RuleParseException.java b/src/oca/java/src/org/opennebula/client/acl/RuleParseException.java index e3f5a7baab..d2df808e26 100644 --- a/src/oca/java/src/org/opennebula/client/acl/RuleParseException.java +++ b/src/oca/java/src/org/opennebula/client/acl/RuleParseException.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/cluster/Cluster.java b/src/oca/java/src/org/opennebula/client/cluster/Cluster.java index 1edbe4a934..f88a73d6e5 100644 --- a/src/oca/java/src/org/opennebula/client/cluster/Cluster.java +++ b/src/oca/java/src/org/opennebula/client/cluster/Cluster.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/cluster/ClusterPool.java b/src/oca/java/src/org/opennebula/client/cluster/ClusterPool.java index 403f7d86ba..5b3f0a073f 100644 --- a/src/oca/java/src/org/opennebula/client/cluster/ClusterPool.java +++ b/src/oca/java/src/org/opennebula/client/cluster/ClusterPool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/datastore/Datastore.java b/src/oca/java/src/org/opennebula/client/datastore/Datastore.java index f2bca4788c..fde6ee827a 100644 --- a/src/oca/java/src/org/opennebula/client/datastore/Datastore.java +++ b/src/oca/java/src/org/opennebula/client/datastore/Datastore.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/datastore/DatastorePool.java b/src/oca/java/src/org/opennebula/client/datastore/DatastorePool.java index 299e622621..01e0739ba6 100644 --- a/src/oca/java/src/org/opennebula/client/datastore/DatastorePool.java +++ b/src/oca/java/src/org/opennebula/client/datastore/DatastorePool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/document/Document.java b/src/oca/java/src/org/opennebula/client/document/Document.java index 7f287a73f1..94f5c5e975 100644 --- a/src/oca/java/src/org/opennebula/client/document/Document.java +++ b/src/oca/java/src/org/opennebula/client/document/Document.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/document/DocumentPool.java b/src/oca/java/src/org/opennebula/client/document/DocumentPool.java index 80e588627f..31ae5e55b5 100644 --- a/src/oca/java/src/org/opennebula/client/document/DocumentPool.java +++ b/src/oca/java/src/org/opennebula/client/document/DocumentPool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/group/Group.java b/src/oca/java/src/org/opennebula/client/group/Group.java index 1a159e55a4..956b1d4c19 100644 --- a/src/oca/java/src/org/opennebula/client/group/Group.java +++ b/src/oca/java/src/org/opennebula/client/group/Group.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/group/GroupPool.java b/src/oca/java/src/org/opennebula/client/group/GroupPool.java index 14925af4ab..0bcb4468f3 100644 --- a/src/oca/java/src/org/opennebula/client/group/GroupPool.java +++ b/src/oca/java/src/org/opennebula/client/group/GroupPool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/host/Host.java b/src/oca/java/src/org/opennebula/client/host/Host.java index f8af74e012..e76f54e5e4 100644 --- a/src/oca/java/src/org/opennebula/client/host/Host.java +++ b/src/oca/java/src/org/opennebula/client/host/Host.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/host/HostPool.java b/src/oca/java/src/org/opennebula/client/host/HostPool.java index b6dd182136..fb8247708b 100644 --- a/src/oca/java/src/org/opennebula/client/host/HostPool.java +++ b/src/oca/java/src/org/opennebula/client/host/HostPool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/image/Image.java b/src/oca/java/src/org/opennebula/client/image/Image.java index 700371bd2a..045cca8e4f 100644 --- a/src/oca/java/src/org/opennebula/client/image/Image.java +++ b/src/oca/java/src/org/opennebula/client/image/Image.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/image/ImagePool.java b/src/oca/java/src/org/opennebula/client/image/ImagePool.java index 99ee470f1c..d54244eb92 100644 --- a/src/oca/java/src/org/opennebula/client/image/ImagePool.java +++ b/src/oca/java/src/org/opennebula/client/image/ImagePool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/template/Template.java b/src/oca/java/src/org/opennebula/client/template/Template.java index c8064436cc..a0c0607125 100644 --- a/src/oca/java/src/org/opennebula/client/template/Template.java +++ b/src/oca/java/src/org/opennebula/client/template/Template.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/template/TemplatePool.java b/src/oca/java/src/org/opennebula/client/template/TemplatePool.java index 640b8dd75a..8141ffe312 100644 --- a/src/oca/java/src/org/opennebula/client/template/TemplatePool.java +++ b/src/oca/java/src/org/opennebula/client/template/TemplatePool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/user/User.java b/src/oca/java/src/org/opennebula/client/user/User.java index 3bacbfa47f..869eaa36f7 100644 --- a/src/oca/java/src/org/opennebula/client/user/User.java +++ b/src/oca/java/src/org/opennebula/client/user/User.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/user/UserPool.java b/src/oca/java/src/org/opennebula/client/user/UserPool.java index 58e4cb5a2a..5836c64831 100644 --- a/src/oca/java/src/org/opennebula/client/user/UserPool.java +++ b/src/oca/java/src/org/opennebula/client/user/UserPool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 51f3779513..0cc1260ec2 100644 --- a/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java +++ b/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ public class VirtualMachine extends PoolElement{ private static final String ATTACH = METHOD_PREFIX + "attach"; private static final String DETACH = METHOD_PREFIX + "detach"; private static final String RENAME = METHOD_PREFIX + "rename"; + private static final String UPDATE = METHOD_PREFIX + "update"; private static final String[] VM_STATES = { @@ -82,14 +83,15 @@ public class VirtualMachine extends PoolElement{ "SHUTDOWN", "CANCEL", "FAILURE", - "CLEANUP", + "CLEANUP_RESUBMIT", "UNKNOWN", "HOTPLUG", "SHUTDOWN_POWEROFF", "BOOT_UNKNOWN", "BOOT_POWEROFF", "BOOT_SUSPENDED", - "BOOT_STOPPED" }; + "BOOT_STOPPED", + "CLEANUP_DELETE" }; private static final String[] SHORT_LCM_STATES = { @@ -115,7 +117,8 @@ public class VirtualMachine extends PoolElement{ "boot", "boot", "boot", - "boot" }; + "boot", + "clea" }; /** * Creates a new VM representation. @@ -168,6 +171,19 @@ public class VirtualMachine extends PoolElement{ return client.call(ALLOCATE, description, onHold); } + /** + * Replaces the user template contents for the given VM. + * + * @param client XML-RPC Client. + * @param id The id of the target vm. + * @param new_template New template contents + * @return If an error occurs the error message contains the reason. + */ + public static OneResponse update(Client client, int id, String new_template) + { + return client.call(UPDATE, id, new_template); + } + /** * Retrieves the information of the given VM. * @@ -544,6 +560,17 @@ public class VirtualMachine extends PoolElement{ return rename(client, id, name); } + /** + * Replaces this VM's user template contents. + * + * @param new_template New template contents + * @return If an error occurs the error message contains the reason. + */ + public OneResponse update(String new_template) + { + return client.call(UPDATE, id, new_template); + } + // ================================= // Helpers // ================================= diff --git a/src/oca/java/src/org/opennebula/client/vm/VirtualMachinePool.java b/src/oca/java/src/org/opennebula/client/vm/VirtualMachinePool.java index a15b379ebd..ec2655dc2f 100644 --- a/src/oca/java/src/org/opennebula/client/vm/VirtualMachinePool.java +++ b/src/oca/java/src/org/opennebula/client/vm/VirtualMachinePool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/vnet/VirtualNetwork.java b/src/oca/java/src/org/opennebula/client/vnet/VirtualNetwork.java index fd65e5584c..f1a03436a7 100644 --- a/src/oca/java/src/org/opennebula/client/vnet/VirtualNetwork.java +++ b/src/oca/java/src/org/opennebula/client/vnet/VirtualNetwork.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/src/org/opennebula/client/vnet/VirtualNetworkPool.java b/src/oca/java/src/org/opennebula/client/vnet/VirtualNetworkPool.java index 2b3ca56125..29996b7324 100644 --- a/src/oca/java/src/org/opennebula/client/vnet/VirtualNetworkPool.java +++ b/src/oca/java/src/org/opennebula/client/vnet/VirtualNetworkPool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/AclTest.java b/src/oca/java/test/AclTest.java index 73b55e6b6b..ea23b597cc 100644 --- a/src/oca/java/test/AclTest.java +++ b/src/oca/java/test/AclTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,6 +157,8 @@ public class AclTest "* VM+IMAGE+TEMPLATE/@100 CREATE+USE", "#2345 VM+IMAGE+TEMPLATE/* CREATE+USE", "@7 HOST/@100 USE+MANAGE", + "* HOST+DATASTORE/%100 MANAGE+USE", + "@107 NET/%100 USE" }; long[] users = { @@ -165,7 +167,9 @@ public class AclTest 0x20000006bL, 0x400000000L, 0x100000929L, - 0x200000007L + 0x200000007L, + 0x400000000L, + 0x20000006bL }; long[] resources = { @@ -174,7 +178,9 @@ public class AclTest 0x28200000064L, 0x29200000064L, 0x29400000000L, - 0x2200000064L + 0x2200000064L, + 0x102800000064L, + 0x4800000064L }; long[] rights = { @@ -183,7 +189,9 @@ public class AclTest 0x1L, 0x9L, 0x9L, - 0x3L + 0x3L, + 0x3L, + 0x1L }; for( int i = 0; i < rules.length; i++ ) @@ -254,6 +262,7 @@ public class AclTest "#3 TEMPLATE+HOS/#0 USE", "#3 /#0 USE", "#3 TEMPLATE/# USE", + "#3 TEMPLATE/% USE", "#3 TEMPLATE/#5 USE CREATE", "#3 TEMPLATE/#5", "#3 ", diff --git a/src/oca/java/test/DocumentTest.java b/src/oca/java/test/DocumentTest.java index 31456e1963..cfaac7ad58 100644 --- a/src/oca/java/test/DocumentTest.java +++ b/src/oca/java/test/DocumentTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/GroupTest.java b/src/oca/java/test/GroupTest.java index 42029b4627..5d2a7015ca 100644 --- a/src/oca/java/test/GroupTest.java +++ b/src/oca/java/test/GroupTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/HostTest.java b/src/oca/java/test/HostTest.java index f868b77552..8b1990ec83 100644 --- a/src/oca/java/test/HostTest.java +++ b/src/oca/java/test/HostTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/ImageTest.java b/src/oca/java/test/ImageTest.java index 770def7218..d124d5f624 100644 --- a/src/oca/java/test/ImageTest.java +++ b/src/oca/java/test/ImageTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/SessionTest.java b/src/oca/java/test/SessionTest.java index d6b94c6e2b..177d3b3219 100644 --- a/src/oca/java/test/SessionTest.java +++ b/src/oca/java/test/SessionTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/TemplateTest.java b/src/oca/java/test/TemplateTest.java index 7070e0840d..e225a7f0a8 100644 --- a/src/oca/java/test/TemplateTest.java +++ b/src/oca/java/test/TemplateTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/UserTest.java b/src/oca/java/test/UserTest.java index e0ee277e4a..b5875e5242 100644 --- a/src/oca/java/test/UserTest.java +++ b/src/oca/java/test/UserTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/VirtualMachineTest.java b/src/oca/java/test/VirtualMachineTest.java index 897d956d1b..02b0632f2e 100644 --- a/src/oca/java/test/VirtualMachineTest.java +++ b/src/oca/java/test/VirtualMachineTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/VirtualNetworkTest.java b/src/oca/java/test/VirtualNetworkTest.java index 93960a502c..9a545644f5 100644 --- a/src/oca/java/test/VirtualNetworkTest.java +++ b/src/oca/java/test/VirtualNetworkTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) + * Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/oca/java/test/all_tests.sh b/src/oca/java/test/all_tests.sh index cffeb16dff..c3887f26dd 100755 --- a/src/oca/java/test/all_tests.sh +++ b/src/oca/java/test/all_tests.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/oca/java/test/test.sh b/src/oca/java/test/test.sh index d021c7fa8c..4b3f30c4c6 100755 --- a/src/oca/java/test/test.sh +++ b/src/oca/java/test/test.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/oca/ruby/opennebula.rb b/src/oca/ruby/opennebula.rb new file mode 100644 index 0000000000..1c679430d5 --- /dev/null +++ b/src/oca/ruby/opennebula.rb @@ -0,0 +1,58 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # +# # +# 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. # +#--------------------------------------------------------------------------- # + + +begin # require 'rubygems' + require 'rubygems' +rescue Exception +end + +require 'digest/sha1' +require 'rexml/document' +require 'pp' + +require 'opennebula/xml_utils' +require 'opennebula/client' +require 'opennebula/error' +require 'opennebula/virtual_machine' +require 'opennebula/virtual_machine_pool' +require 'opennebula/virtual_network' +require 'opennebula/virtual_network_pool' +require 'opennebula/image' +require 'opennebula/image_pool' +require 'opennebula/user' +require 'opennebula/user_pool' +require 'opennebula/host' +require 'opennebula/host_pool' +require 'opennebula/template' +require 'opennebula/template_pool' +require 'opennebula/group' +require 'opennebula/group_pool' +require 'opennebula/acl' +require 'opennebula/acl_pool' +require 'opennebula/datastore' +require 'opennebula/datastore_pool' +require 'opennebula/cluster' +require 'opennebula/cluster_pool' +require 'opennebula/document' +require 'opennebula/document_pool' +require 'opennebula/system' + +module OpenNebula + + # OpenNebula version + VERSION = '3.9.0' +end diff --git a/src/oca/ruby/OpenNebula/Acl.rb b/src/oca/ruby/opennebula/acl.rb similarity index 95% rename from src/oca/ruby/OpenNebula/Acl.rb rename to src/oca/ruby/opennebula/acl.rb index a443be8eda..2258f5338c 100644 --- a/src/oca/ruby/OpenNebula/Acl.rb +++ b/src/oca/ruby/opennebula/acl.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -22,7 +22,7 @@ module OpenNebula # USER -> # # @ # ALL - # RESOURCE -> + separated list and "/{#,@}|ALL" + # RESOURCE -> + separated list and "/{#,@,%}|ALL" # VM, # HOST # NET @@ -41,7 +41,8 @@ module OpenNebula USERS = { "UID" => 0x100000000, "GID" => 0x200000000, - "ALL" => 0x400000000 + "ALL" => 0x400000000, + "CLUSTER" => 0x800000000 } RESOURCES = @@ -236,7 +237,7 @@ private # @return [Integer] the numeric value for the given id_str def self.calculate_ids(id_str) raise "ID string '#{id_str}' malformed" if - !id_str.match(/^([\#@]\d+|\*)$/) + !id_str.match(/^([\#@\%]\d+|\*)$/) value = 0 @@ -251,6 +252,10 @@ private when "*" users_value = USERS["ALL"] + + when "%" + value = USERS["CLUSTER"] + users_value = id_str[1..-1].to_i + value end return users_value diff --git a/src/oca/ruby/OpenNebula/AclPool.rb b/src/oca/ruby/opennebula/acl_pool.rb similarity index 95% rename from src/oca/ruby/OpenNebula/AclPool.rb rename to src/oca/ruby/opennebula/acl_pool.rb index 4c7a1deef1..668a2b9a4a 100644 --- a/src/oca/ruby/OpenNebula/AclPool.rb +++ b/src/oca/ruby/opennebula/acl_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class AclPool < Pool diff --git a/src/oca/ruby/OpenNebula.rb b/src/oca/ruby/opennebula/client.rb similarity index 64% rename from src/oca/ruby/OpenNebula.rb rename to src/oca/ruby/opennebula/client.rb index 9e60d0be8f..c935a20765 100644 --- a/src/oca/ruby/OpenNebula.rb +++ b/src/oca/ruby/opennebula/client.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -14,82 +14,9 @@ # limitations under the License. # #--------------------------------------------------------------------------- # - -begin # require 'rubygems' - require 'rubygems' -rescue Exception -end - require 'xmlrpc/client' -require 'digest/sha1' -require 'rexml/document' -require 'pp' - -require 'OpenNebula/XMLUtils' -require 'OpenNebula/VirtualMachine' -require 'OpenNebula/VirtualMachinePool' -require 'OpenNebula/VirtualNetwork' -require 'OpenNebula/VirtualNetworkPool' -require 'OpenNebula/Image' -require 'OpenNebula/ImagePool' -require 'OpenNebula/User' -require 'OpenNebula/UserPool' -require 'OpenNebula/Host' -require 'OpenNebula/HostPool' -require 'OpenNebula/Template' -require 'OpenNebula/TemplatePool' -require 'OpenNebula/Group' -require 'OpenNebula/GroupPool' -require 'OpenNebula/Acl' -require 'OpenNebula/AclPool' -require 'OpenNebula/Datastore' -require 'OpenNebula/DatastorePool' -require 'OpenNebula/Cluster' -require 'OpenNebula/ClusterPool' -require 'OpenNebula/Document' -require 'OpenNebula/DocumentPool' -require 'OpenNebula/System' module OpenNebula - - # OpenNebula version - VERSION = '3.9.0' - - # The Error Class represents a generic error in the OpenNebula - # library. It contains a readable representation of the error. - # Any function in the OpenNebula module will return an Error - # object in case of error. - class Error - ESUCCESS = 0x0000 - EAUTHENTICATION = 0x0100 - EAUTHORIZATION = 0x0200 - ENO_EXISTS = 0x0400 - EACTION = 0x0800 - EXML_RPC_API = 0x1000 - EINTERNAL = 0x2000 - ENOTDEFINED = 0x1111 - - attr_reader :message, :errno - - # +message+ Description of the error - # +errno+ OpenNebula code error - def initialize(message=nil, errno=0x1111) - @message = message - @errno = errno - end - - def to_str() - @message - end - end - - # Returns true if the object returned by a method of the OpenNebula - # library is an Error - def self.is_error?(value) - value.class==OpenNebula::Error - end - - if OpenNebula::NOKOGIRI class NokogiriStreamParser < XMLRPC::XMLParser::AbstractStreamParser def initialize @@ -112,7 +39,6 @@ module OpenNebula end end - # The client class, represents the connection with the core and handles the # xml-rpc calls. class Client diff --git a/src/oca/ruby/OpenNebula/Cluster.rb b/src/oca/ruby/opennebula/cluster.rb similarity index 98% rename from src/oca/ruby/OpenNebula/Cluster.rb rename to src/oca/ruby/opennebula/cluster.rb index e6abb4c7a3..3c0c129dea 100644 --- a/src/oca/ruby/OpenNebula/Cluster.rb +++ b/src/oca/ruby/opennebula/cluster.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' module OpenNebula class Cluster < PoolElement diff --git a/src/oca/ruby/OpenNebula/ClusterPool.rb b/src/oca/ruby/opennebula/cluster_pool.rb similarity index 95% rename from src/oca/ruby/OpenNebula/ClusterPool.rb rename to src/oca/ruby/opennebula/cluster_pool.rb index 780b72a347..f35faaa59c 100644 --- a/src/oca/ruby/OpenNebula/ClusterPool.rb +++ b/src/oca/ruby/opennebula/cluster_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class ClusterPool < Pool diff --git a/src/oca/ruby/OpenNebula/Datastore.rb b/src/oca/ruby/opennebula/datastore.rb similarity index 98% rename from src/oca/ruby/OpenNebula/Datastore.rb rename to src/oca/ruby/opennebula/datastore.rb index fa1410203a..9574e02499 100644 --- a/src/oca/ruby/OpenNebula/Datastore.rb +++ b/src/oca/ruby/opennebula/datastore.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' module OpenNebula class Datastore < PoolElement diff --git a/src/oca/ruby/OpenNebula/DatastorePool.rb b/src/oca/ruby/opennebula/datastore_pool.rb similarity index 95% rename from src/oca/ruby/OpenNebula/DatastorePool.rb rename to src/oca/ruby/opennebula/datastore_pool.rb index b491d394fe..c0ba2aedca 100644 --- a/src/oca/ruby/OpenNebula/DatastorePool.rb +++ b/src/oca/ruby/opennebula/datastore_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class DatastorePool < Pool diff --git a/src/oca/ruby/OpenNebula/Document.rb b/src/oca/ruby/opennebula/document.rb similarity index 98% rename from src/oca/ruby/OpenNebula/Document.rb rename to src/oca/ruby/opennebula/document.rb index bcb186c8e5..1dd96f8003 100644 --- a/src/oca/ruby/OpenNebula/Document.rb +++ b/src/oca/ruby/opennebula/document.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -14,14 +14,14 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' module OpenNebula # All subclasses must define the DOCUMENT_TYPE constant. # # @example - # require 'OpenNebula/Document' + # require 'opennebula/document' # # module OpenNebula # class CustomObject < Document diff --git a/src/oca/ruby/OpenNebula/DocumentJSON.rb b/src/oca/ruby/opennebula/document_json.rb similarity index 98% rename from src/oca/ruby/OpenNebula/DocumentJSON.rb rename to src/oca/ruby/opennebula/document_json.rb index 4e3ed5715d..eedc5eb35a 100644 --- a/src/oca/ruby/OpenNebula/DocumentJSON.rb +++ b/src/oca/ruby/opennebula/document_json.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/oca/ruby/OpenNebula/DocumentPool.rb b/src/oca/ruby/opennebula/document_pool.rb similarity index 96% rename from src/oca/ruby/OpenNebula/DocumentPool.rb rename to src/oca/ruby/opennebula/document_pool.rb index 3b428aa698..0f0130fd9e 100644 --- a/src/oca/ruby/OpenNebula/DocumentPool.rb +++ b/src/oca/ruby/opennebula/document_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula @@ -22,7 +22,7 @@ module OpenNebula # and the factory method. # # @example - # require 'OpenNebula/DocumentPool' + # require 'opennebuña/document_pool' # # module OpenNebula # class CustomObjectPool < DocumentPool diff --git a/src/oca/ruby/OpenNebula/DocumentPoolJSON.rb b/src/oca/ruby/opennebula/document_pool_json.rb similarity index 96% rename from src/oca/ruby/OpenNebula/DocumentPoolJSON.rb rename to src/oca/ruby/opennebula/document_pool_json.rb index 678b149e1c..8097dca44c 100644 --- a/src/oca/ruby/OpenNebula/DocumentPoolJSON.rb +++ b/src/oca/ruby/opennebula/document_pool_json.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/oca/ruby/opennebula/error.rb b/src/oca/ruby/opennebula/error.rb new file mode 100644 index 0000000000..e3081b0782 --- /dev/null +++ b/src/oca/ruby/opennebula/error.rb @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # +# # +# 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. # +#--------------------------------------------------------------------------- # + + +module OpenNebula + # The Error Class represents a generic error in the OpenNebula + # library. It contains a readable representation of the error. + # Any function in the OpenNebula module will return an Error + # object in case of error. + class Error + ESUCCESS = 0x0000 + EAUTHENTICATION = 0x0100 + EAUTHORIZATION = 0x0200 + ENO_EXISTS = 0x0400 + EACTION = 0x0800 + EXML_RPC_API = 0x1000 + EINTERNAL = 0x2000 + ENOTDEFINED = 0x1111 + + attr_reader :message, :errno + + # +message+ Description of the error + # +errno+ OpenNebula code error + def initialize(message=nil, errno=0x1111) + @message = message + @errno = errno + end + + def to_str() + @message + end + end + + # Returns true if the object returned by a method of the OpenNebula + # library is an Error + def self.is_error?(value) + value.class==OpenNebula::Error + end +end diff --git a/src/oca/ruby/OpenNebula/Group.rb b/src/oca/ruby/opennebula/group.rb similarity index 98% rename from src/oca/ruby/OpenNebula/Group.rb rename to src/oca/ruby/opennebula/group.rb index fcfefe8e38..8d66e45fb5 100644 --- a/src/oca/ruby/OpenNebula/Group.rb +++ b/src/oca/ruby/opennebula/group.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' module OpenNebula class Group < PoolElement diff --git a/src/oca/ruby/OpenNebula/GroupPool.rb b/src/oca/ruby/opennebula/group_pool.rb similarity index 95% rename from src/oca/ruby/OpenNebula/GroupPool.rb rename to src/oca/ruby/opennebula/group_pool.rb index 20ebdeed08..7321311759 100644 --- a/src/oca/ruby/OpenNebula/GroupPool.rb +++ b/src/oca/ruby/opennebula/group_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class GroupPool < Pool diff --git a/src/oca/ruby/OpenNebula/Host.rb b/src/oca/ruby/opennebula/host.rb similarity index 98% rename from src/oca/ruby/OpenNebula/Host.rb rename to src/oca/ruby/opennebula/host.rb index 1519351f80..773e25ebc7 100644 --- a/src/oca/ruby/OpenNebula/Host.rb +++ b/src/oca/ruby/opennebula/host.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' module OpenNebula class Host < PoolElement diff --git a/src/oca/ruby/OpenNebula/HostPool.rb b/src/oca/ruby/opennebula/host_pool.rb similarity index 97% rename from src/oca/ruby/OpenNebula/HostPool.rb rename to src/oca/ruby/opennebula/host_pool.rb index 8d71712d5a..b0514c9e1d 100644 --- a/src/oca/ruby/OpenNebula/HostPool.rb +++ b/src/oca/ruby/opennebula/host_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class HostPool < Pool diff --git a/src/oca/ruby/OpenNebula/Image.rb b/src/oca/ruby/opennebula/image.rb similarity index 98% rename from src/oca/ruby/OpenNebula/Image.rb rename to src/oca/ruby/opennebula/image.rb index 53a2f8aea7..502b6c22d1 100644 --- a/src/oca/ruby/OpenNebula/Image.rb +++ b/src/oca/ruby/opennebula/image.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' require 'fileutils' module OpenNebula diff --git a/src/oca/ruby/OpenNebula/ImagePool.rb b/src/oca/ruby/opennebula/image_pool.rb similarity index 96% rename from src/oca/ruby/OpenNebula/ImagePool.rb rename to src/oca/ruby/opennebula/image_pool.rb index 97cab2eb67..754b474d70 100644 --- a/src/oca/ruby/OpenNebula/ImagePool.rb +++ b/src/oca/ruby/opennebula/image_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class ImagePool < Pool diff --git a/src/oca/ruby/opennebula/pool.rb b/src/oca/ruby/opennebula/pool.rb new file mode 100644 index 0000000000..1ff18c1abd --- /dev/null +++ b/src/oca/ruby/opennebula/pool.rb @@ -0,0 +1,157 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # +# # +# 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. # +#--------------------------------------------------------------------------- # + +require 'opennebula/xml_utils' + +module OpenNebula + + # The Pool class represents a generic OpenNebula Pool in XML format + # and provides the basic functionality to handle the Pool elements + class Pool < XMLPool + include Enumerable + + protected + #pool:: _String_ XML name of the root element + #element:: _String_ XML name of the Pool elements + #client:: _Client_ represents a XML-RPC connection + def initialize(pool,element,client) + super(nil) + + @pool_name = pool.upcase + @element_name = element.upcase + + @client = client + end + + # Default Factory Method for the Pools. The factory method returns an + # suitable PoolElement object. Each Pool MUST implement the + # corresponding factory method + # element_xml:: _XML_ XML element describing the pool element + # [return] a PoolElement object + def factory(element_xml) + OpenNebula::PoolElement.new(element_xml,client) + end + + ####################################################################### + # Common XML-RPC Methods for all the Pool Types + ####################################################################### + + #Gets the pool without any filter. Host, Group and User Pools + # xml_method:: _String_ the name of the XML-RPC method + def info(xml_method) + return xmlrpc_info(xml_method) + end + + def info_all(xml_method, *args) + return xmlrpc_info(xml_method,INFO_ALL,-1,-1, *args) + end + + def info_mine(xml_method, *args) + return xmlrpc_info(xml_method,INFO_MINE,-1,-1, *args) + end + + def info_group(xml_method, *args) + return xmlrpc_info(xml_method,INFO_GROUP,-1,-1, *args) + end + + def info_filter(xml_method, who, start_id, end_id, *args) + return xmlrpc_info(xml_method,who, start_id, end_id, *args) + end + + # Retrieves the monitoring data for all the Objects in the pool + # + # @param [String] xml_method xml-rcp method + # @param [String] root_elem Root for each individual PoolElement + # @param [String] timestamp_elem Name of the XML element with the last + # monitorization timestamp + # @param [Array] xpath_expressions Elements to retrieve. + # @param args arguemnts for the xml_method call + # + # @return [Hash>>>>, + # OpenNebula::Error] The first level hash uses the Object ID as keys, + # and as value a Hash with the requested xpath expressions, + # and an Array of 'timestamp, value'. + def monitoring(xml_method, root_elem, timestamp_elem, xpath_expressions, + *args) + + rc = @client.call(xml_method, *args) + + if ( OpenNebula.is_error?(rc) ) + return rc + end + + xmldoc = XMLElement.new + xmldoc.initialize_xml(rc, 'MONITORING_DATA') + + hash = {} + + # Get all existing Object IDs + ids = xmldoc.retrieve_elements("#{root_elem}/ID") + + if ids.nil? + return hash + else + ids.uniq! + end + + ids.each { |id| + hash[id] = OpenNebula.process_monitoring( + xmldoc, root_elem, timestamp_elem, id, xpath_expressions) + + } + + return hash + end + + private + # Calls to the corresponding info method to retreive the pool + # representation in XML format + # xml_method:: _String_ the name of the XML-RPC method + # args:: _Array_ with additional arguments for the info call + # [return] nil in case of success or an Error object + def xmlrpc_info(xml_method,*args) + rc = @client.call(xml_method,*args) + + if !OpenNebula.is_error?(rc) + initialize_xml(rc,@pool_name) + rc = nil + end + + return rc + end + + public + # Constants for info queries (include/RequestManagerPoolInfoFilter.h) + INFO_GROUP = -1 + INFO_ALL = -2 + INFO_MINE = -3 + + # Iterates over every PoolElement in the Pool and calls the block with a + # a PoolElement obtained calling the factory method + # block:: _Block_ + def each(&block) + each_element(block) if @xml + end + + # DO NOT USE - ONLY REXML BACKEND + def to_str + str = "" + REXML::Formatters::Pretty.new(1).write(@xml,str) + + return str + end + end +end diff --git a/src/oca/ruby/OpenNebula/Pool.rb b/src/oca/ruby/opennebula/pool_element.rb similarity index 68% rename from src/oca/ruby/OpenNebula/Pool.rb rename to src/oca/ruby/opennebula/pool_element.rb index e917f7bb32..b65675ce28 100644 --- a/src/oca/ruby/OpenNebula/Pool.rb +++ b/src/oca/ruby/opennebula/pool_element.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -14,146 +14,9 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +require 'opennebula/pool' module OpenNebula - - # The Pool class represents a generic OpenNebula Pool in XML format - # and provides the basic functionality to handle the Pool elements - class Pool < XMLPool - include Enumerable - - protected - #pool:: _String_ XML name of the root element - #element:: _String_ XML name of the Pool elements - #client:: _Client_ represents a XML-RPC connection - def initialize(pool,element,client) - super(nil) - - @pool_name = pool.upcase - @element_name = element.upcase - - @client = client - end - - # Default Factory Method for the Pools. The factory method returns an - # suitable PoolElement object. Each Pool MUST implement the - # corresponding factory method - # element_xml:: _XML_ XML element describing the pool element - # [return] a PoolElement object - def factory(element_xml) - OpenNebula::PoolElement.new(element_xml,client) - end - - ####################################################################### - # Common XML-RPC Methods for all the Pool Types - ####################################################################### - - #Gets the pool without any filter. Host, Group and User Pools - # xml_method:: _String_ the name of the XML-RPC method - def info(xml_method) - return xmlrpc_info(xml_method) - end - - def info_all(xml_method, *args) - return xmlrpc_info(xml_method,INFO_ALL,-1,-1, *args) - end - - def info_mine(xml_method, *args) - return xmlrpc_info(xml_method,INFO_MINE,-1,-1, *args) - end - - def info_group(xml_method, *args) - return xmlrpc_info(xml_method,INFO_GROUP,-1,-1, *args) - end - - def info_filter(xml_method, who, start_id, end_id, *args) - return xmlrpc_info(xml_method,who, start_id, end_id, *args) - end - - # Retrieves the monitoring data for all the Objects in the pool - # - # @param [String] xml_method xml-rcp method - # @param [String] root_elem Root for each individual PoolElement - # @param [String] timestamp_elem Name of the XML element with the last - # monitorization timestamp - # @param [Array] xpath_expressions Elements to retrieve. - # @param args arguemnts for the xml_method call - # - # @return [Hash>>>>, - # OpenNebula::Error] The first level hash uses the Object ID as keys, - # and as value a Hash with the requested xpath expressions, - # and an Array of 'timestamp, value'. - def monitoring(xml_method, root_elem, timestamp_elem, xpath_expressions, - *args) - - rc = @client.call(xml_method, *args) - - if ( OpenNebula.is_error?(rc) ) - return rc - end - - xmldoc = XMLElement.new - xmldoc.initialize_xml(rc, 'MONITORING_DATA') - - hash = {} - - # Get all existing Object IDs - ids = xmldoc.retrieve_elements("#{root_elem}/ID") - - if ids.nil? - return hash - else - ids.uniq! - end - - ids.each { |id| - hash[id] = OpenNebula.process_monitoring( - xmldoc, root_elem, timestamp_elem, id, xpath_expressions) - - } - - return hash - end - - private - # Calls to the corresponding info method to retreive the pool - # representation in XML format - # xml_method:: _String_ the name of the XML-RPC method - # args:: _Array_ with additional arguments for the info call - # [return] nil in case of success or an Error object - def xmlrpc_info(xml_method,*args) - rc = @client.call(xml_method,*args) - - if !OpenNebula.is_error?(rc) - initialize_xml(rc,@pool_name) - rc = nil - end - - return rc - end - - public - # Constants for info queries (include/RequestManagerPoolInfoFilter.h) - INFO_GROUP = -1 - INFO_ALL = -2 - INFO_MINE = -3 - - # Iterates over every PoolElement in the Pool and calls the block with a - # a PoolElement obtained calling the factory method - # block:: _Block_ - def each(&block) - each_element(block) if @xml - end - - # DO NOT USE - ONLY REXML BACKEND - def to_str - str = "" - REXML::Formatters::Pretty.new(1).write(@xml,str) - - return str - end - end - # The PoolElement Class represents a generic element of a Pool in # XML format class PoolElement < XMLElement diff --git a/src/oca/ruby/OpenNebula/System.rb b/src/oca/ruby/opennebula/system.rb similarity index 98% rename from src/oca/ruby/OpenNebula/System.rb rename to src/oca/ruby/opennebula/system.rb index 9092e0be85..ab3eae4aa9 100644 --- a/src/oca/ruby/OpenNebula/System.rb +++ b/src/oca/ruby/opennebula/system.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class System diff --git a/src/oca/ruby/OpenNebula/Template.rb b/src/oca/ruby/opennebula/template.rb similarity index 98% rename from src/oca/ruby/OpenNebula/Template.rb rename to src/oca/ruby/opennebula/template.rb index cbafdfe2d4..e626ce5460 100644 --- a/src/oca/ruby/OpenNebula/Template.rb +++ b/src/oca/ruby/opennebula/template.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' module OpenNebula class Template < PoolElement diff --git a/src/oca/ruby/OpenNebula/TemplatePool.rb b/src/oca/ruby/opennebula/template_pool.rb similarity index 96% rename from src/oca/ruby/OpenNebula/TemplatePool.rb rename to src/oca/ruby/opennebula/template_pool.rb index 820d7c8d7b..e65782b3bc 100644 --- a/src/oca/ruby/OpenNebula/TemplatePool.rb +++ b/src/oca/ruby/opennebula/template_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class TemplatePool < Pool diff --git a/src/oca/ruby/OpenNebula/User.rb b/src/oca/ruby/opennebula/user.rb similarity index 98% rename from src/oca/ruby/OpenNebula/User.rb rename to src/oca/ruby/opennebula/user.rb index a4c381ccb6..335ce49222 100644 --- a/src/oca/ruby/OpenNebula/User.rb +++ b/src/oca/ruby/opennebula/user.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' module OpenNebula class User < PoolElement diff --git a/src/oca/ruby/OpenNebula/UserPool.rb b/src/oca/ruby/opennebula/user_pool.rb similarity index 95% rename from src/oca/ruby/OpenNebula/UserPool.rb rename to src/oca/ruby/opennebula/user_pool.rb index b4d9b733a6..2693f1d796 100644 --- a/src/oca/ruby/OpenNebula/UserPool.rb +++ b/src/oca/ruby/opennebula/user_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class UserPool < Pool diff --git a/src/oca/ruby/OpenNebula/VirtualMachine.rb b/src/oca/ruby/opennebula/virtual_machine.rb similarity index 89% rename from src/oca/ruby/OpenNebula/VirtualMachine.rb rename to src/oca/ruby/opennebula/virtual_machine.rb index 4ac7b6d745..94a21f22b6 100644 --- a/src/oca/ruby/OpenNebula/VirtualMachine.rb +++ b/src/oca/ruby/opennebula/virtual_machine.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' module OpenNebula class VirtualMachine < PoolElement @@ -36,16 +36,17 @@ module OpenNebula :monitoring => "vm.monitoring", :attach => "vm.attach", :detach => "vm.detach", - :rename => "vm.rename" + :rename => "vm.rename", + :update => "vm.update" } - VM_STATE=%w{INIT PENDING HOLD ACTIVE STOPPED SUSPENDED DONE FAILED + VM_STATE=%w{INIT PENDING HOLD ACTIVE STOPPED SUSPENDED DONE FAILED POWEROFF} LCM_STATE=%w{LCM_INIT PROLOG BOOT RUNNING MIGRATE SAVE_STOP SAVE_SUSPEND SAVE_MIGRATE PROLOG_MIGRATE PROLOG_RESUME EPILOG_STOP EPILOG - SHUTDOWN CANCEL FAILURE CLEANUP UNKNOWN HOTPLUG SHUTDOWN_POWEROFF - BOOT_UNKNOWN BOOT_POWEROFF BOOT_SUSPENDED BOOT_STOPPED} + SHUTDOWN CANCEL FAILURE CLEANUP_RESUBMIT UNKNOWN HOTPLUG SHUTDOWN_POWEROFF + BOOT_UNKNOWN BOOT_POWEROFF BOOT_SUSPENDED BOOT_STOPPED CLEANUP_DELETE} SHORT_VM_STATES={ "INIT" => "init", @@ -60,28 +61,29 @@ module OpenNebula } SHORT_LCM_STATES={ - "PROLOG" => "prol", - "BOOT" => "boot", - "RUNNING" => "runn", - "MIGRATE" => "migr", - "SAVE_STOP" => "save", - "SAVE_SUSPEND" => "save", - "SAVE_MIGRATE" => "save", - "PROLOG_MIGRATE"=> "migr", - "PROLOG_RESUME" => "prol", - "EPILOG_STOP" => "epil", - "EPILOG" => "epil", - "SHUTDOWN" => "shut", - "CANCEL" => "shut", - "FAILURE" => "fail", - "CLEANUP" => "clea", - "UNKNOWN" => "unkn", - "HOTPLUG" => "hotp", + "PROLOG" => "prol", + "BOOT" => "boot", + "RUNNING" => "runn", + "MIGRATE" => "migr", + "SAVE_STOP" => "save", + "SAVE_SUSPEND" => "save", + "SAVE_MIGRATE" => "save", + "PROLOG_MIGRATE" => "migr", + "PROLOG_RESUME" => "prol", + "EPILOG_STOP" => "epil", + "EPILOG" => "epil", + "SHUTDOWN" => "shut", + "CANCEL" => "shut", + "FAILURE" => "fail", + "CLEANUP_RESUBMIT" => "clea", + "UNKNOWN" => "unkn", + "HOTPLUG" => "hotp", "SHUTDOWN_POWEROFF" => "shut", - "BOOT_UNKNOWN" => "boot", - "BOOT_POWEROFF" => "boot", - "BOOT_SUSPENDED" => "boot", - "BOOT_STOPPED" => "boot" + "BOOT_UNKNOWN" => "boot", + "BOOT_POWEROFF" => "boot", + "BOOT_SUSPENDED" => "boot", + "BOOT_STOPPED" => "boot", + "CLEANUP_DELETE" => "clea" } MIGRATE_REASON=%w{NONE ERROR STOP_RESUME USER CANCEL} @@ -145,6 +147,15 @@ module OpenNebula super(VM_METHODS[:allocate], description, hold) end + # Replaces the template contents + # + # @param new_template New template contents. If no argument is provided + # the object will be updated using the @xml variable + def update(new_template=nil) + super(VM_METHODS[:update], new_template) + end + + # Initiates the instance of the VM on the target host. # # @param host_id [Interger] The host id (hid) of the target host where diff --git a/src/oca/ruby/OpenNebula/VirtualMachinePool.rb b/src/oca/ruby/opennebula/virtual_machine_pool.rb similarity index 99% rename from src/oca/ruby/OpenNebula/VirtualMachinePool.rb rename to src/oca/ruby/opennebula/virtual_machine_pool.rb index b0a06af35a..82979c60fd 100644 --- a/src/oca/ruby/OpenNebula/VirtualMachinePool.rb +++ b/src/oca/ruby/opennebula/virtual_machine_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class VirtualMachinePool < Pool diff --git a/src/oca/ruby/OpenNebula/VirtualNetwork.rb b/src/oca/ruby/opennebula/virtual_network.rb similarity index 98% rename from src/oca/ruby/OpenNebula/VirtualNetwork.rb rename to src/oca/ruby/opennebula/virtual_network.rb index b6964b4d0e..b5db7cebb3 100644 --- a/src/oca/ruby/OpenNebula/VirtualNetwork.rb +++ b/src/oca/ruby/opennebula/virtual_network.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool_element' module OpenNebula class VirtualNetwork < PoolElement diff --git a/src/oca/ruby/OpenNebula/VirtualNetworkPool.rb b/src/oca/ruby/opennebula/virtual_network_pool.rb similarity index 96% rename from src/oca/ruby/OpenNebula/VirtualNetworkPool.rb rename to src/oca/ruby/opennebula/virtual_network_pool.rb index 135da47e72..497f4f6d11 100644 --- a/src/oca/ruby/OpenNebula/VirtualNetworkPool.rb +++ b/src/oca/ruby/opennebula/virtual_network_pool.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # -require 'OpenNebula/Pool' +require 'opennebula/pool' module OpenNebula class VirtualNetworkPool < Pool diff --git a/src/oca/ruby/OpenNebula/XMLUtils.rb b/src/oca/ruby/opennebula/xml_element.rb similarity index 97% rename from src/oca/ruby/OpenNebula/XMLUtils.rb rename to src/oca/ruby/opennebula/xml_element.rb index 9a244312c0..a39f566898 100644 --- a/src/oca/ruby/OpenNebula/XMLUtils.rb +++ b/src/oca/ruby/opennebula/xml_element.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -16,21 +16,6 @@ module OpenNebula - - begin - require 'nokogiri' - NOKOGIRI=true - rescue LoadError - NOKOGIRI=false - end - - begin - require 'rexml/formatters/pretty' - REXML_FORMATTERS=true - rescue LoadError - REXML_FORMATTERS=false - end - # The XMLElement class provides an abstraction of the underlying # XML parser engine. It provides XML-related methods for the Pool and # PoolElement classes diff --git a/src/oca/ruby/opennebula/xml_pool.rb b/src/oca/ruby/opennebula/xml_pool.rb new file mode 100644 index 0000000000..0d5f65b382 --- /dev/null +++ b/src/oca/ruby/opennebula/xml_pool.rb @@ -0,0 +1,45 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # +# # +# 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. # +#--------------------------------------------------------------------------- # + +require 'opennebula/xml_element' + +module OpenNebula + # The XMLUtilsPool module provides an abstraction of the underlying + # XML parser engine. It provides XML-related methods for the Pools + class XMLPool < XMLElement + + def initialize(xml=nil) + super(xml) + end + + #Executes the given block for each element of the Pool + #block:: _Block_ + def each_element(block) + if NOKOGIRI + @xml.xpath( + "#{@element_name}").each {|pelem| + block.call self.factory(pelem) + } + else + @xml.elements.each( + "#{@element_name}") {|pelem| + block.call self.factory(pelem) + } + end + end + end + +end diff --git a/src/oca/ruby/opennebula/xml_utils.rb b/src/oca/ruby/opennebula/xml_utils.rb new file mode 100644 index 0000000000..e4088caa0c --- /dev/null +++ b/src/oca/ruby/opennebula/xml_utils.rb @@ -0,0 +1,34 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # +# # +# 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. # +#--------------------------------------------------------------------------- # + +require 'opennebula/xml_pool' + +module OpenNebula + + begin + require 'nokogiri' + NOKOGIRI=true + rescue LoadError + NOKOGIRI=false + end + + begin + require 'rexml/formatters/pretty' + REXML_FORMATTERS=true + rescue LoadError + REXML_FORMATTERS=false + end +end diff --git a/src/oca/ruby/test/HostPool_spec.rb b/src/oca/ruby/test/HostPool_spec.rb index 7c2d083330..b2acda5e22 100644 --- a/src/oca/ruby/test/HostPool_spec.rb +++ b/src/oca/ruby/test/HostPool_spec.rb @@ -1,7 +1,7 @@ $: << '../' \ << './' -require 'OpenNebula' +require 'opennebula' require 'helpers/MockClient' module OpenNebula diff --git a/src/oca/ruby/test/Host_spec.rb b/src/oca/ruby/test/Host_spec.rb index 5d0a585b19..fa255dc4c6 100644 --- a/src/oca/ruby/test/Host_spec.rb +++ b/src/oca/ruby/test/Host_spec.rb @@ -1,7 +1,7 @@ $: << '../' \ << './' -require 'OpenNebula' +require 'opennebula' require 'helpers/MockClient' module OpenNebula diff --git a/src/oca/ruby/test/UserPool_spec.rb b/src/oca/ruby/test/UserPool_spec.rb index 22f208b6af..9f471d1fb3 100644 --- a/src/oca/ruby/test/UserPool_spec.rb +++ b/src/oca/ruby/test/UserPool_spec.rb @@ -1,7 +1,7 @@ $: << '../' \ << './' -require 'OpenNebula' +require 'opennebula' require 'helpers/MockClient' module OpenNebula diff --git a/src/oca/ruby/test/User_spec.rb b/src/oca/ruby/test/User_spec.rb index c3f25fdbc6..dfe158656a 100644 --- a/src/oca/ruby/test/User_spec.rb +++ b/src/oca/ruby/test/User_spec.rb @@ -1,7 +1,7 @@ $: << '../' \ << './' -require 'OpenNebula' +require 'opennebula' require 'helpers/MockClient' module OpenNebula diff --git a/src/oca/ruby/test/VirtualMachinePool_spec.rb b/src/oca/ruby/test/VirtualMachinePool_spec.rb index 5d08cce65f..eb3988dd4e 100644 --- a/src/oca/ruby/test/VirtualMachinePool_spec.rb +++ b/src/oca/ruby/test/VirtualMachinePool_spec.rb @@ -1,7 +1,7 @@ $: << '../' \ << './' -require 'OpenNebula' +require 'opennebula' require 'helpers/MockClient' module OpenNebula diff --git a/src/oca/ruby/test/VirtualMachine_spec.rb b/src/oca/ruby/test/VirtualMachine_spec.rb index 982916fa5a..a26308ba13 100644 --- a/src/oca/ruby/test/VirtualMachine_spec.rb +++ b/src/oca/ruby/test/VirtualMachine_spec.rb @@ -1,7 +1,7 @@ $: << '../' \ << './' -require 'OpenNebula' +require 'opennebula' require 'helpers/MockClient' module OpenNebula diff --git a/src/oca/ruby/test/VirtualNetworkPool_spec.rb b/src/oca/ruby/test/VirtualNetworkPool_spec.rb index 5bebce9fa0..4904b2fbfc 100644 --- a/src/oca/ruby/test/VirtualNetworkPool_spec.rb +++ b/src/oca/ruby/test/VirtualNetworkPool_spec.rb @@ -1,7 +1,7 @@ $: << '../' \ << './' -require 'OpenNebula' +require 'opennebula' require 'helpers/MockClient' module OpenNebula diff --git a/src/oca/ruby/test/VirtualNetwork_spec.rb b/src/oca/ruby/test/VirtualNetwork_spec.rb index 3d3431da2f..e061932653 100644 --- a/src/oca/ruby/test/VirtualNetwork_spec.rb +++ b/src/oca/ruby/test/VirtualNetwork_spec.rb @@ -1,7 +1,7 @@ $: << '../' \ << './' -require 'OpenNebula' +require 'opennebula' require 'helpers/MockClient' module OpenNebula diff --git a/src/oca/ruby/test/XMLUtils_spec.rb b/src/oca/ruby/test/XMLUtils_spec.rb index 45b9fdacf6..a11723500a 100644 --- a/src/oca/ruby/test/XMLUtils_spec.rb +++ b/src/oca/ruby/test/XMLUtils_spec.rb @@ -2,7 +2,7 @@ $: << '..' require 'rexml/document' -require 'OpenNebula/XMLUtils' +require 'opennebula/XMLUtils' shared_examples "modifying XML" do it "add a new element '.', 'B2' => 'bdos'" do @@ -97,4 +97,4 @@ require 'OpenNebula/XMLUtils' end it_behaves_like "modifying XML" - end \ No newline at end of file + end diff --git a/src/onedb/2.0_to_2.9.80.rb b/src/onedb/2.0_to_2.9.80.rb index 8650fe8d45..3be93d420b 100644 --- a/src/onedb/2.0_to_2.9.80.rb +++ b/src/onedb/2.0_to_2.9.80.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/2.9.80_to_2.9.85.rb b/src/onedb/2.9.80_to_2.9.85.rb index cc80dc470d..52d4a2ca49 100644 --- a/src/onedb/2.9.80_to_2.9.85.rb +++ b/src/onedb/2.9.80_to_2.9.85.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/2.9.85_to_2.9.90.rb b/src/onedb/2.9.85_to_2.9.90.rb index 8857c15d5a..a60f34120b 100644 --- a/src/onedb/2.9.85_to_2.9.90.rb +++ b/src/onedb/2.9.85_to_2.9.90.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/2.9.90_to_3.0.0.rb b/src/onedb/2.9.90_to_3.0.0.rb index 97d320df2e..bf02ea017f 100644 --- a/src/onedb/2.9.90_to_3.0.0.rb +++ b/src/onedb/2.9.90_to_3.0.0.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.0.0_to_3.1.0.rb b/src/onedb/3.0.0_to_3.1.0.rb index 8a29680eb0..75bec2a248 100644 --- a/src/onedb/3.0.0_to_3.1.0.rb +++ b/src/onedb/3.0.0_to_3.1.0.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.1.0_to_3.1.80.rb b/src/onedb/3.1.0_to_3.1.80.rb index 0c6fdfacba..badbc54392 100644 --- a/src/onedb/3.1.0_to_3.1.80.rb +++ b/src/onedb/3.1.0_to_3.1.80.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.1.80_to_3.2.0.rb b/src/onedb/3.1.80_to_3.2.0.rb index 0932268498..44f3b608ab 100644 --- a/src/onedb/3.1.80_to_3.2.0.rb +++ b/src/onedb/3.1.80_to_3.2.0.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.2.0_to_3.2.1.rb b/src/onedb/3.2.0_to_3.2.1.rb index c6f0754fa8..6706bc5a50 100644 --- a/src/onedb/3.2.0_to_3.2.1.rb +++ b/src/onedb/3.2.0_to_3.2.1.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.2.1_to_3.3.0.rb b/src/onedb/3.2.1_to_3.3.0.rb index 9044892d14..6464d3d031 100644 --- a/src/onedb/3.2.1_to_3.3.0.rb +++ b/src/onedb/3.2.1_to_3.3.0.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.3.0_to_3.3.80.rb b/src/onedb/3.3.0_to_3.3.80.rb index a82d58d6e9..0b5e713d48 100644 --- a/src/onedb/3.3.0_to_3.3.80.rb +++ b/src/onedb/3.3.0_to_3.3.80.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.3.80_to_3.4.0.rb b/src/onedb/3.3.80_to_3.4.0.rb index 4b5974e5de..16e271115b 100644 --- a/src/onedb/3.3.80_to_3.4.0.rb +++ b/src/onedb/3.3.80_to_3.4.0.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.4.0_to_3.4.1.rb b/src/onedb/3.4.0_to_3.4.1.rb index b11206ad1d..de5519d619 100644 --- a/src/onedb/3.4.0_to_3.4.1.rb +++ b/src/onedb/3.4.0_to_3.4.1.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.4.1_to_3.5.80.rb b/src/onedb/3.4.1_to_3.5.80.rb index eab4951d38..b314facbef 100644 --- a/src/onedb/3.4.1_to_3.5.80.rb +++ b/src/onedb/3.4.1_to_3.5.80.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.5.80_to_3.6.0.rb b/src/onedb/3.5.80_to_3.6.0.rb index cf8b892eb9..dffc0a9d1e 100644 --- a/src/onedb/3.5.80_to_3.6.0.rb +++ b/src/onedb/3.5.80_to_3.6.0.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # 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 c920092f26..ff71bbd0b4 100644 --- a/src/onedb/3.6.0_to_3.7.80.rb +++ b/src/onedb/3.6.0_to_3.7.80.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.7.80_to_3.8.0.rb b/src/onedb/3.7.80_to_3.8.0.rb index 7162c26d4a..8809730d12 100644 --- a/src/onedb/3.7.80_to_3.8.0.rb +++ b/src/onedb/3.7.80_to_3.8.0.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.8.0_to_3.8.1.rb b/src/onedb/3.8.0_to_3.8.1.rb index e37bb9b247..d060e714ad 100644 --- a/src/onedb/3.8.0_to_3.8.1.rb +++ b/src/onedb/3.8.0_to_3.8.1.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/3.8.1_to_3.9.80.rb b/src/onedb/3.8.1_to_3.9.80.rb index 6c4f489615..fec8fa19f4 100644 --- a/src/onedb/3.8.1_to_3.9.80.rb +++ b/src/onedb/3.8.1_to_3.9.80.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -112,14 +112,66 @@ module Migrator @db.run("DROP TABLE image_pool") @db.run("ALTER TABLE image_pool_new RENAME TO image_pool") + ######################################################################## + # Feature #1565: New cid column in host, ds and vnet tables + ######################################################################## + + @db.run "ALTER TABLE host_pool RENAME TO old_host_pool;" + @db.run "CREATE TABLE host_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, state INTEGER, last_mon_time INTEGER, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name));" + + @db.fetch("SELECT * FROM old_host_pool") do |row| + doc = Document.new(row[:body]) + + cluster_id = doc.root.get_text('CLUSTER_ID').to_s + + @db[:host_pool].insert( + :oid => row[:oid], + :name => row[:name], + :body => row[:body], + :state => row[:state], + :last_mon_time => row[:last_mon_time], + :uid => row[:uid], + :gid => row[:gid], + :owner_u => row[:owner_u], + :group_u => row[:group_u], + :other_u => row[:other_u], + :cid => cluster_id) + end + + @db.run "DROP TABLE old_host_pool;" + + @db.run "ALTER TABLE network_pool RENAME TO old_network_pool;" + @db.run "CREATE TABLE network_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name,uid));" + + @db.fetch("SELECT * FROM old_network_pool") do |row| + doc = Document.new(row[:body]) + + cluster_id = doc.root.get_text('CLUSTER_ID').to_s + + @db[:network_pool].insert( + :oid => row[:oid], + :name => row[:name], + :body => row[:body], + :uid => row[:uid], + :gid => row[:gid], + :owner_u => row[:owner_u], + :group_u => row[:group_u], + :other_u => row[:other_u], + :cid => cluster_id) + end + + @db.run "DROP TABLE old_network_pool;" + ######################################################################## # Feature #1617 # New datastore, 2 "files" # DATASTORE/SYSTEM is now DATASTORE/TYPE + # + # Feature #1565: New cid column in host, ds and vnet tables ######################################################################## @db.run "ALTER TABLE datastore_pool RENAME TO old_datastore_pool;" - @db.run "CREATE TABLE datastore_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));" + @db.run "CREATE TABLE datastore_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name));" @db.fetch("SELECT * FROM old_datastore_pool") do |row| doc = Document.new(row[:body]) @@ -139,6 +191,8 @@ module Migrator e.add_element("TYPE").text = type == "0" ? "IMAGE_DS" : "SYSTEM_DS" end + cluster_id = doc.root.get_text('CLUSTER_ID').to_s + @db[:datastore_pool].insert( :oid => row[:oid], :name => row[:name], @@ -147,7 +201,8 @@ module Migrator :gid => row[:gid], :owner_u => row[:owner_u], :group_u => row[:group_u], - :other_u => row[:other_u]) + :other_u => row[:other_u], + :cid => cluster_id) end @db.run "DROP TABLE old_datastore_pool;" @@ -176,7 +231,7 @@ module Migrator end end - @db.run "INSERT INTO datastore_pool VALUES(2,'files','200#{user_0_name}#{group_0_name}files110100100fsssh#{base_path}20-1',0,0,1,1,1);" + @db.run "INSERT INTO datastore_pool VALUES(2,'files','200#{user_0_name}#{group_0_name}files110100100fsssh#{base_path}20-1',0,0,1,1,1,-1);" ######################################################################## @@ -259,6 +314,121 @@ module Migrator @db.run "DROP TABLE old_group_pool;" + ######################################################################## + # Bug #1694: SYSTEM_DS is now set with the method adddatastore + ######################################################################## + + @db.run "ALTER TABLE cluster_pool RENAME TO old_cluster_pool;" + @db.run "CREATE TABLE cluster_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));" + + @db.fetch("SELECT * FROM old_cluster_pool") do |row| + doc = Document.new(row[:body]) + + system_ds = 0 + + doc.root.each_element("TEMPLATE") do |e| + elem = e.delete_element("SYSTEM_DS") + + if !elem.nil? + system_ds = elem.text.to_i + end + end + + if system_ds != 0 + updated_body = nil + + @db.fetch("SELECT body FROM datastore_pool WHERE oid=#{system_ds}") do |ds_row| + ds_doc = Document.new(ds_row[:body]) + + type = "0" # IMAGE_DS + + ds_doc.root.each_element("TYPE") do |e| + type = e.text + end + + if type != "1" + puts " > Cluster #{row[:oid]} has the "<< + "System Datastore set to Datastore #{system_ds}, "<< + "but its type is not SYSTEM_DS. The System Datastore "<< + "for this Cluster will be set to 0" + + system_ds = 0 + else + cluster_id = "-1" + + ds_doc.root.each_element("CLUSTER_ID") do |e| + cluster_id = e.text + end + + if row[:oid] != cluster_id.to_i + puts " > Cluster #{row[:oid]} has the "<< + "System Datastore set to Datastore #{system_ds}, "<< + "but it is not part of the Cluster. It will be added now." + + ds_doc.root.each_element("CLUSTER_ID") do |e| + e.text = row[:oid] + end + + ds_doc.root.each_element("CLUSTER") do |e| + e.text = row[:name] + end + + updated_body = ds_doc.root.to_s + end + end + end + + if !updated_body.nil? + @db[:datastore_pool].where(:oid => system_ds).update( + :body => updated_body) + end + end + + doc.root.add_element("SYSTEM_DS").text = system_ds.to_s + + @db[:cluster_pool].insert( + :oid => row[:oid], + :name => row[:name], + :body => doc.root.to_s, + :uid => row[:uid], + :gid => row[:gid], + :owner_u => row[:owner_u], + :group_u => row[:group_u], + :other_u => row[:other_u]) + end + + @db.run "DROP TABLE old_cluster_pool;" + + + ######################################################################## + # Feature #1556: New elem USER_TEMPLATE + ######################################################################## + + @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| + + doc = Document.new(row[:body]) + doc.root.add_element("USER_TEMPLATE") + + @db[:vm_pool].insert( + :oid => row[:oid], + :name => row[:name], + :body => doc.root.to_s, + :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;" + + ######################################################################## # # Banner for the new /var/lib/one/vms directory diff --git a/src/onedb/fsck.rb b/src/onedb/fsck.rb index 9a252c01fd..2c743595b4 100644 --- a/src/onedb/fsck.rb +++ b/src/onedb/fsck.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -20,12 +20,14 @@ require 'ipaddr' require 'set' module OneDBFsck + VERSION = "3.9.0" + def db_version - "4.0.0" + VERSION end def one_version - "OpenNebula 4.0.0" + "OpenNebula #{VERSION}" end IMAGE_STATES=%w{INIT READY USED DISABLED LOCKED ERROR CLONE DELETE USED_PERS} @@ -249,6 +251,7 @@ module OneDBFsck ######################################################################## # Clusters # + # CLUSTER/SYSTEM_DS # CLUSTER/HOSTS/ID # CLUSTER/DATASTORES/ID # CLUSTER/VNETS/ID @@ -277,6 +280,8 @@ module OneDBFsck cluster[row[:oid]][:hosts] = [] cluster[row[:oid]][:datastores] = [] cluster[row[:oid]][:vnets] = [] + + cluster[row[:oid]][:system_ds] = 0 end hosts_fix = {} @@ -308,7 +313,7 @@ module OneDBFsck end hosts_fix.each do |id, body| - @db[:host_pool].where(:oid => id).update(:body => body) + @db[:host_pool].where(:oid => id).update(:body => body, :cid => -1) end @@ -331,13 +336,32 @@ module OneDBFsck datastores_fix[row[:oid]] = doc.to_s else - cluster[cluster_id][:datastores] << row[:oid] + if doc.root.get_text('TYPE').to_s != "1" + cluster[cluster_id][:datastores] << row[:oid] + else + if cluster[cluster_id][:system_ds] == 0 + cluster[cluster_id][:datastores] << row[:oid] + cluster[cluster_id][:system_ds] = row[:oid] + else + log_error("System Datastore #{row[:oid]} is in Cluster #{cluster_id}, but it already contains System Datastore #{cluster[cluster_id][:system_ds]}") + + doc.root.each_element('CLUSTER_ID') do |e| + e.text = "-1" + end + + doc.root.each_element('CLUSTER') do |e| + e.text = "" + end + + datastores_fix[row[:oid]] = doc.to_s + end + end end end end datastores_fix.each do |id, body| - @db[:datastore_pool].where(:oid => id).update(:body => body) + @db[:datastore_pool].where(:oid => id).update(:body => body, :cid => -1) end @@ -366,7 +390,7 @@ module OneDBFsck end vnets_fix.each do |id, body| - @db[:network_pool].where(:oid => id).update(:body => body) + @db[:network_pool].where(:oid => id).update(:body => body, :cid => -1) end @@ -401,6 +425,16 @@ module OneDBFsck ds_new_elem = doc.root.add_element("DATASTORES") + doc.root.each_element("SYSTEM_DS") do |e| + system_ds = e.text.to_i + + if system_ds != cluster[cluster_id][:system_ds] + log_error("Cluster #{cluster_id} has System Datastore set to #{system_ds}, but it should be #{cluster[cluster_id][:system_ds]}") + + e.text = cluster[cluster_id][:system_ds].to_s + end + end + cluster[cluster_id][:datastores].each do |id| id_elem = ds_elem.elements.delete("ID[.=#{id}]") @@ -498,7 +532,7 @@ module OneDBFsck end - @db.run "CREATE TABLE datastore_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));" + @db.run "CREATE TABLE datastore_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name));" @db.fetch("SELECT * from datastore_pool") do |row| ds_id = row[:oid] @@ -676,7 +710,7 @@ module OneDBFsck "name VARCHAR(128), body TEXT, state INTEGER, " << "last_mon_time INTEGER, uid INTEGER, gid INTEGER, " << "owner_u INTEGER, group_u INTEGER, other_u INTEGER, " << - "UNIQUE(name));" + "cid INTEGER, UNIQUE(name));" # Calculate the host's xml and write them to host_pool_new @db[:host_pool].each do |row| @@ -1003,7 +1037,7 @@ module OneDBFsck ######################################################################## # Create a new empty table where we will store the new calculated values - @db.run "CREATE TABLE network_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name,uid));" + @db.run "CREATE TABLE network_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name,uid));" @db[:network_pool].each do |row| doc = Document.new(row[:body]) diff --git a/src/onedb/onedb b/src/onedb/onedb index 7c95f48804..6768e0af65 100755 --- a/src/onedb/onedb +++ b/src/onedb/onedb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/onedb.rb b/src/onedb/onedb.rb index 09ab881b8b..f253222d98 100644 --- a/src/onedb/onedb.rb +++ b/src/onedb/onedb.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/onedb/onedb_backend.rb b/src/onedb/onedb_backend.rb index fdd7e33b35..1bf6ea9690 100644 --- a/src/onedb/onedb_backend.rb +++ b/src/onedb/onedb_backend.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/ozones/Client/bin/onevdc b/src/ozones/Client/bin/onevdc index 2872771b1a..3b38c001ed 100755 --- a/src/ozones/Client/bin/onevdc +++ b/src/ozones/Client/bin/onevdc @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/ozones/Client/bin/onezone b/src/ozones/Client/bin/onezone index ccef51e094..4a36d16bd6 100755 --- a/src/ozones/Client/bin/onezone +++ b/src/ozones/Client/bin/onezone @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/ozones/Client/lib/cli/ozones_helper.rb b/src/ozones/Client/lib/cli/ozones_helper.rb index cf13653354..1a4afefbaf 100644 --- a/src/ozones/Client/lib/cli/ozones_helper.rb +++ b/src/ozones/Client/lib/cli/ozones_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/ozones/Client/lib/cli/ozones_helper/vdc_helper.rb b/src/ozones/Client/lib/cli/ozones_helper/vdc_helper.rb index 808a099e3f..35bb6e687c 100644 --- a/src/ozones/Client/lib/cli/ozones_helper/vdc_helper.rb +++ b/src/ozones/Client/lib/cli/ozones_helper/vdc_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/ozones/Client/lib/zona.rb b/src/ozones/Client/lib/zona.rb index a7af045d60..4010b1898d 100644 --- a/src/ozones/Client/lib/zona.rb +++ b/src/ozones/Client/lib/zona.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -47,7 +47,7 @@ module Zona # Should match server's oZones version. OZONES_VERSION = < error_value; - + char str[26]; time_t the_time; @@ -175,18 +177,22 @@ int PoolObjectSQL::replace_template(const string& tmpl_str, string& error) error = "Cannot allocate a new template"; return -1; } - + if ( new_tmpl->parse_str_or_xml(tmpl_str, error) != 0 ) { + delete new_tmpl; return -1; } - delete obj_template; + if ( obj_template != 0 ) + { + delete obj_template; + } obj_template = new_tmpl; return 0; -} +} /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -256,6 +262,13 @@ void PoolObjectSQL::get_permissions(PoolObjectAuth& auth) auth.other_u = other_u; auth.other_m = other_m; auth.other_a = other_a; + + Clusterable* cl = dynamic_cast(this); + + if(cl != 0) + { + auth.cid = cl->get_cluster_id(); + } } /* -------------------------------------------------------------------------- */ @@ -301,3 +314,41 @@ error_value: /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ + +void PoolObjectSQL::set_umask(int umask) +{ + int perms; + bool enable_other; + + Nebula::instance().get_configuration_attribute( + "ENABLE_OTHER_PERMISSIONS", enable_other); + + if (uid == 0 || gid == 0) + { + perms = 0777; + } + else if (enable_other) + { + perms = 0666; + } + else + { + perms = 0660; + } + + perms = perms & ~umask; + + owner_u = ( (perms & 0400) != 0 ) ? 1 : 0; + owner_m = ( (perms & 0200) != 0 ) ? 1 : 0; + owner_a = ( (perms & 0100) != 0 ) ? 1 : 0; + group_u = ( (perms & 0040) != 0 ) ? 1 : 0; + group_m = ( (perms & 0020) != 0 ) ? 1 : 0; + group_a = ( (perms & 0010) != 0 ) ? 1 : 0; + other_u = ( (perms & 0004) != 0 ) ? 1 : 0; + other_m = ( (perms & 0002) != 0 ) ? 1 : 0; + other_a = ( (perms & 0001) != 0 ) ? 1 : 0; + +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ diff --git a/src/pool/PoolSQL.cc b/src/pool/PoolSQL.cc index 6a31a2992d..d641d88dfc 100644 --- a/src/pool/PoolSQL.cc +++ b/src/pool/PoolSQL.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -593,6 +593,7 @@ void PoolSQL::acl_filter(int uid, vector oids; vector gids; + vector cids; aclm->reverse_search(uid, gid, @@ -600,7 +601,8 @@ void PoolSQL::acl_filter(int uid, AuthRequest::USE, all, oids, - gids); + gids, + cids); for ( it = oids.begin(); it < oids.end(); it++ ) { @@ -612,6 +614,11 @@ void PoolSQL::acl_filter(int uid, acl_filter << " OR gid = " << *it; } + for ( it = cids.begin(); it < cids.end(); it++ ) + { + acl_filter << " OR cid = " << *it; + } + filter = acl_filter.str(); } diff --git a/src/pool/SConstruct b/src/pool/SConstruct index 1a899f3038..fb1e0c03c9 100644 --- a/src/pool/SConstruct +++ b/src/pool/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/pool # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/pool/test/SConstruct b/src/pool/test/SConstruct index e993a160c9..029786cb2d 100644 --- a/src/pool/test/SConstruct +++ b/src/pool/test/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 diff --git a/src/pool/test/TestPoolSQL.cc b/src/pool/test/TestPoolSQL.cc index b27fa2d322..5cc4af2dac 100644 --- a/src/pool/test/TestPoolSQL.cc +++ b/src/pool/test/TestPoolSQL.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/pool/test/TestPoolSQL.h b/src/pool/test/TestPoolSQL.h index 8b53e41e74..553683f334 100644 --- a/src/pool/test/TestPoolSQL.h +++ b/src/pool/test/TestPoolSQL.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/pool/test/pool.cc b/src/pool/test/pool.cc index 742ab03bda..7ba8457bd3 100644 --- a/src/pool/test/pool.cc +++ b/src/pool/test/pool.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/Request.cc b/src/rm/Request.cc index 21c3624c65..cb423626e8 100644 --- a/src/rm/Request.cc +++ b/src/rm/Request.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManager.cc b/src/rm/RequestManager.cc index 004c3e2d82..d698e67197 100644 --- a/src/rm/RequestManager.cc +++ b/src/rm/RequestManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -46,9 +46,9 @@ #include #include #include -#include +#include #include - + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -64,41 +64,41 @@ extern "C" void * rm_action_loop(void *arg) NebulaLog::log("ReM",Log::INFO,"Request Manager started."); rm = static_cast(arg); - + rm->am.loop(0,0); NebulaLog::log("ReM",Log::INFO,"Request Manager stopped."); - + return 0; } /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ - + extern "C" void * rm_xml_server_loop(void *arg) { RequestManager * rm; - + if ( arg == 0 ) { return 0; } rm = static_cast(arg); - + // Set cancel state for the thread - + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,0); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,0); - + //Start the server - + rm->AbyssServer = new xmlrpc_c::serverAbyss(xmlrpc_c::serverAbyss::constrOpt() .registryP(&rm->RequestManagerRegistry) .logFileName(rm->xml_log_file) .socketFd(rm->socket_fd)); - + rm->AbyssServer->run(); return 0; @@ -112,20 +112,20 @@ int RequestManager::setup_socket() int rc; int yes = 1; struct sockaddr_in rm_addr; - + socket_fd = socket(AF_INET, SOCK_STREAM, 0); - + if ( socket_fd == -1 ) { ostringstream oss; oss << "Cannot open server socket: " << strerror(errno); NebulaLog::log("ReM",Log::ERROR,oss); - - return -1; + + return -1; } - - rc = setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)); + + rc = setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)); if ( rc == -1 ) { @@ -133,29 +133,29 @@ int RequestManager::setup_socket() oss << "Cannot set socket options: " << strerror(errno); NebulaLog::log("ReM",Log::ERROR,oss); - + close(socket_fd); - - return -1; + + return -1; } - + fcntl(socket_fd,F_SETFD,FD_CLOEXEC); // Close socket in MADs - + rm_addr.sin_family = AF_INET; rm_addr.sin_port = htons(port); rm_addr.sin_addr.s_addr = INADDR_ANY; rc = bind(socket_fd,(struct sockaddr *) &(rm_addr),sizeof(struct sockaddr)); - if ( rc == -1) + if ( rc == -1) { ostringstream oss; oss << "Cannot bind to port " << port << " : " << strerror(errno); NebulaLog::log("ReM",Log::ERROR,oss); - + close(socket_fd); - + return -1; } @@ -169,29 +169,29 @@ int RequestManager::start() { pthread_attr_t pattr; ostringstream oss; - + NebulaLog::log("ReM",Log::INFO,"Starting Request Manager..."); - + int rc = setup_socket(); - + if ( rc != 0 ) { return -1; } - + register_xml_methods(); - + pthread_attr_init (&pattr); pthread_attr_setdetachstate (&pattr, PTHREAD_CREATE_JOINABLE); - + pthread_create(&rm_thread,&pattr,rm_action_loop,(void *)this); - + pthread_attr_init (&pattr); pthread_attr_setdetachstate (&pattr, PTHREAD_CREATE_JOINABLE); - + oss << "Starting XML-RPC server, port " << port << " ..."; NebulaLog::log("ReM",Log::INFO,oss); - + pthread_create(&rm_xml_server_thread,&pattr,rm_xml_server_loop,(void *)this); return 0; @@ -199,7 +199,7 @@ int RequestManager::start() /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ - + void RequestManager::do_action( const string & action, void * arg) @@ -207,15 +207,15 @@ void RequestManager::do_action( if (action == ACTION_FINALIZE) { NebulaLog::log("ReM",Log::INFO,"Stopping Request Manager..."); - - pthread_cancel(rm_xml_server_thread); + + pthread_cancel(rm_xml_server_thread); pthread_join(rm_xml_server_thread,0); NebulaLog::log("ReM",Log::INFO,"XML-RPC server stopped."); delete AbyssServer; - + if ( socket_fd != -1 ) { close(socket_fd); @@ -225,14 +225,14 @@ void RequestManager::do_action( { ostringstream oss; oss << "Unknown action name: " << action; - + NebulaLog::log("ReM", Log::ERROR, oss); - } + } }; /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ - + void RequestManager::register_xml_methods() { // User Methods @@ -249,7 +249,7 @@ void RequestManager::register_xml_methods() // VirtualMachine Methods xmlrpc_c::methodPtr vm_deploy(new VirtualMachineDeploy()); xmlrpc_c::methodPtr vm_migrate(new VirtualMachineMigrate()); - xmlrpc_c::methodPtr vm_action(new VirtualMachineAction()); + xmlrpc_c::methodPtr vm_action(new VirtualMachineAction()); xmlrpc_c::methodPtr vm_savedisk(new VirtualMachineSaveDisk()); xmlrpc_c::methodPtr vm_monitoring(new VirtualMachineMonitoring()); xmlrpc_c::methodPtr vm_attach(new VirtualMachineAttach()); @@ -265,6 +265,7 @@ void RequestManager::register_xml_methods() // Update Template Methods xmlrpc_c::methodPtr image_update(new ImageUpdateTemplate()); + xmlrpc_c::methodPtr vm_update(new VirtualMachineUpdateTemplate()); xmlrpc_c::methodPtr template_update(new TemplateUpdateTemplate()); xmlrpc_c::methodPtr host_update(new HostUpdateTemplate()); xmlrpc_c::methodPtr vn_update(new VirtualNetworkUpdateTemplate()); @@ -312,7 +313,7 @@ void RequestManager::register_xml_methods() xmlrpc_c::methodPtr cluster_info(new ClusterInfo()); xmlrpc_c::methodPtr doc_info(new DocumentInfo()); - // PoolInfo Methods + // PoolInfo Methods xmlrpc_c::methodPtr hostpool_info(new HostPoolInfo()); xmlrpc_c::methodPtr grouppool_info(new GroupPoolInfo()); xmlrpc_c::methodPtr userpool_info(new UserPoolInfo()); @@ -382,7 +383,7 @@ void RequestManager::register_xml_methods() xmlrpc_c::methodPtr image_rename(new ImageRename()); xmlrpc_c::methodPtr doc_rename(new DocumentRename()); - /* VM related methods */ + /* VM related methods */ RequestManagerRegistry.addMethod("one.vm.deploy", vm_deploy); RequestManagerRegistry.addMethod("one.vm.action", vm_action); RequestManagerRegistry.addMethod("one.vm.migrate", vm_migrate); @@ -395,6 +396,7 @@ void RequestManager::register_xml_methods() RequestManagerRegistry.addMethod("one.vm.attach", vm_attach); RequestManagerRegistry.addMethod("one.vm.detach", vm_detach); RequestManagerRegistry.addMethod("one.vm.rename", vm_rename); + RequestManagerRegistry.addMethod("one.vm.update", vm_update); RequestManagerRegistry.addMethod("one.vmpool.info", vm_pool_info); RequestManagerRegistry.addMethod("one.vmpool.accounting", vm_pool_acct); @@ -416,12 +418,12 @@ void RequestManager::register_xml_methods() /* Host related methods*/ RequestManagerRegistry.addMethod("one.host.enable", host_enable); RequestManagerRegistry.addMethod("one.host.update", host_update); - RequestManagerRegistry.addMethod("one.host.allocate", host_allocate); + RequestManagerRegistry.addMethod("one.host.allocate", host_allocate); RequestManagerRegistry.addMethod("one.host.delete", host_delete); RequestManagerRegistry.addMethod("one.host.info", host_info); RequestManagerRegistry.addMethod("one.host.monitoring", host_monitoring); - RequestManagerRegistry.addMethod("one.hostpool.info", hostpool_info); + RequestManagerRegistry.addMethod("one.hostpool.info", hostpool_info); RequestManagerRegistry.addMethod("one.hostpool.monitoring", host_pool_monitoring); /* Group related methods */ @@ -443,13 +445,13 @@ void RequestManager::register_xml_methods() RequestManagerRegistry.addMethod("one.vn.allocate", vn_allocate); RequestManagerRegistry.addMethod("one.vn.update", vn_update); RequestManagerRegistry.addMethod("one.vn.delete", vn_delete); - RequestManagerRegistry.addMethod("one.vn.info", vn_info); + RequestManagerRegistry.addMethod("one.vn.info", vn_info); RequestManagerRegistry.addMethod("one.vn.chown", vn_chown); RequestManagerRegistry.addMethod("one.vn.chmod", vn_chmod); RequestManagerRegistry.addMethod("one.vn.rename", vn_rename); - RequestManagerRegistry.addMethod("one.vnpool.info", vnpool_info); - + RequestManagerRegistry.addMethod("one.vnpool.info", vnpool_info); + /* User related methods*/ RequestManagerRegistry.addMethod("one.user.allocate", user_allocate); RequestManagerRegistry.addMethod("one.user.update", user_update); @@ -464,11 +466,11 @@ void RequestManager::register_xml_methods() RequestManagerRegistry.addMethod("one.userquota.info", user_get_default_quota); RequestManagerRegistry.addMethod("one.userquota.update", user_set_default_quota); - + /* Image related methods*/ RequestManagerRegistry.addMethod("one.image.persistent", image_persistent); RequestManagerRegistry.addMethod("one.image.enable", image_enable); - RequestManagerRegistry.addMethod("one.image.update", image_update); + RequestManagerRegistry.addMethod("one.image.update", image_update); RequestManagerRegistry.addMethod("one.image.allocate", image_allocate); RequestManagerRegistry.addMethod("one.image.delete", image_delete); RequestManagerRegistry.addMethod("one.image.info", image_info); @@ -529,4 +531,4 @@ void RequestManager::register_xml_methods() /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ - + diff --git a/src/rm/RequestManagerAcl.cc b/src/rm/RequestManagerAcl.cc index b100cf989a..2560f532d1 100644 --- a/src/rm/RequestManagerAcl.cc +++ b/src/rm/RequestManagerAcl.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerAllocate.cc b/src/rm/RequestManagerAllocate.cc index b5e2ce4878..726d18ea31 100644 --- a/src/rm/RequestManagerAllocate.cc +++ b/src/rm/RequestManagerAllocate.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -131,13 +131,31 @@ void RequestManagerAllocate::request_execute(xmlrpc_c::paramList const& params, Template * tmpl = 0; string error_str; - int rc, id; + int rc, id, umask; Cluster * cluster = 0; int cluster_id = ClusterPool::NONE_CLUSTER_ID; string cluster_name = ClusterPool::NONE_CLUSTER_NAME; PoolObjectAuth cluster_perms; + User * user; + UserPool * upool = Nebula::instance().get_upool(); + + user = upool->get(att.uid, true); + + if ( user == 0 ) + { + failure_response(NO_EXISTS, + get_error(object_name(PoolObjectSQL::USER), att.uid), + att); + + return; + } + + umask = user->get_umask(); + + user->unlock(); + if ( do_template == true ) { string str_tmpl = xmlrpc_c::value_string(params.getString(1)); @@ -179,7 +197,7 @@ void RequestManagerAllocate::request_execute(xmlrpc_c::paramList const& params, return; } - rc = pool_allocate(params, tmpl, id, error_str, att, cluster_id, cluster_name); + rc = pool_allocate(params, tmpl, id, error_str, att, cluster_id, cluster_name, umask); if ( rc < 0 ) { @@ -189,6 +207,8 @@ void RequestManagerAllocate::request_execute(xmlrpc_c::paramList const& params, if ( cluster_id != ClusterPool::NONE_CLUSTER_ID ) { + Datastore::DatastoreType ds_type = get_ds_type(id); + cluster = clpool->get(cluster_id, true); if ( cluster == 0 ) @@ -200,7 +220,7 @@ void RequestManagerAllocate::request_execute(xmlrpc_c::paramList const& params, return; } - rc = add_to_cluster(cluster, id, error_str); + rc = add_to_cluster(cluster, id, ds_type, error_str); if ( rc < 0 ) { @@ -232,11 +252,13 @@ void RequestManagerAllocate::request_execute(xmlrpc_c::paramList const& params, /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -int VirtualMachineAllocate::pool_allocate(xmlrpc_c::paramList const& paramList, - Template * tmpl, - int& id, - string& error_str, - RequestAttributes& att) +int VirtualMachineAllocate::pool_allocate( + xmlrpc_c::paramList const& paramList, + Template * tmpl, + int& id, + string& error_str, + RequestAttributes& att, + int umask) { bool on_hold = false; @@ -250,8 +272,8 @@ int VirtualMachineAllocate::pool_allocate(xmlrpc_c::paramList const& paramList, Template tmpl_back(*tmpl); - int rc = vmpool->allocate(att.uid, att.gid, att.uname, att.gname, ttmpl, &id, - error_str, on_hold); + int rc = vmpool->allocate(att.uid, att.gid, att.uname, att.gname, umask, + ttmpl, &id, error_str, on_hold); if ( rc < 0 ) { @@ -272,13 +294,14 @@ int VirtualNetworkAllocate::pool_allocate( string& error_str, RequestAttributes& att, int cluster_id, - const string& cluster_name) + const string& cluster_name, + int umask) { VirtualNetworkPool * vpool = static_cast(pool); VirtualNetworkTemplate * vtmpl=static_cast(tmpl); - return vpool->allocate(att.uid, att.gid, att.uname, att.gname, vtmpl, &id, - cluster_id, cluster_name, error_str); + return vpool->allocate(att.uid, att.gid, att.uname, att.gname, umask, + vtmpl, &id, cluster_id, cluster_name, error_str); } /* -------------------------------------------------------------------------- */ @@ -307,18 +330,41 @@ void ImageAllocate::request_execute(xmlrpc_c::paramList const& params, Nebula& nd = Nebula::instance(); + UserPool * upool = nd.get_upool(); DatastorePool * dspool = nd.get_dspool(); ImagePool * ipool = static_cast(pool); ImageManager * imagem = nd.get_imagem(); - ImageTemplate * tmpl = new ImageTemplate; + ImageTemplate * tmpl; Template img_usage; + User * user; Datastore * ds; Image::DiskType ds_disk_type; + int umask; + + // ------------------------- Get user's umask ------------------------------ + + user = upool->get(att.uid, true); + + if ( user == 0 ) + { + failure_response(NO_EXISTS, + get_error(object_name(PoolObjectSQL::USER), att.uid), + att); + + return; + } + + umask = user->get_umask(); + + user->unlock(); + // ------------------------- Parse image template -------------------------- + tmpl = new ImageTemplate; + rc = tmpl->parse_str_or_xml(str_tmpl, error_str); if ( rc != 0 ) @@ -454,6 +500,7 @@ void ImageAllocate::request_execute(xmlrpc_c::paramList const& params, att.gid, att.uname, att.gname, + umask, tmpl, ds_id, ds_name, @@ -488,18 +535,20 @@ void ImageAllocate::request_execute(xmlrpc_c::paramList const& params, /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -int TemplateAllocate::pool_allocate(xmlrpc_c::paramList const& _paramList, - Template * tmpl, - int& id, - string& error_str, - RequestAttributes& att) +int TemplateAllocate::pool_allocate( + xmlrpc_c::paramList const& paramList, + Template * tmpl, + int& id, + string& error_str, + RequestAttributes& att, + int umask) { VMTemplatePool * tpool = static_cast(pool); VirtualMachineTemplate * ttmpl=static_cast(tmpl); - return tpool->allocate(att.uid, att.gid, att.uname, att.gname, ttmpl, &id, - error_str); + return tpool->allocate(att.uid, att.gid, att.uname, att.gname, umask, ttmpl, + &id, error_str); } /* -------------------------------------------------------------------------- */ @@ -512,7 +561,8 @@ int HostAllocate::pool_allocate( string& error_str, RequestAttributes& att, int cluster_id, - const string& cluster_name) + const string& cluster_name, + int umask) { string host = xmlrpc_c::value_string(paramList.getString(1)); string im_mad = xmlrpc_c::value_string(paramList.getString(2)); @@ -529,11 +579,13 @@ int HostAllocate::pool_allocate( /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -int UserAllocate::pool_allocate(xmlrpc_c::paramList const& paramList, - Template * tmpl, - int& id, - string& error_str, - RequestAttributes& att) +int UserAllocate::pool_allocate( + xmlrpc_c::paramList const& paramList, + Template * tmpl, + int& id, + string& error_str, + RequestAttributes& att, + int umask) { string uname = xmlrpc_c::value_string(paramList.getString(1)); string passwd = xmlrpc_c::value_string(paramList.getString(2)); @@ -578,11 +630,13 @@ void UserAllocate::log_xmlrpc_param( /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -int GroupAllocate::pool_allocate(xmlrpc_c::paramList const& paramList, - Template * tmpl, - int& id, - string& error_str, - RequestAttributes& att) +int GroupAllocate::pool_allocate( + xmlrpc_c::paramList const& paramList, + Template * tmpl, + int& id, + string& error_str, + RequestAttributes& att, + int umask) { string gname = xmlrpc_c::value_string(paramList.getString(1)); @@ -601,24 +655,27 @@ int DatastoreAllocate::pool_allocate( string& error_str, RequestAttributes& att, int cluster_id, - const string& cluster_name) + const string& cluster_name, + int umask) { DatastorePool * dspool = static_cast(pool); DatastoreTemplate * ds_tmpl = static_cast(tmpl); - return dspool->allocate(att.uid, att.gid, att.uname, att.gname, + return dspool->allocate(att.uid, att.gid, att.uname, att.gname, umask, ds_tmpl, &id, cluster_id, cluster_name, error_str); } /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -int ClusterAllocate::pool_allocate(xmlrpc_c::paramList const& paramList, - Template * tmpl, - int& id, - string& error_str, - RequestAttributes& att) +int ClusterAllocate::pool_allocate( + xmlrpc_c::paramList const& paramList, + Template * tmpl, + int& id, + string& error_str, + RequestAttributes& att, + int umask) { string name = xmlrpc_c::value_string(paramList.getString(1)); @@ -630,16 +687,18 @@ int ClusterAllocate::pool_allocate(xmlrpc_c::paramList const& paramList, /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -int DocumentAllocate::pool_allocate(xmlrpc_c::paramList const& paramList, - Template * tmpl, - int& id, - string& error_str, - RequestAttributes& att) +int DocumentAllocate::pool_allocate( + xmlrpc_c::paramList const& paramList, + Template * tmpl, + int& id, + string& error_str, + RequestAttributes& att, + int umask) { int type = xmlrpc_c::value_int(paramList.getInt(2)); DocumentPool * docpool = static_cast(pool); - return docpool->allocate(att.uid, att.gid, att.uname, att.gname, type, - tmpl, &id, error_str); + return docpool->allocate(att.uid, att.gid, att.uname, att.gname, umask, + type, tmpl, &id, error_str); } diff --git a/src/rm/RequestManagerChmod.cc b/src/rm/RequestManagerChmod.cc index 105a7449bb..1e2c2de782 100644 --- a/src/rm/RequestManagerChmod.cc +++ b/src/rm/RequestManagerChmod.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -19,8 +19,6 @@ #include "NebulaLog.h" #include "Nebula.h" -#define TO_UPPER(S) transform(S.begin(),S.end(),S.begin(),(int(*)(int))toupper) - /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -95,14 +93,12 @@ void RequestManagerChmod::request_execute(xmlrpc_c::paramList const& paramList, if ( other_u != -1 || other_m != -1 || other_a != -1 ) { - string enable_other; + bool enable_other; Nebula::instance().get_configuration_attribute( "ENABLE_OTHER_PERMISSIONS", enable_other); - TO_UPPER(enable_other); - - if ( enable_other != "YES" ) + if ( !enable_other ) { failure_response(AUTHORIZATION, "Management of 'other' permissions is disabled in oned.conf", @@ -130,13 +126,13 @@ void RequestManagerChmod::request_execute(xmlrpc_c::paramList const& paramList, object = pool->get(oid,true); - if ( object == 0 ) - { + if ( object == 0 ) + { failure_response(NO_EXISTS, get_error(object_name(auth_object),oid), att); return; - } + } int rc = object->set_permissions(owner_u, owner_m, owner_a, group_u, group_m, group_a, other_u, other_m, other_a, error_str); diff --git a/src/rm/RequestManagerChown.cc b/src/rm/RequestManagerChown.cc index a7b0afa6a5..a542c231dd 100644 --- a/src/rm/RequestManagerChown.cc +++ b/src/rm/RequestManagerChown.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerClone.cc b/src/rm/RequestManagerClone.cc index 12eeebabcb..02619348fb 100644 --- a/src/rm/RequestManagerClone.cc +++ b/src/rm/RequestManagerClone.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -28,15 +28,33 @@ void RequestManagerClone::request_execute( int source_id = xmlrpc_c::value_int(paramList.getInt(1)); string name = xmlrpc_c::value_string(paramList.getString(2)); - int rc, new_id; + int rc, new_id, umask; PoolObjectAuth perms; Template * tmpl; PoolObjectSQL * source_obj; + User * user; + + UserPool * upool = Nebula::instance().get_upool(); string error_str; + user = upool->get(att.uid, true); + + if ( user == 0 ) + { + failure_response(NO_EXISTS, + get_error(object_name(PoolObjectSQL::USER), att.uid), + att); + + return; + } + + umask = user->get_umask(); + + user->unlock(); + source_obj = pool->get(source_id, true); if ( source_obj == 0 ) @@ -80,7 +98,7 @@ void RequestManagerClone::request_execute( } } - rc = pool_allocate(source_id, tmpl, new_id, error_str, att); + rc = pool_allocate(source_id, tmpl, new_id, error_str, att, umask); if ( rc < 0 ) { diff --git a/src/rm/RequestManagerCluster.cc b/src/rm/RequestManagerCluster.cc index 73bcd3da75..876b286915 100644 --- a/src/rm/RequestManagerCluster.cc +++ b/src/rm/RequestManagerCluster.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -45,6 +45,8 @@ void RequestManagerCluster::add_generic( int old_cluster_id; string old_cluster_name; + Datastore::DatastoreType ds_type; + if ( cluster_id != ClusterPool::NONE_CLUSTER_ID ) { rc = get_info(clpool, cluster_id, PoolObjectSQL::CLUSTER, att, c_perms, cluster_name); @@ -102,6 +104,8 @@ void RequestManagerCluster::add_generic( old_cluster_id = cluster_obj->get_cluster_id(); old_cluster_name = cluster_obj->get_cluster_name(); + ds_type = get_ds_type(object); + if ( old_cluster_id == cluster_id ) { object->unlock(); @@ -141,7 +145,7 @@ void RequestManagerCluster::add_generic( return; } - if ( add_object(cluster, object_id, err_msg) < 0 ) + if ( add_object(cluster, object_id, ds_type, err_msg) < 0 ) { cluster->unlock(); @@ -149,6 +153,18 @@ void RequestManagerCluster::add_generic( request_error("Cannot add object to cluster", err_msg), att); + // Rollback + get(object_id, true, &object, &cluster_obj); + + if ( object != 0 ) + { + cluster_obj->set_cluster(old_cluster_id, old_cluster_name); + + pool->update(object); + + object->unlock(); + } + return; } diff --git a/src/rm/RequestManagerDelete.cc b/src/rm/RequestManagerDelete.cc index 7ba88bae47..d0295a9d38 100644 --- a/src/rm/RequestManagerDelete.cc +++ b/src/rm/RequestManagerDelete.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -210,6 +210,21 @@ int GroupDelete::drop(int oid, PoolObjectSQL * object, string& error_msg) /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ +int ClusterDelete::drop(int oid, PoolObjectSQL * object, string& error_msg) +{ + int rc = RequestManagerDelete::drop(oid, object, error_msg); + + if ( rc == 0 ) + { + aclm->del_cid_rules(oid); + } + + return rc; +} + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + int UserDelete::drop(int oid, PoolObjectSQL * object, string& error_msg) { User * user = static_cast(object); diff --git a/src/rm/RequestManagerGroup.cc b/src/rm/RequestManagerGroup.cc index 84c62612ea..ee50c5a27b 100644 --- a/src/rm/RequestManagerGroup.cc +++ b/src/rm/RequestManagerGroup.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerHost.cc b/src/rm/RequestManagerHost.cc index e59a6b3dcf..6c4d6576f4 100644 --- a/src/rm/RequestManagerHost.cc +++ b/src/rm/RequestManagerHost.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerImage.cc b/src/rm/RequestManagerImage.cc index 6b0722c0c1..86bb1db118 100644 --- a/src/rm/RequestManagerImage.cc +++ b/src/rm/RequestManagerImage.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -229,7 +229,7 @@ void ImageClone::request_execute( int clone_id = xmlrpc_c::value_int(paramList.getInt(1)); string name = xmlrpc_c::value_string(paramList.getString(2)); - int rc, new_id, ds_id, size; + int rc, new_id, ds_id, size, umask; string error_str, ds_name, ds_data; Image::DiskType disk_type; @@ -239,11 +239,30 @@ void ImageClone::request_execute( Template img_usage; Image * img; Datastore * ds; + User * user; Nebula& nd = Nebula::instance(); DatastorePool * dspool = nd.get_dspool(); ImagePool * ipool = static_cast(pool); + UserPool * upool = nd.get_upool(); + + // ------------------------- Get user's umask ------------------------------ + + user = upool->get(att.uid, true); + + if ( user == 0 ) + { + failure_response(NO_EXISTS, + get_error(object_name(PoolObjectSQL::USER), att.uid), + att); + + return; + } + + umask = user->get_umask(); + + user->unlock(); // ------------------------- Get source Image info ------------------------- @@ -360,6 +379,7 @@ void ImageClone::request_execute( att.gid, att.uname, att.gname, + umask, tmpl, ds_id, ds_name, diff --git a/src/rm/RequestManagerInfo.cc b/src/rm/RequestManagerInfo.cc index 4051cb5ee1..047f5d0a35 100644 --- a/src/rm/RequestManagerInfo.cc +++ b/src/rm/RequestManagerInfo.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerPoolInfoFilter.cc b/src/rm/RequestManagerPoolInfoFilter.cc index 0251c6200c..9ad3e0cc6c 100644 --- a/src/rm/RequestManagerPoolInfoFilter.cc +++ b/src/rm/RequestManagerPoolInfoFilter.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerRename.cc b/src/rm/RequestManagerRename.cc index ff9dabab62..bd6b43c6d5 100644 --- a/src/rm/RequestManagerRename.cc +++ b/src/rm/RequestManagerRename.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerSystem.cc b/src/rm/RequestManagerSystem.cc index f020f4e84a..0c0db004c7 100644 --- a/src/rm/RequestManagerSystem.cc +++ b/src/rm/RequestManagerSystem.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerUpdateTemplate.cc b/src/rm/RequestManagerUpdateTemplate.cc index 1c8988ccbb..b3d7523d88 100644 --- a/src/rm/RequestManagerUpdateTemplate.cc +++ b/src/rm/RequestManagerUpdateTemplate.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerUser.cc b/src/rm/RequestManagerUser.cc index 9e9da50eaa..464f3415ec 100644 --- a/src/rm/RequestManagerUser.cc +++ b/src/rm/RequestManagerUser.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/RequestManagerVMTemplate.cc b/src/rm/RequestManagerVMTemplate.cc index d4af5ef766..1d316ffa51 100644 --- a/src/rm/RequestManagerVMTemplate.cc +++ b/src/rm/RequestManagerVMTemplate.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -26,27 +26,58 @@ void VMTemplateInstantiate::request_execute(xmlrpc_c::paramList const& paramList { int id = xmlrpc_c::value_int(paramList.getInt(1)); string name = xmlrpc_c::value_string(paramList.getString(2)); + bool on_hold = false; //Optional XML-RPC argument - bool on_hold = false; + int rc; + int vid; + int umask; + + ostringstream sid; + + PoolObjectAuth perms; + + Nebula& nd = Nebula::instance(); + + VirtualMachinePool* vmpool = nd.get_vmpool(); + VMTemplatePool * tpool = static_cast(pool); + UserPool * upool = nd.get_upool(); + + VirtualMachineTemplate * tmpl; + VMTemplate * rtmpl; + User * user; + + string error_str; + string aname; + + string tmpl_name; if ( paramList.size() > 3 ) { on_hold = xmlrpc_c::value_boolean(paramList.getBoolean(3)); } - int rc, vid; + /* ---------------------------------------------------------------------- */ + /* Get user's umask */ + /* ---------------------------------------------------------------------- */ - PoolObjectAuth perms; + user = upool->get(att.uid, true); - Nebula& nd = Nebula::instance(); - VirtualMachinePool* vmpool = nd.get_vmpool(); - VMTemplatePool * tpool = static_cast(pool); + if ( user == 0 ) + { + failure_response(NO_EXISTS, + get_error(object_name(PoolObjectSQL::USER), att.uid), + att); - VirtualMachineTemplate * tmpl; - VMTemplate * rtmpl; + return; + } - string error_str; - string aname; + umask = user->get_umask(); + + user->unlock(); + + /* ---------------------------------------------------------------------- */ + /* Get, check and clone the template */ + /* ---------------------------------------------------------------------- */ rtmpl = tpool->get(id,true); @@ -59,14 +90,14 @@ void VMTemplateInstantiate::request_execute(xmlrpc_c::paramList const& paramList return; } - tmpl = rtmpl->clone_template(); + tmpl_name = rtmpl->get_name(); + tmpl = rtmpl->clone_template(); rtmpl->get_permissions(perms); rtmpl->unlock(); - // Check template for restricted attributes, but only if the Template owner - // is not oneadmin + // Check template for restricted attributes, only if owner is not oneadmin if ( perms.uid != UserPool::ONEADMIN_ID && perms.gid != GroupPool::ONEADMIN_ID ) { @@ -85,8 +116,22 @@ void VMTemplateInstantiate::request_execute(xmlrpc_c::paramList const& paramList } } + /* ---------------------------------------------------------------------- */ + /* Store the template attributes in the VM */ + /* ---------------------------------------------------------------------- */ tmpl->erase("NAME"); - tmpl->set(new SingleAttribute("NAME",name)); + tmpl->erase("TEMPLATE_NAME"); + tmpl->erase("TEMPLATE_ID"); + + sid << id; + + tmpl->set(new SingleAttribute("TEMPLATE_NAME", tmpl_name)); + tmpl->set(new SingleAttribute("TEMPLATE_ID", sid.str())); + + if (!name.empty()) + { + tmpl->set(new SingleAttribute("NAME",name)); + } if ( att.uid != 0 ) { @@ -115,8 +160,8 @@ void VMTemplateInstantiate::request_execute(xmlrpc_c::paramList const& paramList Template tmpl_back(*tmpl); - rc = vmpool->allocate(att.uid, att.gid, att.uname, att.gname, tmpl, &vid, - error_str, on_hold); + rc = vmpool->allocate(att.uid, att.gid, att.uname, att.gname, umask, + tmpl, &vid, error_str, on_hold); if ( rc < 0 ) { @@ -125,10 +170,10 @@ void VMTemplateInstantiate::request_execute(xmlrpc_c::paramList const& paramList att); quota_rollback(&tmpl_back, Quotas::VIRTUALMACHINE, att); - + return; } - + success_response(vid, att); } diff --git a/src/rm/RequestManagerVirtualMachine.cc b/src/rm/RequestManagerVirtualMachine.cc index 644dfce4cd..b8baaff07f 100644 --- a/src/rm/RequestManagerVirtualMachine.cc +++ b/src/rm/RequestManagerVirtualMachine.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -427,17 +427,17 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList, string ds_location; int ds_id; - int id = xmlrpc_c::value_int(paramList.getInt(1)); - int hid = xmlrpc_c::value_int(paramList.getInt(2)); - bool enforce = false; + int id = xmlrpc_c::value_int(paramList.getInt(1)); + int hid = xmlrpc_c::value_int(paramList.getInt(2)); + bool enforce = false; - if ( paramList.size() != 3 ) + bool auth = false; + + if ( paramList.size() > 3 ) { enforce = xmlrpc_c::value_boolean(paramList.getBoolean(3)); } - bool auth = false; - if (get_host_information(hid, hostname, vmm_mad, @@ -544,7 +544,7 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList bool live = xmlrpc_c::value_boolean(paramList.getBoolean(3)); bool enforce = false; - if ( paramList.size() != 4 ) + if ( paramList.size() > 4 ) { enforce = xmlrpc_c::value_boolean(paramList.getBoolean(4)); } @@ -681,8 +681,9 @@ void VirtualMachineSaveDisk::request_execute(xmlrpc_c::paramList const& paramLis { Nebula& nd = Nebula::instance(); - ImagePool * ipool = nd.get_ipool(); - DatastorePool * dspool = nd.get_dspool(); + ImagePool * ipool = nd.get_ipool(); + DatastorePool * dspool = nd.get_dspool(); + UserPool * upool = nd.get_upool(); int id = xmlrpc_c::value_int(paramList.getInt(1)); int disk_id = xmlrpc_c::value_int(paramList.getInt(2)); @@ -695,8 +696,10 @@ void VirtualMachineSaveDisk::request_execute(xmlrpc_c::paramList const& paramLis Image * img; Datastore * ds; + User * user; Image::DiskType ds_disk_type; + int umask; int rc; string error_str; @@ -730,6 +733,25 @@ void VirtualMachineSaveDisk::request_execute(xmlrpc_c::paramList const& paramLis return; } + // ------------------------------------------------------------------------- + // Get user's umask + // ------------------------------------------------------------------------- + + user = upool->get(att.uid, true); + + if ( user == 0 ) + { + failure_response(NO_EXISTS, + get_error(object_name(PoolObjectSQL::USER), att.uid), + att); + + return; + } + + umask = user->get_umask(); + + user->unlock(); + // ------------------------------------------------------------------------- // Get the data of the Image to be saved // ------------------------------------------------------------------------- @@ -859,6 +881,7 @@ void VirtualMachineSaveDisk::request_execute(xmlrpc_c::paramList const& paramLis att.gid, att.uname, att.gname, + umask, itemplate, ds_id, ds_name, diff --git a/src/rm/RequestManagerVirtualNetwork.cc b/src/rm/RequestManagerVirtualNetwork.cc index 33ce01e512..478cf2c6dd 100644 --- a/src/rm/RequestManagerVirtualNetwork.cc +++ b/src/rm/RequestManagerVirtualNetwork.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/rm/SConstruct b/src/rm/SConstruct index a4e9bea234..806111c126 100644 --- a/src/rm/SConstruct +++ b/src/rm/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/rm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/scheduler/SConstruct b/src/scheduler/SConstruct index 30eab8a30c..f8c70e8ba3 100644 --- a/src/scheduler/SConstruct +++ b/src/scheduler/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/scheduler/include/AclXML.h b/src/scheduler/include/AclXML.h index 5ad46040f7..809fb7816c 100644 --- a/src/scheduler/include/AclXML.h +++ b/src/scheduler/include/AclXML.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/include/Client.h b/src/scheduler/include/Client.h index 8b7516b69c..2a7ad2f632 100644 --- a/src/scheduler/include/Client.h +++ b/src/scheduler/include/Client.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/include/ClusterPoolXML.h b/src/scheduler/include/ClusterPoolXML.h new file mode 100644 index 0000000000..31915c0d78 --- /dev/null +++ b/src/scheduler/include/ClusterPoolXML.h @@ -0,0 +1,56 @@ +/* -------------------------------------------------------------------------- */ +/* 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 CLUSTER_POOL_XML_H_ +#define CLUSTER_POOL_XML_H_ + +#include "PoolXML.h" +#include "ClusterXML.h" + +using namespace std; + +class ClusterPoolXML : public PoolXML +{ +public: + + ClusterPoolXML(Client* client):PoolXML(client) + {}; + + /** + * Gets an object from the pool + * @param oid the object unique identifier + * + * @return a pointer to the object, 0 in case of failure + */ + ClusterXML * get(int oid) const + { + return static_cast(PoolXML::get(oid)); + }; + +protected: + + int get_suitable_nodes(vector& content) + { + return get_nodes("/CLUSTER_POOL/CLUSTER", content); + }; + + void add_object(xmlNodePtr node); + + int load_info(xmlrpc_c::value &result); +}; + +#endif /* CLUSTER_POOL_XML_H_ */ diff --git a/src/scheduler/include/ClusterXML.h b/src/scheduler/include/ClusterXML.h new file mode 100644 index 0000000000..01ef1604f0 --- /dev/null +++ b/src/scheduler/include/ClusterXML.h @@ -0,0 +1,52 @@ +/* -------------------------------------------------------------------------- */ +/* 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 CLUSTER_XML_H_ +#define CLUSTER_XML_H_ + +#include "ObjectXML.h" + +using namespace std; + +class ClusterXML : public ObjectXML +{ +public: + ClusterXML(const string &xml_doc):ObjectXML(xml_doc) + { + init_attributes(); + }; + + ClusterXML(const xmlNodePtr node):ObjectXML(node) + { + init_attributes(); + }; + + int get_oid() const + { + return oid; + }; + +private: + int oid; + + void init_attributes() + { + oid = atoi(((*this)["/CLUSTER/ID"] )[0].c_str() ); + }; +}; + +#endif /* CLUSTER_XML_H_ */ diff --git a/src/scheduler/include/HostPoolXML.h b/src/scheduler/include/HostPoolXML.h index 78c1c308d8..8a8fceaf3a 100644 --- a/src/scheduler/include/HostPoolXML.h +++ b/src/scheduler/include/HostPoolXML.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -20,6 +20,7 @@ #include "PoolXML.h" #include "HostXML.h" +#include "ClusterPoolXML.h" using namespace std; @@ -45,6 +46,14 @@ public: return static_cast(PoolXML::get(oid)); }; + /** + * For each Host in a cluster, adds the cluster template as a new + * Host xml element + * + * @param clpool Cluster pool + */ + void merge_clusters(ClusterPoolXML * clpool); + protected: int get_suitable_nodes(vector& content) diff --git a/src/scheduler/include/HostXML.h b/src/scheduler/include/HostXML.h index a9171ac146..9576d925f0 100644 --- a/src/scheduler/include/HostXML.h +++ b/src/scheduler/include/HostXML.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -40,6 +40,11 @@ public: return oid; }; + int get_cid() const + { + return cluster_id; + }; + /** * Tests whether a new VM can be hosted by the host or not * @param cpu needed by the VM (percentage) @@ -82,6 +87,7 @@ public: private: int oid; + int cluster_id; // Host share values int disk_usage; /**< Disk allocated to VMs (in Mb). */ diff --git a/src/scheduler/include/PoolXML.h b/src/scheduler/include/PoolXML.h index 7698b7d57e..a25c96212c 100644 --- a/src/scheduler/include/PoolXML.h +++ b/src/scheduler/include/PoolXML.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/include/RankPolicy.h b/src/scheduler/include/RankPolicy.h index a86c935111..ca2b2838ca 100644 --- a/src/scheduler/include/RankPolicy.h +++ b/src/scheduler/include/RankPolicy.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/include/Scheduler.h b/src/scheduler/include/Scheduler.h index 54add04616..a10ba27091 100644 --- a/src/scheduler/include/Scheduler.h +++ b/src/scheduler/include/Scheduler.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -19,6 +19,7 @@ #include "Log.h" #include "HostPoolXML.h" +#include "ClusterPoolXML.h" #include "VirtualMachinePoolXML.h" #include "SchedulerPolicy.h" #include "ActionManager.h" @@ -47,6 +48,7 @@ protected: Scheduler(): hpool(0), + clpool(0), vmpool(0), acls(0), timer(0), @@ -67,6 +69,11 @@ protected: delete hpool; } + if ( clpool != 0) + { + delete clpool; + } + if ( vmpool != 0) { delete vmpool; @@ -88,6 +95,7 @@ protected: // --------------------------------------------------------------- HostPoolXML * hpool; + ClusterPoolXML * clpool; VirtualMachinePoolXML * vmpool; AclXML * acls; diff --git a/src/scheduler/include/SchedulerPolicy.h b/src/scheduler/include/SchedulerPolicy.h index b62efb3149..a5c2d8c07f 100644 --- a/src/scheduler/include/SchedulerPolicy.h +++ b/src/scheduler/include/SchedulerPolicy.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/include/SchedulerTemplate.h b/src/scheduler/include/SchedulerTemplate.h index e20462fde4..354b0683da 100644 --- a/src/scheduler/include/SchedulerTemplate.h +++ b/src/scheduler/include/SchedulerTemplate.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/include/VirtualMachinePoolXML.h b/src/scheduler/include/VirtualMachinePoolXML.h index b2b97e169b..12c493c22b 100644 --- a/src/scheduler/include/VirtualMachinePoolXML.h +++ b/src/scheduler/include/VirtualMachinePoolXML.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/include/VirtualMachineXML.h b/src/scheduler/include/VirtualMachineXML.h index befb264083..4ab997e748 100644 --- a/src/scheduler/include/VirtualMachineXML.h +++ b/src/scheduler/include/VirtualMachineXML.h @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/src/client/Client.cc b/src/scheduler/src/client/Client.cc index 54cdf61f27..5e647d3e0c 100644 --- a/src/scheduler/src/client/Client.cc +++ b/src/scheduler/src/client/Client.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/src/client/SConstruct b/src/scheduler/src/client/SConstruct index 06339dedee..bd420479e5 100644 --- a/src/scheduler/src/client/SConstruct +++ b/src/scheduler/src/client/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/pool # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/scheduler/src/pool/AclXML.cc b/src/scheduler/src/pool/AclXML.cc index 66cc5ca273..44ea6d7530 100644 --- a/src/scheduler/src/pool/AclXML.cc +++ b/src/scheduler/src/pool/AclXML.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/src/pool/ClusterPoolXML.cc b/src/scheduler/src/pool/ClusterPoolXML.cc new file mode 100644 index 0000000000..aef376d4e2 --- /dev/null +++ b/src/scheduler/src/pool/ClusterPoolXML.cc @@ -0,0 +1,62 @@ +/* -------------------------------------------------------------------------- */ +/* 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 "ClusterPoolXML.h" + +void ClusterPoolXML::add_object(xmlNodePtr node) +{ + if ( node == 0 || node->children == 0 ) + { + NebulaLog::log("CLUSTER",Log::ERROR, + "XML Node does not represent a valid Cluster"); + + return; + } + + ClusterXML* cluster = new ClusterXML( node ); + + objects.insert( pair(cluster->get_oid(), cluster) ); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +int ClusterPoolXML::load_info(xmlrpc_c::value &result) +{ + try + { + client->call( client->get_endpoint(), // serverUrl + "one.clusterpool.info", // methodName + "s", // arguments format + &result, // resultP + client->get_oneauth().c_str() // argument + ); + return 0; + } + catch (exception const& e) + { + ostringstream oss; + oss << "Exception raised: " << e.what(); + + NebulaLog::log("CLUSTER", Log::ERROR, oss); + + return -1; + } +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + diff --git a/src/scheduler/src/pool/HostPoolXML.cc b/src/scheduler/src/pool/HostPoolXML.cc index 316cca5a2d..274edd625b 100644 --- a/src/scheduler/src/pool/HostPoolXML.cc +++ b/src/scheduler/src/pool/HostPoolXML.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -16,7 +16,6 @@ #include "HostPoolXML.h" - int HostPoolXML::set_up() { ostringstream oss; @@ -89,3 +88,42 @@ int HostPoolXML::load_info(xmlrpc_c::value &result) /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ +void HostPoolXML::merge_clusters(ClusterPoolXML * clpool) +{ + map::iterator it; + + ClusterXML* cluster; + HostXML* host; + + int cluster_id; + vector nodes; + + for (it=objects.begin(); it!=objects.end(); it++) + { + host = static_cast(it->second); + + cluster_id = host->get_cid(); + + if(cluster_id != -1) //ClusterPool::NONE_CLUSTER_ID + { + cluster = clpool->get(cluster_id); + + if(cluster != 0) + { + nodes.clear(); + + cluster->get_nodes("/CLUSTER/TEMPLATE", nodes); + + if (!nodes.empty()) + { + host->add_node("/HOST", nodes[0], "CLUSTER_TEMPLATE"); + } + + cluster->free_nodes(nodes); + } + } + } +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ diff --git a/src/scheduler/src/pool/HostXML.cc b/src/scheduler/src/pool/HostXML.cc index 6ed7a562f4..3e9cebd82e 100644 --- a/src/scheduler/src/pool/HostXML.cc +++ b/src/scheduler/src/pool/HostXML.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -26,6 +26,7 @@ float HostXML::hypervisor_mem; void HostXML::init_attributes() { oid = atoi(((*this)["/HOST/ID"] )[0].c_str() ); + cluster_id = atoi(((*this)["/HOST/CLUSTER_ID"] )[0].c_str() ); disk_usage = atoi(((*this)["/HOST/HOST_SHARE/DISK_USAGE"])[0].c_str()); mem_usage = atoi(((*this)["/HOST/HOST_SHARE/MEM_USAGE"])[0].c_str()); diff --git a/src/scheduler/src/pool/SConstruct b/src/scheduler/src/pool/SConstruct index b8ade4e4f6..687bafdcd6 100644 --- a/src/scheduler/src/pool/SConstruct +++ b/src/scheduler/src/pool/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/pool # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -25,7 +25,8 @@ source_files=[ 'HostPoolXML.cc', 'HostXML.cc', 'VirtualMachinePoolXML.cc', - 'VirtualMachineXML.cc'] + 'VirtualMachineXML.cc', + 'ClusterPoolXML.cc'] # Build library sched_env.StaticLibrary(lib_name, source_files) diff --git a/src/scheduler/src/pool/VirtualMachinePoolXML.cc b/src/scheduler/src/pool/VirtualMachinePoolXML.cc index 244d6afd57..01ccef677f 100644 --- a/src/scheduler/src/pool/VirtualMachinePoolXML.cc +++ b/src/scheduler/src/pool/VirtualMachinePoolXML.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/src/pool/VirtualMachineXML.cc b/src/scheduler/src/pool/VirtualMachineXML.cc index 6ceed42835..163cbffd74 100644 --- a/src/scheduler/src/pool/VirtualMachineXML.cc +++ b/src/scheduler/src/pool/VirtualMachineXML.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/src/pool/test/HostXMLTest.cc b/src/scheduler/src/pool/test/HostXMLTest.cc index 8fe85f8e4c..c1c6907a29 100644 --- a/src/scheduler/src/pool/test/HostXMLTest.cc +++ b/src/scheduler/src/pool/test/HostXMLTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/src/pool/test/SConstruct b/src/scheduler/src/pool/test/SConstruct index 13e904116e..f100ae03fa 100644 --- a/src/scheduler/src/pool/test/SConstruct +++ b/src/scheduler/src/pool/test/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/scheduler/src/pool/test/VirtualMachineXMLTest.cc b/src/scheduler/src/pool/test/VirtualMachineXMLTest.cc index 0910c59453..0e8c691c3e 100644 --- a/src/scheduler/src/pool/test/VirtualMachineXMLTest.cc +++ b/src/scheduler/src/pool/test/VirtualMachineXMLTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/src/sched/SConstruct b/src/scheduler/src/sched/SConstruct index 3d67f79481..1642caeb31 100644 --- a/src/scheduler/src/sched/SConstruct +++ b/src/scheduler/src/sched/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/pool # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/scheduler/src/sched/Scheduler.cc b/src/scheduler/src/sched/Scheduler.cc index 9ed5254d5f..0046f35d38 100644 --- a/src/scheduler/src/sched/Scheduler.cc +++ b/src/scheduler/src/sched/Scheduler.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -175,6 +175,7 @@ void Scheduler::start() // ----------------------------------------------------------- hpool = new HostPoolXML(client, hypervisor_mem); + clpool = new ClusterPoolXML(client); vmpool = new VirtualMachinePoolXML(client, machines_limit, (live_rescheds == 1)); @@ -275,6 +276,24 @@ int Scheduler::set_up_pools() return rc; } + //-------------------------------------------------------------------------- + //Cleans the cache and get the cluster information + //-------------------------------------------------------------------------- + + rc = clpool->set_up(); + + if ( rc != 0 ) + { + return rc; + } + + //-------------------------------------------------------------------------- + //Add to each host the corresponding cluster template + //-------------------------------------------------------------------------- + + hpool->merge_clusters(clpool); + + //-------------------------------------------------------------------------- //Cleans the cache and get the pending VMs //-------------------------------------------------------------------------- diff --git a/src/scheduler/src/sched/SchedulerTemplate.cc b/src/scheduler/src/sched/SchedulerTemplate.cc index 30eb7998ad..51747ee603 100644 --- a/src/scheduler/src/sched/SchedulerTemplate.cc +++ b/src/scheduler/src/sched/SchedulerTemplate.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/scheduler/src/sched/mm_sched.cc b/src/scheduler/src/sched/mm_sched.cc index 014a87ca56..f609786786 100644 --- a/src/scheduler/src/sched/mm_sched.cc +++ b/src/scheduler/src/sched/mm_sched.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sql/MySqlDB.cc b/src/sql/MySqlDB.cc index 0bb621fc2f..5fb1b228bc 100644 --- a/src/sql/MySqlDB.cc +++ b/src/sql/MySqlDB.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sql/SConstruct b/src/sql/SConstruct index 8cd6dd42f7..21f3f61dff 100644 --- a/src/sql/SConstruct +++ b/src/sql/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/pool # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sql/SqliteDB.cc b/src/sql/SqliteDB.cc index 638751c3a9..11b2f7d7bd 100644 --- a/src/sql/SqliteDB.cc +++ b/src/sql/SqliteDB.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/OpenNebulaVNC.rb b/src/sunstone/OpenNebulaVNC.rb index 784984e68f..70a8525b61 100644 --- a/src/sunstone/OpenNebulaVNC.rb +++ b/src/sunstone/OpenNebulaVNC.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -19,7 +19,7 @@ # require 'json' -require 'OpenNebula' +require 'opennebula' TOKEN_EXPIRE_SECONDS = 4 diff --git a/src/sunstone/bin/sunstone-server b/src/sunstone/bin/sunstone-server index 02c413f102..c0a7128ab1 100755 --- a/src/sunstone/bin/sunstone-server +++ b/src/sunstone/bin/sunstone-server @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index 46b9750a7f..e88a9f52e8 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/locale/generate_messages_pot.sh b/src/sunstone/locale/generate_messages_pot.sh index b9db23c99a..30546fda10 100755 --- a/src/sunstone/locale/generate_messages_pot.sh +++ b/src/sunstone/locale/generate_messages_pot.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -16,7 +16,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -COPYRIGHT_HOLDER="2002-2012, OpenNebula Project Leads (OpenNebula.org)" +COPYRIGHT_HOLDER="2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs" PACKAGE_NAME="OpenNebula" find ../public/js -name \*.js > file_list.txt diff --git a/src/sunstone/locale/languages/SConstruct b/src/sunstone/locale/languages/SConstruct index 7afedf5cd0..604cd15d8d 100644 --- a/src/sunstone/locale/languages/SConstruct +++ b/src/sunstone/locale/languages/SConstruct @@ -1,7 +1,7 @@ # SConstruct for share/man # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/locale/languages/ca.po b/src/sunstone/locale/languages/ca.po index 8ca741c7c7..e7985433cc 100644 --- a/src/sunstone/locale/languages/ca.po +++ b/src/sunstone/locale/languages/ca.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/cs_CZ.po b/src/sunstone/locale/languages/cs_CZ.po index dcac411a48..015340364b 100644 --- a/src/sunstone/locale/languages/cs_CZ.po +++ b/src/sunstone/locale/languages/cs_CZ.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/de.po b/src/sunstone/locale/languages/de.po index e8c243ef9a..e935eefedf 100644 --- a/src/sunstone/locale/languages/de.po +++ b/src/sunstone/locale/languages/de.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/el_GR.po b/src/sunstone/locale/languages/el_GR.po index 7078cb23c5..326e487c0e 100644 --- a/src/sunstone/locale/languages/el_GR.po +++ b/src/sunstone/locale/languages/el_GR.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/en_US.po b/src/sunstone/locale/languages/en_US.po index eeeca51369..b73b955301 100644 --- a/src/sunstone/locale/languages/en_US.po +++ b/src/sunstone/locale/languages/en_US.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # diff --git a/src/sunstone/locale/languages/es_ES.po b/src/sunstone/locale/languages/es_ES.po index 47f2bd5e85..0df00f3f3d 100644 --- a/src/sunstone/locale/languages/es_ES.po +++ b/src/sunstone/locale/languages/es_ES.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/fa_IR.po b/src/sunstone/locale/languages/fa_IR.po index e9dd0d7585..e6e3aaec99 100644 --- a/src/sunstone/locale/languages/fa_IR.po +++ b/src/sunstone/locale/languages/fa_IR.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/fr_FR.po b/src/sunstone/locale/languages/fr_FR.po index da214934a0..c4a19f47b2 100644 --- a/src/sunstone/locale/languages/fr_FR.po +++ b/src/sunstone/locale/languages/fr_FR.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/it_IT.po b/src/sunstone/locale/languages/it_IT.po index 879aed3272..7cd951bcc9 100644 --- a/src/sunstone/locale/languages/it_IT.po +++ b/src/sunstone/locale/languages/it_IT.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/pt_BR.po b/src/sunstone/locale/languages/pt_BR.po index db5e275b15..caf7587c45 100644 --- a/src/sunstone/locale/languages/pt_BR.po +++ b/src/sunstone/locale/languages/pt_BR.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/pt_PT.po b/src/sunstone/locale/languages/pt_PT.po index fd419f3126..69c5cf1c7c 100644 --- a/src/sunstone/locale/languages/pt_PT.po +++ b/src/sunstone/locale/languages/pt_PT.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/ru_RU.po b/src/sunstone/locale/languages/ru_RU.po index 0a2a559a59..d8c63b4007 100644 --- a/src/sunstone/locale/languages/ru_RU.po +++ b/src/sunstone/locale/languages/ru_RU.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/sk_SK.po b/src/sunstone/locale/languages/sk_SK.po index 9f9df9eb36..11dc6c1166 100644 --- a/src/sunstone/locale/languages/sk_SK.po +++ b/src/sunstone/locale/languages/sk_SK.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/languages/zh_TW.po b/src/sunstone/locale/languages/zh_TW.po index 27da350e29..fe3e9f5daf 100644 --- a/src/sunstone/locale/languages/zh_TW.po +++ b/src/sunstone/locale/languages/zh_TW.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # # Translators: diff --git a/src/sunstone/locale/messages.pot b/src/sunstone/locale/messages.pot index eeeca51369..b73b955301 100644 --- a/src/sunstone/locale/messages.pot +++ b/src/sunstone/locale/messages.pot @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright (C) YEAR 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # diff --git a/src/sunstone/locale/upgrade_po_translations.sh b/src/sunstone/locale/upgrade_po_translations.sh index 38c0b3a505..2d2a0dd4ea 100755 --- a/src/sunstone/locale/upgrade_po_translations.sh +++ b/src/sunstone/locale/upgrade_po_translations.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON.rb b/src/sunstone/models/OpenNebulaJSON.rb index 7055b7a302..d3e6e37d1b 100644 --- a/src/sunstone/models/OpenNebulaJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'OpenNebula' +require 'opennebula' include OpenNebula require 'OpenNebulaJSON/GroupJSON' diff --git a/src/sunstone/models/OpenNebulaJSON/AclJSON.rb b/src/sunstone/models/OpenNebulaJSON/AclJSON.rb index 8376df98b6..642ee12160 100644 --- a/src/sunstone/models/OpenNebulaJSON/AclJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/AclJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb index a6cfe414e7..c2d8a09c12 100644 --- a/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb b/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb index 095f30d61a..e7ff02b4ea 100644 --- a/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/GroupJSON.rb b/src/sunstone/models/OpenNebulaJSON/GroupJSON.rb index 35e01f1403..8d46f4bdc3 100644 --- a/src/sunstone/models/OpenNebulaJSON/GroupJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/GroupJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb index 3ca11ecb0b..196010d609 100644 --- a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb b/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb index 6224ef063c..3d5dc124cc 100644 --- a/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/JSONUtils.rb b/src/sunstone/models/OpenNebulaJSON/JSONUtils.rb index 8b60fb8e87..a2098d74bc 100644 --- a/src/sunstone/models/OpenNebulaJSON/JSONUtils.rb +++ b/src/sunstone/models/OpenNebulaJSON/JSONUtils.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb b/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb index 791b723645..b3b71ecaed 100644 --- a/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb b/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb index ce5e1c0f68..4fe9f74bd2 100644 --- a/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb index ebf4338802..3bd88c60d0 100644 --- a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb index c44524b2d0..5fcef2fb4f 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -29,12 +29,6 @@ module OpenNebulaJSON if vm_hash['vm_raw'] template = vm_hash['vm_raw'] - elsif vm_hash['template_id'] - template_id = vm_hash['template_id'] - - template = "TEMPLATE_ID = #{template_id}" - template << "\nNAME = #{vm_hash['vm_name']}" if vm_hash['vm_name'] - else template = template_to_str(vm_hash) end diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb index bcaad16d56..69790d8560 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/SunstoneMarketplace.rb b/src/sunstone/models/SunstoneMarketplace.rb index c2dcad8217..56f507e284 100644 --- a/src/sunstone/models/SunstoneMarketplace.rb +++ b/src/sunstone/models/SunstoneMarketplace.rb @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- # -# Copyright 2010-2012, C12G Labs S.L # +# Copyright 2010-2013, C12G Labs S.L # # # # 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 # diff --git a/src/sunstone/models/SunstonePlugins.rb b/src/sunstone/models/SunstonePlugins.rb index 50ad003d64..ac146b88e9 100644 --- a/src/sunstone/models/SunstonePlugins.rb +++ b/src/sunstone/models/SunstonePlugins.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index e49c6bb79c..54e42f838e 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/public/css/application.css b/src/sunstone/public/css/application.css index 81a21ae8dc..a01d8d6a45 100644 --- a/src/sunstone/public/css/application.css +++ b/src/sunstone/public/css/application.css @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/css/layout.css b/src/sunstone/public/css/layout.css index 10594db12a..1d2f2e7e37 100644 --- a/src/sunstone/public/css/layout.css +++ b/src/sunstone/public/css/layout.css @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/css/login.css b/src/sunstone/public/css/login.css index 3921199404..833f1b855a 100644 --- a/src/sunstone/public/css/login.css +++ b/src/sunstone/public/css/login.css @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/layout.js b/src/sunstone/public/js/layout.js index 049e895644..1fde922a16 100644 --- a/src/sunstone/public/js/layout.js +++ b/src/sunstone/public/js/layout.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/locale.js b/src/sunstone/public/js/locale.js index b53137fc6a..7cbbb7f714 100644 --- a/src/sunstone/public/js/locale.js +++ b/src/sunstone/public/js/locale.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/login.js b/src/sunstone/public/js/login.js index a1012c14e6..645c6207fe 100644 --- a/src/sunstone/public/js/login.js +++ b/src/sunstone/public/js/login.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/monitoring.js b/src/sunstone/public/js/monitoring.js index 98244595e7..2fac4dfb0a 100644 --- a/src/sunstone/public/js/monitoring.js +++ b/src/sunstone/public/js/monitoring.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index d27ac9e23d..1c121af5f7 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -102,14 +102,15 @@ var OpenNebula = { "SHUTDOWN", "CANCEL", "FAILURE", - "CLEANUP", + "CLEANUP_RESUBMIT", "UNKNOWN", "HOTPLUG", "SHUTDOWN_POWEROFF", "BOOT_UNKNOWN", "BOOT_POWEROFF", "BOOT_SUSPENDED", - "BOOT_STOPPED"][value]); + "BOOT_STOPPED", + "CLEANUP_DELETE"][value]); break; case "IMAGE": case "image": diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js index 5c749cc7c9..d7a2fd4142 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index d7af4c0d51..06f89e76c1 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js index 418f02ad6e..d0b0e87aa3 100644 --- a/src/sunstone/public/js/plugins/config-tab.js +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/dashboard-tab.js b/src/sunstone/public/js/plugins/dashboard-tab.js index 42cc399ab2..f2cb811e6f 100644 --- a/src/sunstone/public/js/plugins/dashboard-tab.js +++ b/src/sunstone/public/js/plugins/dashboard-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/dashboard-users-tab.js b/src/sunstone/public/js/plugins/dashboard-users-tab.js index 60042ec5d8..18329c0e48 100644 --- a/src/sunstone/public/js/plugins/dashboard-users-tab.js +++ b/src/sunstone/public/js/plugins/dashboard-users-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 7e7eae2cf8..86f37d8c6c 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index e54804be81..26fbdec850 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 028394b004..06df6755a8 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index bc16d1e29f..49b9f44307 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/infra-tab.js b/src/sunstone/public/js/plugins/infra-tab.js index 96f4606ac0..789fd02268 100644 --- a/src/sunstone/public/js/plugins/infra-tab.js +++ b/src/sunstone/public/js/plugins/infra-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/marketplace-tab.js b/src/sunstone/public/js/plugins/marketplace-tab.js index e08f68449a..b4e309e4e4 100644 --- a/src/sunstone/public/js/plugins/marketplace-tab.js +++ b/src/sunstone/public/js/plugins/marketplace-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2010-2012, C12G Labs S.L */ +/* Copyright 2010-2013, C12G Labs S.L */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/system-tab.js b/src/sunstone/public/js/plugins/system-tab.js index 8dc7e4519a..0374c1b287 100644 --- a/src/sunstone/public/js/plugins/system-tab.js +++ b/src/sunstone/public/js/plugins/system-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 9b00c04cb0..7510170062 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index fb3fafc5df..a3b0d7c86a 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 02a0169059..bbae7a97f0 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index 0f5badc766..8e02a7300c 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/plugins/vresources-tab.js b/src/sunstone/public/js/plugins/vresources-tab.js index 0e6d91f84a..3365eea780 100644 --- a/src/sunstone/public/js/plugins/vresources-tab.js +++ b/src/sunstone/public/js/plugins/vresources-tab.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index cf641bbfb5..caddf79c38 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index faa3c1940e..0003aa3b9c 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 5c260a33fc..ee7d66a69e 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/test/spec/host_spec.rb b/src/sunstone/test/spec/host_spec.rb index 24a73aac3d..a65529a877 100644 --- a/src/sunstone/test/spec/host_spec.rb +++ b/src/sunstone/test/spec/host_spec.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/test/spec/image_spec.rb b/src/sunstone/test/spec/image_spec.rb index 26372b91ff..45f8249d0a 100644 --- a/src/sunstone/test/spec/image_spec.rb +++ b/src/sunstone/test/spec/image_spec.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/test/spec/spec_helper.rb b/src/sunstone/test/spec/spec_helper.rb index 94b6bae9ff..060b1d3ec3 100644 --- a/src/sunstone/test/spec/spec_helper.rb +++ b/src/sunstone/test/spec/spec_helper.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/test/spec/user_spec.rb b/src/sunstone/test/spec/user_spec.rb index 844c85d5e5..e53b2e0d3d 100644 --- a/src/sunstone/test/spec/user_spec.rb +++ b/src/sunstone/test/spec/user_spec.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/test/spec/vm_spec.rb b/src/sunstone/test/spec/vm_spec.rb index 8b58bdccdd..1d04fff8fa 100644 --- a/src/sunstone/test/spec/vm_spec.rb +++ b/src/sunstone/test/spec/vm_spec.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/test/spec/vnet_spec.rb b/src/sunstone/test/spec/vnet_spec.rb index 8d30c91d96..f155c9a9be 100644 --- a/src/sunstone/test/spec/vnet_spec.rb +++ b/src/sunstone/test/spec/vnet_spec.rb @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/sunstone/test/test.sh b/src/sunstone/test/test.sh index c266b7ccc6..2029975552 100755 --- a/src/sunstone/test/test.sh +++ b/src/sunstone/test/test.sh @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/template/SConstruct b/src/template/SConstruct index ae42cca414..d424abbdb4 100644 --- a/src/template/SConstruct +++ b/src/template/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/template # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/template/Template.cc b/src/template/Template.cc index 5e8725b093..a9ee13b863 100644 --- a/src/template/Template.cc +++ b/src/template/Template.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -177,6 +177,11 @@ int Template::parse_str_or_xml(const string &parse_str, string& error_msg) } } + if(rc == 0) + { + trim_name(); + } + return rc; } @@ -554,6 +559,24 @@ string& Template::to_str(string& str) const /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ +bool Template::trim(const string& name) +{ + string st; + get(name, st); + + if(st.empty()) + { + return false; + } + + replace(name, st.substr( 0, st.find_last_not_of(" \f\n\r\t\v") + 1 ) ); + + return true; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + ostream& operator << (ostream& os, const Template& t) { string str; diff --git a/src/template/template_parser.c b/src/template/template_parser.c index 61f1818828..2c473ec80d 100644 --- a/src/template/template_parser.c +++ b/src/template/template_parser.c @@ -522,7 +522,7 @@ int template__flex_debug = 0; char *template_text; #line 1 "template_parser.l" /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/template/template_parser.l b/src/template/template_parser.l index bbeba770aa..84b1b16b5b 100644 --- a/src/template/template_parser.l +++ b/src/template/template_parser.l @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/template/template_syntax.y b/src/template/template_syntax.y index 6be981f9d6..4c234e5074 100644 --- a/src/template/template_syntax.y +++ b/src/template/template_syntax.y @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/template/test/SConstruct b/src/template/test/SConstruct index 5c798ef0f5..186e01d6a2 100644 --- a/src/template/test/SConstruct +++ b/src/template/test/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/test/Nebula.cc b/src/test/Nebula.cc index 42563416c3..47603e392a 100644 --- a/src/test/Nebula.cc +++ b/src/test/Nebula.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/test/NebulaTest.cc b/src/test/NebulaTest.cc index 8be19530c8..94e5b620f8 100644 --- a/src/test/NebulaTest.cc +++ b/src/test/NebulaTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/test/OneUnitTest.cc b/src/test/OneUnitTest.cc index ad1fae8ce0..46d85c56c6 100644 --- a/src/test/OneUnitTest.cc +++ b/src/test/OneUnitTest.cc @@ -1,6 +1,6 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/test/SConstruct b/src/test/SConstruct index 26f33152d2..7fd2fae818 100644 --- a/src/test/SConstruct +++ b/src/test/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/test # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm/SConstruct b/src/tm/SConstruct index d6842df239..1bce1446d8 100644 --- a/src/tm/SConstruct +++ b/src/tm/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/vm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm/TransferManager.cc b/src/tm/TransferManager.cc index 712ded9e8c..21b15cf8ab 100644 --- a/src/tm/TransferManager.cc +++ b/src/tm/TransferManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -115,6 +115,10 @@ void TransferManager::trigger(Actions action, int _vid) aname = "EPILOG_DELETE_PREVIOUS"; break; + case EPILOG_DELETE_BOTH: + aname = "EPILOG_DELETE_BOTH"; + break; + case CHECKPOINT: aname = "CHECKPOINT"; break; @@ -183,6 +187,10 @@ void TransferManager::do_action(const string &action, void * arg) { epilog_delete_previous_action(vid); } + else if (action == "EPILOG_DELETE_BOTH") + { + epilog_delete_both_action(vid); + } else if (action == "CHECKPOINT") { checkpoint_action(vid); @@ -1195,61 +1203,74 @@ error_common: return; } + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -void TransferManager::epilog_delete_action(bool local, int vid) +int TransferManager::epilog_delete_commands(VirtualMachine *vm, + ostream& xfr, + bool local, + bool previous) { - ofstream xfr; ostringstream os; - string xfr_name; string vm_tm_mad; string tm_mad; string vm_ds_id; string ds_id; + string host; + string system_dir; + int disk_id; - VirtualMachine * vm; - Nebula& nd = Nebula::instance(); - - const TransferManagerDriver * tm_md; + Nebula& nd = Nebula::instance(); const VectorAttribute * disk; vector attrs; int num; // ------------------------------------------------------------------------ - // Setup & Transfer script + // Setup transfer // ------------------------------------------------------------------------ - vm = vmpool->get(vid,true); - - if (vm == 0) - { - return; - } - if (!vm->hasHistory()) { goto error_history; } - vm_tm_mad = vm->get_tm_mad(); - vm_ds_id = vm->get_ds_id(); - tm_md = get(); - - if ( tm_md == 0 || vm_tm_mad.empty() || vm_ds_id.empty()) + if (local) { - goto error_drivers; + host = nd.get_nebula_hostname(); + system_dir = vm->get_system_dir(); + + vm_tm_mad = vm->get_tm_mad(); + vm_ds_id = vm->get_ds_id(); + } + else if (previous) + { + if (!vm->hasPreviousHistory()) + { + goto error_history; + } + + host = vm->get_previous_hostname(); + system_dir = vm->get_remote_system_dir(); + + vm_tm_mad = vm->get_previous_tm_mad(); + vm_ds_id = vm->get_previous_ds_id(); + } + else + { + host = vm->get_hostname(); + system_dir = vm->get_remote_system_dir(); + + vm_tm_mad = vm->get_tm_mad(); + vm_ds_id = vm->get_ds_id(); } - xfr_name = vm->get_transfer_file() + ".delete"; - xfr.open(xfr_name.c_str(), ios::out | ios::trunc); - - if (xfr.fail() == true) + if ( vm_tm_mad.empty() || vm_ds_id.empty()) { - goto error_file; + goto error_drivers; } // ------------------------------------------------------------------------- @@ -1284,103 +1305,57 @@ void TransferManager::epilog_delete_action(bool local, int vid) } } - if ( local ) - { - //DELETE tm_mad fe:system_dir/disk.i vmid dsid - xfr << "DELETE " - << tm_mad << " " - << nd.get_nebula_hostname() << ":" - << vm->get_system_dir() << "/disk." << disk_id << " " - << vm->get_oid() << " " - << ds_id << endl; - } - else - { - //DELETE tm_mad host:remote_system_dir/disk.i vmid dsid - xfr << "DELETE " - << tm_mad << " " - << vm->get_hostname() << ":" - << vm->get_remote_system_dir() << "/disk." << disk_id << " " - << vm->get_oid() << " " - << ds_id << endl; - } - } - - if ( local ) - { - //DELETE vm_tm_mad fe:system_dir vmid dsid(=0) + //DELETE tm_mad host:remote_system_dir/disk.i vmid dsid + // *local* DELETE tm_mad fe:system_dir/disk.i vmid dsid + // *prev* DELETE tm_mad prev_host:remote_system_dir/disk.i vmid ds_id xfr << "DELETE " - << vm_tm_mad << " " - << nd.get_nebula_hostname() <<":"<< vm->get_system_dir() << " " + << tm_mad << " " + << host << ":" + << system_dir << "/disk." << disk_id << " " << vm->get_oid() << " " - << vm_ds_id; - } - else - { - //DELETE vm_tm_mad hostname:remote_system_dir vmid dsid(=0) - xfr << "DELETE " - << vm_tm_mad << " " - << vm->get_hostname() <<":"<< vm->get_remote_system_dir() << " " - << vm->get_oid() << " " - << vm_ds_id; + << ds_id << endl; } - xfr.close(); + //DELETE vm_tm_mad hostname:remote_system_dir vmid dsid + // *local* DELETE vm_tm_mad fe:system_dir vmid dsid + // *prev* DELTE vm_tm_mad prev_host:remote_system_dir vmid ds_id + xfr << "DELETE " + << vm_tm_mad << " " + << host <<":"<< system_dir << " " + << vm->get_oid() << " " + << vm_ds_id << endl; - tm_md->transfer(vid,xfr_name); - - vm->unlock(); - return; + return 0; error_history: - os.str(""); - os << "epilog_delete, VM " << vid << " has no history"; + os << "epilog_delete, VM " << vm->get_oid() << " missing history record"; goto error_common; error_drivers: - os.str(""); os << "epilog_delete, error getting drivers."; goto error_common; -error_file: - os.str(""); - os << "epilog_delete, could not open file: " << xfr_name; - os << ". You may need to manually clean " << vm->get_hostname() - << ":" << vm->get_remote_system_dir(); - goto error_common; - error_common: vm->log("TM", Log::ERROR, os); - (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_FAILURE,vid); - - vm->unlock(); - return; + return -1; } /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -void TransferManager::epilog_delete_previous_action(int vid) +void TransferManager::epilog_delete_action(bool local, int vid) { - ofstream xfr; ostringstream os; - string xfr_name; - string vm_tm_mad; - string tm_mad; - string vm_ds_id; - string ds_id; - - int disk_id; + ofstream xfr; + string xfr_name; VirtualMachine * vm; Nebula& nd = Nebula::instance(); const TransferManagerDriver * tm_md; - const VectorAttribute * disk; - vector attrs; - int num; + int rc; // ------------------------------------------------------------------------ // Setup & Transfer script @@ -1392,18 +1367,84 @@ void TransferManager::epilog_delete_previous_action(int vid) return; } - if (!vm->hasHistory() || !vm->hasPreviousHistory()) + tm_md = get(); + + if ( tm_md == 0 ) { - goto error_history; + goto error_driver; } - vm_tm_mad = vm->get_previous_tm_mad(); - vm_ds_id = vm->get_previous_ds_id(); - tm_md = get(); + xfr_name = vm->get_transfer_file() + ".delete"; + xfr.open(xfr_name.c_str(), ios::out | ios::trunc); - if ( tm_md == 0 || vm_tm_mad.empty() || vm_ds_id.empty() ) + if (xfr.fail() == true) { - goto error_drivers; + goto error_file; + } + + rc = epilog_delete_commands(vm, xfr, local, false); + + if ( rc != 0 ) + { + goto error_common; + } + + xfr.close(); + + tm_md->transfer(vid,xfr_name); + + vm->unlock(); + return; + +error_driver: + os << "epilog_delete, error getting TM driver."; + goto error_common; + +error_file: + os << "epilog_delete, could not open file: " << xfr_name; + os << ". You may need to manually clean the host (current)"; + goto error_common; + +error_common: + vm->log("TM", Log::ERROR, os); + (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_FAILURE, vid); + + vm->unlock(); + return; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void TransferManager::epilog_delete_previous_action(int vid) +{ + ostringstream os; + + ofstream xfr; + string xfr_name; + + VirtualMachine * vm; + Nebula& nd = Nebula::instance(); + + const TransferManagerDriver * tm_md; + + int rc; + + // ------------------------------------------------------------------------ + // Setup & Transfer script + // ------------------------------------------------------------------------ + vm = vmpool->get(vid,true); + + if (vm == 0) + { + return; + } + + tm_md = get(); + + if (tm_md == 0) + { + goto error_driver; } xfr_name = vm->get_transfer_file() + ".delete_prev"; @@ -1414,81 +1455,106 @@ void TransferManager::epilog_delete_previous_action(int vid) goto error_file; } - // ------------------------------------------------------------------------ - // Delete the remote VM Directory - // ------------------------------------------------------------------------ - num = vm->get_template_attribute("DISK",attrs); + rc = epilog_delete_commands(vm, xfr, false, true); - for (int i=0 ; i < num ; i++) + if ( rc != 0 ) { - disk = dynamic_cast(attrs[i]); - - if ( disk == 0 ) - { - continue; - } - - disk->vector_value_str("DISK_ID", disk_id); - - if ( isVolatile(disk) == true ) - { - tm_mad = vm_tm_mad; - ds_id = vm_ds_id; - } - else - { - tm_mad = disk->vector_value("TM_MAD"); - ds_id = disk->vector_value("DATASTORE_ID"); - - if ( tm_mad.empty() || ds_id.empty() ) - { - continue; - } - } - - //DELETE tm_mad prev_host:remote_system_dir/disk.i vmid ds_id - xfr << "DELETE " - << tm_mad << " " - << vm->get_previous_hostname() << ":" - << vm->get_remote_system_dir() << "/disk." << disk_id << " " - << vm->get_oid() << " " - << ds_id << endl; + goto error_common; } - //DELTE vm_tm_mad prev_host:remote_system_dir vmid ds_id(=0) - xfr << "DELETE " - << vm_tm_mad << " " - << vm->get_previous_hostname() <<":"<< vm->get_remote_system_dir() - << " " << vm->get_oid() << " " - << vm_ds_id << endl; - xfr.close(); - tm_md->transfer(vid,xfr_name); + tm_md->transfer(vid, xfr_name); vm->unlock(); return; -error_history: - os.str(""); - os << "epilog_delete_previous, VM " << vid << " has no history"; - goto error_common; - -error_drivers: - os.str(""); - os << "epilog_delete_previous, error getting drivers."; +error_driver: + os << "epilog_delete_previous, error getting TM driver."; goto error_common; error_file: - os.str(""); os << "epilog_delete_previous, could not open file: " << xfr_name; - os << ". You may need to manually clean " << vm->get_previous_hostname() - << ":" << vm->get_remote_system_dir(); + os << ". You may need to manually clean the host (previous)"; goto error_common; error_common: - (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_FAILURE,vid); vm->log("TM", Log::ERROR, os); + (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_FAILURE, vid); + + vm->unlock(); + return; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void TransferManager::epilog_delete_both_action(int vid) +{ + ostringstream os; + + ofstream xfr; + string xfr_name; + + VirtualMachine * vm; + Nebula& nd = Nebula::instance(); + + const TransferManagerDriver * tm_md; + + int rc; + + // ------------------------------------------------------------------------ + // Setup & Transfer script + // ------------------------------------------------------------------------ + vm = vmpool->get(vid,true); + + if (vm == 0) + { + return; + } + + tm_md = get(); + + if (tm_md == 0) + { + goto error_driver; + } + + xfr_name = vm->get_transfer_file() + ".delete_both"; + xfr.open(xfr_name.c_str(),ios::out | ios::trunc); + + if (xfr.fail() == true) + { + goto error_file; + } + + rc = epilog_delete_commands(vm, xfr, false, false); //current + rc = epilog_delete_commands(vm, xfr, false, true); //previous + + if ( rc != 0 ) + { + goto error_common; + } + + xfr.close(); + + tm_md->transfer(vid, xfr_name); + + vm->unlock(); + return; + +error_driver: + os << "epilog_delete_both, error getting TM driver."; + goto error_common; + +error_file: + os << "epilog_delete_both, could not open file: " << xfr_name; + os << ". You may need to manually clean hosts (previous & current)"; + goto error_common; + +error_common: + vm->log("TM", Log::ERROR, os); + (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_FAILURE, vid); vm->unlock(); return; diff --git a/src/tm/TransferManagerDriver.cc b/src/tm/TransferManagerDriver.cc index dbabe4e9da..7f5e85cc79 100644 --- a/src/tm/TransferManagerDriver.cc +++ b/src/tm/TransferManagerDriver.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -127,7 +127,7 @@ void TransferManagerDriver::protocol( case VirtualMachine::EPILOG: case VirtualMachine::EPILOG_STOP: - case VirtualMachine::CLEANUP: + case VirtualMachine::CLEANUP_RESUBMIT: lcm_action = LifeCycleManager::EPILOG_SUCCESS; break; @@ -164,7 +164,7 @@ void TransferManagerDriver::protocol( case VirtualMachine::EPILOG: case VirtualMachine::EPILOG_STOP: - case VirtualMachine::CLEANUP: + case VirtualMachine::CLEANUP_RESUBMIT: lcm_action = LifeCycleManager::EPILOG_FAILURE; break; diff --git a/src/tm_mad/common/context b/src/tm_mad/common/context index d419cd60fa..c2176c7ff3 100755 --- a/src/tm_mad/common/context +++ b/src/tm_mad/common/context @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/common/delete b/src/tm_mad/common/delete index e2dd4bb636..c997810b38 100755 --- a/src/tm_mad/common/delete +++ b/src/tm_mad/common/delete @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/common/dummy.sh b/src/tm_mad/common/dummy.sh index 6c1cd9257d..e9e0ad4f34 100755 --- a/src/tm_mad/common/dummy.sh +++ b/src/tm_mad/common/dummy.sh @@ -1,7 +1,7 @@ #!/bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/common/mkimage b/src/tm_mad/common/mkimage index d393a16486..08263bfd71 100755 --- a/src/tm_mad/common/mkimage +++ b/src/tm_mad/common/mkimage @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/common/mkswap b/src/tm_mad/common/mkswap index 5a42f6d46e..2b0939d90a 100755 --- a/src/tm_mad/common/mkswap +++ b/src/tm_mad/common/mkswap @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/common/postmigrate b/src/tm_mad/common/postmigrate index 9e94890d9b..665b35d7ff 100755 --- a/src/tm_mad/common/postmigrate +++ b/src/tm_mad/common/postmigrate @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/common/premigrate b/src/tm_mad/common/premigrate index bab383dbef..9b5a196c7c 100755 --- a/src/tm_mad/common/premigrate +++ b/src/tm_mad/common/premigrate @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/iscsi/clone b/src/tm_mad/iscsi/clone index 89feebfc55..9d82307a43 100755 --- a/src/tm_mad/iscsi/clone +++ b/src/tm_mad/iscsi/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/iscsi/delete b/src/tm_mad/iscsi/delete index 4964af081e..354b810de6 100755 --- a/src/tm_mad/iscsi/delete +++ b/src/tm_mad/iscsi/delete @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/iscsi/ln b/src/tm_mad/iscsi/ln index ba190893f1..e040d40a88 100755 --- a/src/tm_mad/iscsi/ln +++ b/src/tm_mad/iscsi/ln @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/iscsi/mv b/src/tm_mad/iscsi/mv index 605489f319..7e33033d13 100755 --- a/src/tm_mad/iscsi/mv +++ b/src/tm_mad/iscsi/mv @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/iscsi/mvds b/src/tm_mad/iscsi/mvds index 0793122369..80ac6ef24f 100755 --- a/src/tm_mad/iscsi/mvds +++ b/src/tm_mad/iscsi/mvds @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/lvm/clone b/src/tm_mad/lvm/clone index a4a7ab9e92..cf9ef9f9ba 100755 --- a/src/tm_mad/lvm/clone +++ b/src/tm_mad/lvm/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/lvm/delete b/src/tm_mad/lvm/delete index 9071bd9353..003cda3d11 100755 --- a/src/tm_mad/lvm/delete +++ b/src/tm_mad/lvm/delete @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/lvm/ln b/src/tm_mad/lvm/ln index a53a50152f..d525c809b5 100755 --- a/src/tm_mad/lvm/ln +++ b/src/tm_mad/lvm/ln @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/lvm/mv b/src/tm_mad/lvm/mv index 8f82a3f4f4..2c409c7eac 100755 --- a/src/tm_mad/lvm/mv +++ b/src/tm_mad/lvm/mv @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/lvm/mvds b/src/tm_mad/lvm/mvds index c4de3cb23b..0bb018b343 100755 --- a/src/tm_mad/lvm/mvds +++ b/src/tm_mad/lvm/mvds @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/one_tm b/src/tm_mad/one_tm index d1da2965b1..396002b5dd 100755 --- a/src/tm_mad/one_tm +++ b/src/tm_mad/one_tm @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/one_tm.rb b/src/tm_mad/one_tm.rb index 175aeee2c1..0a1cdf62f1 100755 --- a/src/tm_mad/one_tm.rb +++ b/src/tm_mad/one_tm.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/qcow2/clone b/src/tm_mad/qcow2/clone index 57e1b78b8a..dc87425747 100755 --- a/src/tm_mad/qcow2/clone +++ b/src/tm_mad/qcow2/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/qcow2/mvds b/src/tm_mad/qcow2/mvds index 9507555ea8..0f38794ab1 100755 --- a/src/tm_mad/qcow2/mvds +++ b/src/tm_mad/qcow2/mvds @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/shared/clone b/src/tm_mad/shared/clone index cbe500e0a4..16dfd179ab 100755 --- a/src/tm_mad/shared/clone +++ b/src/tm_mad/shared/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/shared/ln b/src/tm_mad/shared/ln index 488dd4dccb..2dc58f03a6 100755 --- a/src/tm_mad/shared/ln +++ b/src/tm_mad/shared/ln @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/shared/mvds b/src/tm_mad/shared/mvds index cbe6b06c23..1d937f3be4 100755 --- a/src/tm_mad/shared/mvds +++ b/src/tm_mad/shared/mvds @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/ssh/clone b/src/tm_mad/ssh/clone index d8554cbd70..f26b9de79d 100755 --- a/src/tm_mad/ssh/clone +++ b/src/tm_mad/ssh/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/ssh/mv b/src/tm_mad/ssh/mv index a75bd91d7e..f282e4e5a8 100755 --- a/src/tm_mad/ssh/mv +++ b/src/tm_mad/ssh/mv @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/ssh/mvds b/src/tm_mad/ssh/mvds index 5eaf93c064..636f559893 100755 --- a/src/tm_mad/ssh/mvds +++ b/src/tm_mad/ssh/mvds @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/tm_common.sh b/src/tm_mad/tm_common.sh index c51fc86e1d..ba31363024 100644 --- a/src/tm_mad/tm_common.sh +++ b/src/tm_mad/tm_common.sh @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/vmfs/clone b/src/tm_mad/vmfs/clone index 1202009243..ad9f78b242 100755 --- a/src/tm_mad/vmfs/clone +++ b/src/tm_mad/vmfs/clone @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/vmfs/context b/src/tm_mad/vmfs/context index d17b0a98be..023e20ab99 100755 --- a/src/tm_mad/vmfs/context +++ b/src/tm_mad/vmfs/context @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/vmfs/delete b/src/tm_mad/vmfs/delete index 19fdfacb1b..5b3d53f806 100755 --- a/src/tm_mad/vmfs/delete +++ b/src/tm_mad/vmfs/delete @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/vmfs/ln b/src/tm_mad/vmfs/ln index 5a0afb93d4..d3c5830747 100755 --- a/src/tm_mad/vmfs/ln +++ b/src/tm_mad/vmfs/ln @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/vmfs/mkimage b/src/tm_mad/vmfs/mkimage index 97907b3985..d27b84de2a 100755 --- a/src/tm_mad/vmfs/mkimage +++ b/src/tm_mad/vmfs/mkimage @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/tm_mad/vmfs/mvds b/src/tm_mad/vmfs/mvds index 4596503d35..71de06d6fe 100755 --- a/src/tm_mad/vmfs/mvds +++ b/src/tm_mad/vmfs/mvds @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/um/DefaultQuotas.cc b/src/um/DefaultQuotas.cc index 7fa4d5a7f9..8937adf204 100644 --- a/src/um/DefaultQuotas.cc +++ b/src/um/DefaultQuotas.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/um/Quota.cc b/src/um/Quota.cc index 581a969ce6..767ac1fb17 100644 --- a/src/um/Quota.cc +++ b/src/um/Quota.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/um/QuotaDatastore.cc b/src/um/QuotaDatastore.cc index feabd98c00..7fb3935a7f 100644 --- a/src/um/QuotaDatastore.cc +++ b/src/um/QuotaDatastore.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/um/QuotaImage.cc b/src/um/QuotaImage.cc index dd3f1e563a..6465416c0f 100644 --- a/src/um/QuotaImage.cc +++ b/src/um/QuotaImage.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/um/QuotaNetwork.cc b/src/um/QuotaNetwork.cc index b1ca09b45d..a4d02c1dca 100644 --- a/src/um/QuotaNetwork.cc +++ b/src/um/QuotaNetwork.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/um/QuotaVirtualMachine.cc b/src/um/QuotaVirtualMachine.cc index 34378c41dc..cacd7afed0 100644 --- a/src/um/QuotaVirtualMachine.cc +++ b/src/um/QuotaVirtualMachine.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/um/Quotas.cc b/src/um/Quotas.cc index 325c419e99..3918471294 100644 --- a/src/um/Quotas.cc +++ b/src/um/Quotas.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/um/SConstruct b/src/um/SConstruct index 122767aff1..c43e7258a9 100644 --- a/src/um/SConstruct +++ b/src/um/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/vm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/um/User.cc b/src/um/User.cc index 0dfc86cc8f..9c8944f6d1 100644 --- a/src/um/User.cc +++ b/src/um/User.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -197,8 +197,8 @@ int User::from_xml(const string& xml) rc += obj_template->from_xml_node(content[0]); ObjectXML::free_nodes(content); - - rc += quota.from_xml(this); + + rc += quota.from_xml(this); if (rc != 0) { @@ -283,6 +283,30 @@ bool User::pass_is_valid(const string& pass, string& error_str) return true; } + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ +int User::get_umask() const +{ + string umask_st; + int umask; + + istringstream iss; + + get_template_attribute("UMASK", umask_st); + + if(umask_st.empty()) + { + Nebula::instance().get_configuration_attribute("DEFAULT_UMASK",umask_st); + } + + iss.str(umask_st); + + iss >> oct >> umask; + + return (umask & 0777); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ diff --git a/src/um/UserPool.cc b/src/um/UserPool.cc index 00dcdda00d..c24b5f0cb4 100644 --- a/src/um/UserPool.cc +++ b/src/um/UserPool.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -80,8 +80,6 @@ UserPool::UserPool(SqlDB * db, _session_expiration_time = __session_expiration_time; - register_hooks(hook_mads, remotes_location); - User * oneadmin_user = get(0, true); if (oneadmin_user != 0) @@ -89,6 +87,8 @@ UserPool::UserPool(SqlDB * db, oneadmin_name = oneadmin_user->get_name(); oneadmin_user->unlock(); + register_hooks(hook_mads, remotes_location); + return; } @@ -198,6 +198,8 @@ UserPool::UserPool(SqlDB * db, goto error_serveradmin; } + register_hooks(hook_mads, remotes_location); + return; error_no_file: diff --git a/src/um/test/SConstruct b/src/um/test/SConstruct index 5d0ff663e0..2be90802b2 100644 --- a/src/um/test/SConstruct +++ b/src/um/test/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 diff --git a/src/um/test/UserPoolTest.cc b/src/um/test/UserPoolTest.cc index ec722153d9..b7679e5618 100644 --- a/src/um/test/UserPoolTest.cc +++ b/src/um/test/UserPoolTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vm/History.cc b/src/vm/History.cc index de8ee9ea52..c0abffbde8 100644 --- a/src/vm/History.cc +++ b/src/vm/History.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vm/SConstruct b/src/vm/SConstruct index 58840389ca..c203d310df 100644 --- a/src/vm/SConstruct +++ b/src/vm/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/vm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index e770a97259..835e1d2bb4 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -43,6 +43,7 @@ VirtualMachine::VirtualMachine(int id, int _gid, const string& _uname, const string& _gname, + int umask, VirtualMachineTemplate * _vm_template): PoolObjectSQL(id,VM,"",_uid,_gid,_uname,_gname,table), last_poll(0), @@ -68,6 +69,10 @@ VirtualMachine::VirtualMachine(int id, { obj_template = new VirtualMachineTemplate; } + + user_obj_template = new Template(false,'=',"USER_TEMPLATE"); + + set_umask(umask); } VirtualMachine::~VirtualMachine() @@ -77,15 +82,20 @@ VirtualMachine::~VirtualMachine() delete history_records[i]; } - if ( _log != 0 ) + if (_log != 0) { delete _log; } - if ( obj_template != 0 ) + if (obj_template != 0) { delete obj_template; } + + if (user_obj_template != 0) + { + delete user_obj_template; + } } /* ************************************************************************** */ @@ -211,10 +221,12 @@ int VirtualMachine::insert(SqlDB * db, string& error_str) { int rc; string name; + string prefix; + + string value; + int ivalue; + float fvalue; - string value; - int ivalue; - float fvalue; ostringstream oss; // ------------------------------------------------------------------------ @@ -228,15 +240,22 @@ int VirtualMachine::insert(SqlDB * db, string& error_str) get_template_attribute("NAME",name); - if ( name.empty() == true ) + if (name.empty() == true) { + get_template_attribute("TEMPLATE_NAME", prefix); + + if (prefix.empty()) + { + prefix = "one"; + } + oss.str(""); - oss << "one-" << oid; + oss << prefix << "-" << oid; name = oss.str(); replace_template_attribute("NAME", name); } - else if ( name.length() > 128 ) + else if (name.length() > 128) { goto error_name_length; } @@ -916,8 +935,9 @@ int VirtualMachine::automatic_requirements(string& error_str) return 0; error_disk: - oss << "Incompatible clusters in DISKs. Datastore for DISK[" - << incomp_id <<"] should be in cluster " << cluster_id << "."; + oss << "Incompatible clusters in DISK. Datastore for DISK "<< incomp_id + << " is not the same as the one used by other VM elements (cluster " + << cluster_id << ")"; goto error_common; error_kernel: @@ -931,8 +951,9 @@ error_initrd: goto error_common; error_nic: - oss << "Incompatible clusters in NICs. Network for NIC[" << incomp_id <<"]" - << " should be in cluster " << cluster_id << "."; + oss << "Incompatible clusters in NIC. Network for NIC "<< incomp_id + << " is not the same as the one used by other VM elements (cluster " + << cluster_id << ")"; goto error_common; error_common: @@ -2209,6 +2230,7 @@ error_yy: string& VirtualMachine::to_xml_extended(string& xml, int n_history) const { string template_xml; + string user_template_xml; string history_xml; string perm_xml; ostringstream oss; @@ -2232,7 +2254,8 @@ string& VirtualMachine::to_xml_extended(string& xml, int n_history) const << "" << cpu << "" << "" << net_tx << "" << "" << net_rx << "" - << obj_template->to_xml(template_xml); + << obj_template->to_xml(template_xml) + << user_obj_template->to_xml(user_template_xml); if ( hasHistory() && n_history > 0 ) { @@ -2308,21 +2331,34 @@ int VirtualMachine::from_xml(const string &xml_str) state = static_cast(istate); lcm_state = static_cast(ilcmstate); - // Get associated classes + // Virtual Machine template ObjectXML::get_nodes("/VM/TEMPLATE", content); if (content.empty()) { return -1; } - - // Virtual Machine template rc += obj_template->from_xml_node(content[0]); - // Last history entry ObjectXML::free_nodes(content); content.clear(); + // Virtual Machine user template + + ObjectXML::get_nodes("/VM/USER_TEMPLATE", content); + + if (content.empty()) + { + return -1; + } + + rc += user_obj_template->from_xml_node(content[0]); + + ObjectXML::free_nodes(content); + content.clear(); + + // Last history entry + ObjectXML::get_nodes("/VM/HISTORY_RECORDS/HISTORY", content); if (!content.empty()) @@ -2356,3 +2392,35 @@ string VirtualMachine::get_system_dir() const return oss.str(); }; + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +int VirtualMachine::replace_template(const string& tmpl_str, string& error) +{ + Template * new_tmpl = new Template(false,'=',"USER_TEMPLATE"); + + if ( new_tmpl == 0 ) + { + error = "Cannot allocate a new template"; + return -1; + } + + if ( new_tmpl->parse_str_or_xml(tmpl_str, error) != 0 ) + { + delete new_tmpl; + return -1; + } + + if (user_obj_template != 0) + { + delete user_obj_template; + } + + user_obj_template = new_tmpl; + + return 0; +} diff --git a/src/vm/VirtualMachineHook.cc b/src/vm/VirtualMachineHook.cc index db65002b1f..1face10cf8 100644 --- a/src/vm/VirtualMachineHook.cc +++ b/src/vm/VirtualMachineHook.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vm/VirtualMachinePool.cc b/src/vm/VirtualMachinePool.cc index 8c40ffcd92..825d694b1b 100644 --- a/src/vm/VirtualMachinePool.cc +++ b/src/vm/VirtualMachinePool.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -46,7 +46,6 @@ VirtualMachinePool::VirtualMachinePool( string on; string cmd; string arg; - string rmt; bool remote; bool state_hook = false; @@ -67,7 +66,7 @@ VirtualMachinePool::VirtualMachinePool( on = vattr->vector_value("ON"); cmd = vattr->vector_value("COMMAND"); arg = vattr->vector_value("ARGUMENTS"); - rmt = vattr->vector_value("REMOTE"); + vattr->vector_value("REMOTE", remote); transform (on.begin(),on.end(),on.begin(),(int(*)(int))toupper); @@ -87,18 +86,6 @@ VirtualMachinePool::VirtualMachinePool( name = cmd; } - remote = false; - - if ( !rmt.empty() ) - { - transform(rmt.begin(),rmt.end(),rmt.begin(),(int(*)(int))toupper); - - if ( rmt == "YES" ) - { - remote = true; - } - } - if (cmd[0] != '/') { ostringstream cmd_os; @@ -223,6 +210,7 @@ int VirtualMachinePool::allocate ( int gid, const string& uname, const string& gname, + int umask, VirtualMachineTemplate * vm_template, int * oid, string& error_str, @@ -233,7 +221,7 @@ int VirtualMachinePool::allocate ( // ------------------------------------------------------------------------ // Build a new Virtual Machine object // ------------------------------------------------------------------------ - vm = new VirtualMachine(-1, uid, gid, uname, gname, vm_template); + vm = new VirtualMachine(-1, uid, gid, uname, gname, umask, vm_template); if ( _submit_on_hold == true || on_hold ) { diff --git a/src/vm/VirtualMachineTemplate.cc b/src/vm/VirtualMachineTemplate.cc index 6b6bc73ca3..a404445588 100644 --- a/src/vm/VirtualMachineTemplate.cc +++ b/src/vm/VirtualMachineTemplate.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vm/test/SConstruct b/src/vm/test/SConstruct index 06f2085cbb..3fa99a15a0 100644 --- a/src/vm/test/SConstruct +++ b/src/vm/test/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 diff --git a/src/vm/test/VirtualMachinePoolTest.cc b/src/vm/test/VirtualMachinePoolTest.cc index 2f67477955..5f5bb15f11 100644 --- a/src/vm/test/VirtualMachinePoolTest.cc +++ b/src/vm/test/VirtualMachinePoolTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vm/vm_file_var_syntax.y b/src/vm/vm_file_var_syntax.y index 89280c5241..c82c8779d8 100644 --- a/src/vm/vm_file_var_syntax.y +++ b/src/vm/vm_file_var_syntax.y @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vm/vm_var_parser.c b/src/vm/vm_var_parser.c index 67ab9e7c5f..f3a5f4a8ae 100644 --- a/src/vm/vm_var_parser.c +++ b/src/vm/vm_var_parser.c @@ -505,7 +505,7 @@ int vm_var__flex_debug = 0; char *vm_var_text; #line 1 "vm_var_parser.l" /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vm/vm_var_parser.l b/src/vm/vm_var_parser.l index d5ac0b12fb..9bcf0e75f7 100644 --- a/src/vm/vm_var_parser.l +++ b/src/vm/vm_var_parser.l @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vm/vm_var_syntax.y b/src/vm/vm_var_syntax.y index 37e4e94bf9..71927d076d 100644 --- a/src/vm/vm_var_syntax.y +++ b/src/vm/vm_var_syntax.y @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vm_template/SConstruct b/src/vm_template/SConstruct index fed0b89705..bb2e4e18c7 100644 --- a/src/vm_template/SConstruct +++ b/src/vm_template/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/vm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/vm_template/VMTemplate.cc b/src/vm_template/VMTemplate.cc index 6cbd0b900e..af638437fd 100644 --- a/src/vm_template/VMTemplate.cc +++ b/src/vm_template/VMTemplate.cc @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------------ */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -28,6 +28,7 @@ VMTemplate::VMTemplate(int id, int _gid, const string& _uname, const string& _gname, + int umask, VirtualMachineTemplate * _template_contents): PoolObjectSQL(id,TEMPLATE,"",_uid,_gid,_uname,_gname,table), regtime(time(0)) @@ -40,6 +41,8 @@ VMTemplate::VMTemplate(int id, { obj_template = new VirtualMachineTemplate; } + + set_umask(umask); } /* ------------------------------------------------------------------------ */ @@ -73,22 +76,17 @@ const char * VMTemplate::db_bootstrap = int VMTemplate::insert(SqlDB *db, string& error_str) { int rc; - ostringstream oss; // --------------------------------------------------------------------- // Check default attributes // --------------------------------------------------------------------- - // ------------ NAME & TEMPLATE_ID -------------------- - oss << oid; - - replace_template_attribute("TEMPLATE_ID",oss.str()); - get_template_attribute("NAME", name); if ( name.empty() == true ) { - oss.str(""); + ostringstream oss; + oss << "template-" << oid; name = oss.str(); } @@ -204,8 +202,8 @@ string& VMTemplate::to_xml(string& xml) const << "" << oid << "" << "" << uid << "" << "" << gid << "" - << "" << uname << "" - << "" << gname << "" + << "" << uname << "" + << "" << gname << "" << "" << name << "" << perms_to_xml(perm_str) << "" << regtime << "" diff --git a/src/vm_template/VMTemplatePool.cc b/src/vm_template/VMTemplatePool.cc index b88f3aec40..11d7003a24 100644 --- a/src/vm_template/VMTemplatePool.cc +++ b/src/vm_template/VMTemplatePool.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -28,6 +28,7 @@ int VMTemplatePool::allocate ( int gid, const string& uname, const string& gname, + int umask, VirtualMachineTemplate * template_contents, int * oid, string& error_str) @@ -40,7 +41,7 @@ int VMTemplatePool::allocate ( // ------------------------------------------------------------------------ // Build a new VMTemplate object // ------------------------------------------------------------------------ - vm_template = new VMTemplate(-1, uid, gid, uname, gname,template_contents); + vm_template = new VMTemplate(-1, uid, gid, uname, gname, umask, template_contents); // Check name vm_template->get_template_attribute("NAME", name); diff --git a/src/vm_template/test/SConstruct b/src/vm_template/test/SConstruct index ca95f5c3be..26477f64bb 100644 --- a/src/vm_template/test/SConstruct +++ b/src/vm_template/test/SConstruct @@ -1,5 +1,5 @@ # -------------------------------------------------------------------------- -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # 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 diff --git a/src/vm_template/test/VMTemplatePoolTest.cc b/src/vm_template/test/VMTemplatePoolTest.cc index 8daeb5ecf0..80023b3e2c 100644 --- a/src/vm_template/test/VMTemplatePoolTest.cc +++ b/src/vm_template/test/VMTemplatePoolTest.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 2cec09ad83..d1030ba911 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -471,6 +471,11 @@ int LibVirtDriver::deployment_description_kvm( file << "\t\t\t" << endl; } + if ( vm->get_vnm_mad() == "ovswitch" ) + { + file << "\t\t\t" << endl; + } + if( !mac.empty() ) { file << "\t\t\t" << endl; diff --git a/src/vmm/LibVirtDriverVMware.cc b/src/vmm/LibVirtDriverVMware.cc index 483db3f357..b53a580086 100644 --- a/src/vmm/LibVirtDriverVMware.cc +++ b/src/vmm/LibVirtDriverVMware.cc @@ -1,7 +1,7 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -77,6 +77,7 @@ int LibVirtDriver::deployment_description_vmware( const VectorAttribute * raw; string data; string default_raw; + string data_vmx; // ------------------------------------------------------------------------ @@ -447,6 +448,12 @@ int LibVirtDriver::deployment_description_vmware( { data = raw->vector_value("DATA"); file << "\t" << data << endl; + + data_vmx = raw->vector_value("DATA_VMX"); + if ( !data_vmx.empty() ) + { + file << "\t" << data_vmx << "" << endl; + } } } diff --git a/src/vmm/SConstruct b/src/vmm/SConstruct index fdebcd1c3e..419cfb4053 100644 --- a/src/vmm/SConstruct +++ b/src/vmm/SConstruct @@ -1,7 +1,7 @@ # SConstruct for src/vmm # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index e656c91ad8..933a2bd911 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -146,6 +146,18 @@ void VirtualMachineManager::trigger(Actions action, int _vid) aname = "CANCEL_PREVIOUS"; break; + case CLEANUP: + aname = "CLEANUP"; + break; + + case CLEANUP_BOTH: + aname = "CLEANUP_BOTH"; + break; + + case CLEANUP_PREVIOUS: + aname = "CLEANUP_PREVIOUS"; + break; + case MIGRATE: aname = "MIGRATE"; break; @@ -234,6 +246,18 @@ void VirtualMachineManager::do_action(const string &action, void * arg) { cancel_previous_action(vid); } + else if (action == "CLEANUP") + { + cleanup_action(vid, false); + } + else if (action == "CLEANUP_BOTH") + { + cleanup_action(vid, true); + } + else if (action == "CLEANUP_PREVIOUS") + { + cleanup_previous_action(vid); + } else if (action == "MIGRATE") { migrate_action(vid); @@ -925,6 +949,183 @@ error_common: /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ +void VirtualMachineManager::cleanup_action( + int vid, bool cancel_previous) +{ + int rc; + + VirtualMachine * vm; + ostringstream os; + + string vm_tmpl; + string * drv_msg; + + string m_hostname = ""; + string m_net_drv = ""; + + const VirtualMachineManagerDriver * vmd; + + Nebula& nd = Nebula::instance(); + + // Get the VM from the pool + vm = vmpool->get(vid,true); + + if (vm == 0) + { + return; + } + + if (!vm->hasHistory()) + { + goto error_history; + } + + // Get the driver for this VM + vmd = get(vm->get_vmm_mad()); + + if ( vmd == 0 ) + { + goto error_driver; + } + + if ( cancel_previous && vm->hasPreviousHistory() ) + { + m_hostname = vm->get_previous_hostname(); + m_net_drv = vm->get_previous_vnm_mad(); + } + + rc = nd.get_tm()->epilog_delete_commands(vm, os, false, false); + + if ( rc != 0 ) + { + goto error_common; + } + + // Invoke driver method + drv_msg = format_message( + vm->get_hostname(), + vm->get_vnm_mad(), + m_hostname, + m_net_drv, + vm->get_deploy_id(), + "", + "", + "", + os.str(), + "", + vm->to_xml(vm_tmpl)); + + vmd->cleanup(vid, *drv_msg); + + delete drv_msg; + + vm->unlock(); + + return; + +error_history: + os.str(""); + os << "cleanup_action, VM has no history"; + goto error_common; + +error_driver: + os.str(""); + os << "cleanup_action, error getting driver " << vm->get_vmm_mad(); + +error_common: + (nd.get_lcm())->trigger(LifeCycleManager::CLEANUP_FAILURE, vid); + + vm->unlock(); + return; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void VirtualMachineManager::cleanup_previous_action( + int vid) +{ + int rc; + + VirtualMachine * vm; + ostringstream os; + + string vm_tmpl; + string * drv_msg; + + const VirtualMachineManagerDriver * vmd; + + Nebula& nd = Nebula::instance(); + + // Get the VM from the pool + vm = vmpool->get(vid,true); + + if (vm == 0) + { + return; + } + + if (!vm->hasHistory() || !vm->hasPreviousHistory()) + { + goto error_history; + } + + // Get the driver for this VM + vmd = get(vm->get_vmm_mad()); + + if ( vmd == 0 ) + { + goto error_driver; + } + + rc = nd.get_tm()->epilog_delete_commands(vm, os, false, true); + + if ( rc != 0 ) + { + goto error_common; + } + + // Invoke driver method + drv_msg = format_message( + vm->get_previous_hostname(), + vm->get_previous_vnm_mad(), + "", + "", + vm->get_deploy_id(), + "", + "", + "", + os.str(), + "", + vm->to_xml(vm_tmpl)); + + vmd->cleanup(vid, *drv_msg); + + delete drv_msg; + + vm->unlock(); + + return; + +error_history: + os.str(""); + os << "cleanup_previous_action, VM has no history"; + goto error_common; + +error_driver: + os.str(""); + os << "cleanup_previous_action, error getting driver " << vm->get_vmm_mad(); + +error_common: + (nd.get_lcm())->trigger(LifeCycleManager::CLEANUP_FAILURE, vid); + + vm->unlock(); + return; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + void VirtualMachineManager::migrate_action( int vid) { @@ -1366,7 +1567,7 @@ void VirtualMachineManager::attach_action( vm_tm_mad = vm->get_tm_mad(); opennebula_hostname = nd.get_nebula_hostname(); - rc = Nebula::instance().get_tm()->prolog_transfer_command( + rc = nd.get_tm()->prolog_transfer_command( vm, disk, vm_tm_mad, diff --git a/src/vmm/VirtualMachineManagerDriver.cc b/src/vmm/VirtualMachineManagerDriver.cc index 89cfd80b2d..14fd61f8c1 100644 --- a/src/vmm/VirtualMachineManagerDriver.cc +++ b/src/vmm/VirtualMachineManagerDriver.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ @@ -106,8 +106,8 @@ void VirtualMachineManagerDriver::get_default( /* Helpers for the protocol function */ /* -------------------------------------------------------------------------- */ -static void log_error(VirtualMachine* vm, - ostringstream& os, +static void log_error(VirtualMachine* vm, + ostringstream& os, istringstream& is, const char * msg) { @@ -186,8 +186,7 @@ void VirtualMachineManagerDriver::protocol( return; } - if ( vm->get_lcm_state() == VirtualMachine::CLEANUP || - vm->get_lcm_state() == VirtualMachine::FAILURE || + if ( vm->get_lcm_state() == VirtualMachine::FAILURE || vm->get_lcm_state() == VirtualMachine::LCM_INIT ) { os.str(""); @@ -373,6 +372,25 @@ void VirtualMachineManagerDriver::protocol( lcm->trigger(LifeCycleManager::DETACH_FAILURE, id); } } + else if ( action == "CLEANUP" ) + { + Nebula &ne = Nebula::instance(); + LifeCycleManager *lcm = ne.get_lcm(); + + if ( result == "SUCCESS" ) + { + vm->log("VMM", Log::ERROR, "Host Successfully cleaned."); + + lcm->trigger(LifeCycleManager::CLEANUP_SUCCESS, id); + } + else + { + log_error(vm, os, is, "Error cleaning Host"); + vmpool->update(vm); + + lcm->trigger(LifeCycleManager::CLEANUP_FAILURE, id); + } + } else if ( action == "POLL" ) { if (result == "SUCCESS") diff --git a/src/vmm/XMLDriver.cc b/src/vmm/XMLDriver.cc index 57d086c3f3..dde76bcbdb 100644 --- a/src/vmm/XMLDriver.cc +++ b/src/vmm/XMLDriver.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vmm/XenDriver.cc b/src/vmm/XenDriver.cc index 7b89e0ebfb..6a9c19a725 100644 --- a/src/vmm/XenDriver.cc +++ b/src/vmm/XenDriver.cc @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ /* */ /* 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 */ diff --git a/src/vmm_mad/dummy/one_vmm_dummy b/src/vmm_mad/dummy/one_vmm_dummy index d70aabf5df..1101efd057 100755 --- a/src/vmm_mad/dummy/one_vmm_dummy +++ b/src/vmm_mad/dummy/one_vmm_dummy @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/vmm_mad/dummy/one_vmm_dummy.rb b/src/vmm_mad/dummy/one_vmm_dummy.rb index 6ada53fcfc..3cabc5b3d6 100755 --- a/src/vmm_mad/dummy/one_vmm_dummy.rb +++ b/src/vmm_mad/dummy/one_vmm_dummy.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # @@ -128,6 +128,12 @@ class DummyDriver < VirtualMachineDriver send_message(ACTION[:detach_disk],result,id) end + def cleanup(id, drv_message) + result = retrieve_result("cleanup") + + send_message(ACTION[:cleanup],result,id) + end + def poll(id, drv_message) result = retrieve_result("poll") @@ -159,13 +165,33 @@ class DummyDriver < VirtualMachineDriver "#{POLL_ATTRIBUTE[:nettx]}=#{prev_nettx+(50*rand(3))} " \ "#{POLL_ATTRIBUTE[:netrx]}=#{prev_netrx+(100*rand(4))} " \ "#{POLL_ATTRIBUTE[:usedmemory]}=#{max_memory * (rand(80)+20)/100} " \ - "#{POLL_ATTRIBUTE[:usedcpu]}=#{max_cpu * (rand(95)+5)/100}" + "#{POLL_ATTRIBUTE[:usedcpu]}=#{max_cpu * (rand(95)+5)/100}" send_message(ACTION[:poll],result,id,monitor_info) end private + # Retrives the result for a given action from the OpenNebula core. Each + # action has a defined set of responses in: + # /tmp/opennebula_dummy_actions/ + # + # Each line of this file represents a response in the form: + # <"sucess|0" | "failure|1" | "-"> [sleep] + # + # - success or 1 returns SUCCESS + # - failure o 0 returns FAILURE + # - "-" returns nothing + # - sleep optional number of seconds to wait before answering + # + # Example: /tmp/opennebula_dummy_actions/deploy + # 0 + # 0 + # 1 120 + # 1 + # - + # 0 + # def retrieve_result(action) begin actions = File.read(DUMMY_ACTIONS_DIR+"/#{action}") @@ -178,20 +204,28 @@ class DummyDriver < VirtualMachineDriver action_id %= actions_array.size if actions_array && actions_array[action_id] - result = actions_array[action_id] - if result == "success" || result == 0 || result == "0" - return RESULT[:success] - else - return RESULT[:failure] - end @actions_counter[action] += 1 + + result = actions_array[action_id].split + + case result[0] + when "success", 1, "1" + sleep result[1].to_i if result[1] + return RESULT[:success] + when "failure", 0, "0" + sleep result[1].to_i if result[1] + return RESULT[:failure] + when "-" + return nil + else + return RESULT[:success] + end else return RESULT[:success] end - end end dd = DummyDriver.new -dd.start_driver \ No newline at end of file +dd.start_driver diff --git a/src/vmm_mad/ec2/one_vmm_ec2 b/src/vmm_mad/ec2/one_vmm_ec2 index 7abe54e0b9..ae1c9896ab 100755 --- a/src/vmm_mad/ec2/one_vmm_ec2 +++ b/src/vmm_mad/ec2/one_vmm_ec2 @@ -1,7 +1,7 @@ #!/bin/bash # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/vmm_mad/ec2/one_vmm_ec2.rb b/src/vmm_mad/ec2/one_vmm_ec2.rb index 467b9e86f8..f6d223b2ec 100755 --- a/src/vmm_mad/ec2/one_vmm_ec2.rb +++ b/src/vmm_mad/ec2/one_vmm_ec2.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby # ---------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # # 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 # diff --git a/src/vmm_mad/ec2/vmm_ec2.conf b/src/vmm_mad/ec2/vmm_ec2.conf index 75052d552b..e80cd87b98 100644 --- a/src/vmm_mad/ec2/vmm_ec2.conf +++ b/src/vmm_mad/ec2/vmm_ec2.conf @@ -1,6 +1,6 @@