diff --git a/include/Cluster.h b/include/Cluster.h index 6d33a87f14..f6134a76fe 100644 --- a/include/Cluster.h +++ b/include/Cluster.h @@ -146,6 +146,30 @@ public: return rc; } + /** + * Returns a copy of the host IDs set + */ + set get_host_ids() + { + return hosts.get_collection_copy(); + } + + /** + * Returns a copy of the datastore IDs set + */ + set get_datastore_ids() + { + return datastores.get_collection_copy(); + } + + /** + * Returns a copy of the vnet IDs set + */ + set get_vnet_ids() + { + return vnets.get_collection_copy(); + } + // ************************************************************************* // DataBase implementation (Public) // ************************************************************************* diff --git a/include/Datastore.h b/include/Datastore.h index 2e7816f8e1..181dbdeba1 100644 --- a/include/Datastore.h +++ b/include/Datastore.h @@ -97,6 +97,14 @@ public: return del_collection_id(id); }; + /** + * Returns a copy of the Image IDs set + */ + set get_image_ids() + { + return get_collection_copy(); + } + /** * Retrieves TM mad name * @return string tm mad name diff --git a/include/Host.h b/include/Host.h index 801f32cc3c..aad9cef2e4 100644 --- a/include/Host.h +++ b/include/Host.h @@ -390,6 +390,14 @@ public: return host_share.test(cpu, mem, disk); } + /** + * Returns a copy of the VM IDs set + */ + set get_vm_ids() + { + return vm_collection.get_collection_copy(); + } + /** * Factory method for host templates */ diff --git a/include/Image.h b/include/Image.h index 500e26eb76..285bd18758 100644 --- a/include/Image.h +++ b/include/Image.h @@ -479,13 +479,21 @@ public: }; /** - * Returns the Datastore ID + * Returns the Datastore name */ const string& get_ds_name() const { return ds_name; }; + /** + * Updates the Datastore name + */ + void set_ds_name(const string& name) + { + ds_name = name; + }; + /** * Clones this image template including image specific attributes: NAME, * TYPE, PATH, FSTYPE, SIZE and PERSISTENT diff --git a/include/RequestManagerRename.h b/include/RequestManagerRename.h index 0034e5b62a..9e9dcf362a 100644 --- a/include/RequestManagerRename.h +++ b/include/RequestManagerRename.h @@ -34,6 +34,8 @@ protected: const string& params = "A:sis") :Request(method_name,params,help) { + pthread_mutex_init(&mutex, 0); + auth_op = AuthRequest::MANAGE; }; @@ -44,7 +46,60 @@ protected: void request_execute(xmlrpc_c::paramList const& _paramList, RequestAttributes& att); - virtual PoolObjectSQL * get(const string& name, int uid, bool lock) = 0; + /** + * Gets and object by name and owner. Default implementation returns no + * object + */ + virtual PoolObjectSQL * get(const string& name, int uid, bool lock) + { + return 0; + } + + /** + * Batch rename of related objects. Default implementation does nothing + */ + virtual void batch_rename(int oid){}; + + /** + * Test if a rename is being perform on a given object. If not it set it. + * @return true if the rename can be performed (no ongoing rename) + */ + bool test_and_set_rename(int oid) + { + pair::iterator,bool> rc; + + pthread_mutex_lock(&mutex); + + rc = rename_ids.insert(oid); + + pthread_mutex_unlock(&mutex); + + return rc.second == true; + } + + /** + * Clear the rename. + */ + void clear_rename(int oid) + { + pthread_mutex_lock(&mutex); + + rename_ids.erase(oid); + + pthread_mutex_unlock(&mutex); + } + +private: + /** + * Mutex to control concurrent access to the ongoing rename operations + */ + pthread_mutex_t mutex; + + /** + * Set of IDs being renamed; + */ + set rename_ids; + }; /* ------------------------------------------------------------------------- */ @@ -62,11 +117,6 @@ public: }; ~VirtualMachineRename(){}; - - PoolObjectSQL * get(const string& name, int uid, bool lock) - { - return 0; - }; }; /* ------------------------------------------------------------------------- */ @@ -152,11 +202,78 @@ public: }; ~DocumentRename(){}; +}; + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +class ClusterRename: public RequestManagerRename +{ +public: + ClusterRename(): + RequestManagerRename("ClusterRename", "Renames a cluster") + { + Nebula& nd = Nebula::instance(); + pool = nd.get_clpool(); + auth_object = PoolObjectSQL::CLUSTER; + }; + + ~ClusterRename(){}; PoolObjectSQL * get(const string& name, int uid, bool lock) { - return 0; + return static_cast(pool)->get(name, lock); }; + + void batch_rename(int oid); +}; + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +class DatastoreRename: public RequestManagerRename +{ +public: + DatastoreRename(): + RequestManagerRename("DatastoreRename", "Renames a datastore") + { + Nebula& nd = Nebula::instance(); + pool = nd.get_dspool(); + auth_object = PoolObjectSQL::DATASTORE; + }; + + ~DatastoreRename(){}; + + PoolObjectSQL * get(const string& name, int uid, bool lock) + { + return static_cast(pool)->get(name, lock); + }; + + void batch_rename(int oid); +}; + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +class HostRename: public RequestManagerRename +{ +public: + HostRename(): + RequestManagerRename("HostRename", "Renames a host") + { + Nebula& nd = Nebula::instance(); + pool = nd.get_hpool(); + auth_object = PoolObjectSQL::HOST; + }; + + ~HostRename(){}; + + PoolObjectSQL * get(const string& name, int uid, bool lock) + { + return static_cast(pool)->get(name, lock); + }; + + void batch_rename(int oid); }; /* -------------------------------------------------------------------------- */ diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 38e943835a..645dc0b377 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -623,6 +623,16 @@ public: return history->hostname; }; + /** + * Updates the current hostname. The hasHistory() + * function MUST be called before this one. + * @param hostname New hostname + */ + void set_hostname(const string& hostname) + { + history->hostname = hostname; + }; + /** * Returns the hostname for the previous host. The hasPreviousHistory() * function MUST be called before this one. diff --git a/share/install_gems/install_gems b/share/install_gems/install_gems index 053a68f670..e435212e33 100755 --- a/share/install_gems/install_gems +++ b/share/install_gems/install_gems @@ -2,7 +2,6 @@ require 'pp' -$nokogiri='nokogiri' DEFAULT=%w{sunstone quota cloud ozones_server auth_ldap vmware oneflow} @@ -12,6 +11,12 @@ else SQLITE='sqlite3-ruby --version 1.2.0' end +if !defined?(RUBY_VERSION) || RUBY_VERSION < '1.9.0' + $nokogiri='nokogiri --version "< 1.6.0"' +else + $nokogiri='nokogiri' +end + GROUPS={ :quota => [SQLITE, 'sequel'], :sunstone => ['json', 'rack', 'sinatra', 'thin', SQLITE], @@ -41,7 +46,7 @@ DISTRIBUTIONS={ SQLITE => ['gcc', 'libsqlite3-dev'], 'mysql' => ['gcc', 'libmysqlclient-dev'], 'curb' => ['gcc', 'libcurl4-openssl-dev'], - 'nokogiri' => %w{gcc rake libxml2-dev libxslt1-dev}, + $nokogiri => %w{gcc rake libxml2-dev libxslt1-dev}, 'xmlparser' => ['gcc', 'libexpat1-dev'], 'thin' => ['g++'], 'json' => ['gcc'] @@ -58,7 +63,7 @@ DISTRIBUTIONS={ SQLITE => ['gcc', 'sqlite-devel'], 'mysql' => ['gcc', 'mysql-devel'], 'curb' => ['gcc', 'curl-devel'], - 'nokogiri' => %w{gcc rubygem-rake libxml2-devel libxslt-devel}, + $nokogiri => %w{gcc rubygem-rake libxml2-devel libxslt-devel}, 'xmlparser' => ['gcc', 'expat-devel'], 'thin' => ['gcc-c++'], 'json' => ['gcc'] @@ -72,7 +77,7 @@ DISTRIBUTIONS={ SQLITE => ['gcc', 'sqlite3-devel'], 'mysql' => ['gcc', 'libmysqlclient-devel'], 'curb' => ['gcc', 'libcurl-devel'], - 'nokogiri' => %w{rubygem-rake gcc rubygem-rake libxml2-devel libxslt-devel}, + $nokogiri => %w{rubygem-rake gcc rubygem-rake libxml2-devel libxslt-devel}, 'xmlparser' => ['gcc', 'libexpat-devel'], 'thin' => ['rubygem-rake', 'gcc-c++'], 'json' => ['gcc'] diff --git a/src/cli/one_helper.rb b/src/cli/one_helper.rb index be3e96dc01..d153dc70b9 100644 --- a/src/cli/one_helper.rb +++ b/src/cli/one_helper.rb @@ -248,6 +248,19 @@ EOT :large => '--boot device', :description => 'Select boot device (hd|fd|cdrom|network)', :format => String + }, + { + :name => 'files_ds', + :large => '--files_ds file1,file2', + :format => Array, + :description => 'Add files to the contextualization CD from the' << + 'files datastore' + }, + { + :name => 'init', + :large => '--init script1,script2', + :format => Array, + :description => 'Script or scripts to start in context' } ] @@ -774,7 +787,8 @@ EOT end def self.create_context(options) - if !(options.keys & [:ssh, :net_context, :context]).empty? + context_options = [:ssh, :net_context, :context, :init, :files_ds] + if !(options.keys & context_options).empty? lines=[] if options[:ssh] @@ -792,11 +806,25 @@ EOT end if options[:net_context] - lines << "NETWORK = \"YES\"" + lines << "NETWORK = \"YES\"" end lines+=options[:context] if options[:context] + if options[:files_ds] + text='FILES_DS="' + text << options[:files_ds].map do |file| + %Q<$FILE[IMAGE=\\"#{file}\\"]> + end.join(' ') + text << '"' + + lines << text + end + + if options[:init] + lines << %Q + end + if !lines.empty? "CONTEXT=[\n"<5 do |d| - if d["USERS"]["ID"].nil? - "0" + ids = d["USERS"]["ID"] + + case ids + when String + "1" + when Array + ids.size else - d["USERS"]["ID"].size + "0" end end diff --git a/src/cli/onecluster b/src/cli/onecluster index 4e61e09e09..5624ec649b 100755 --- a/src/cli/onecluster +++ b/src/cli/onecluster @@ -197,4 +197,14 @@ cmd=CommandParser::CmdParser.new(ARGV) do obj.update(str, options[:append]) end end + + rename_desc = <<-EOT.unindent + Renames the Cluster + EOT + + command :rename, rename_desc, :clusterid, :name do + helper.perform_action(args[0],options,"renamed") do |o| + o.rename(args[1]) + end + end end diff --git a/src/cli/onedatastore b/src/cli/onedatastore index 77e4c4b2c2..7c09d0cb16 100755 --- a/src/cli/onedatastore +++ b/src/cli/onedatastore @@ -174,4 +174,14 @@ cmd=CommandParser::CmdParser.new(ARGV) do obj.update(str, options[:append]) end end + + rename_desc = <<-EOT.unindent + Renames the Datastore + EOT + + command :rename, rename_desc, :datastoreid, :name do + helper.perform_action(args[0],options,"renamed") do |o| + o.rename(args[1]) + end + end end diff --git a/src/cli/onehost b/src/cli/onehost index 9c9a4d9463..108db2d3fd 100755 --- a/src/cli/onehost +++ b/src/cli/onehost @@ -213,4 +213,14 @@ cmd=CommandParser::CmdParser.new(ARGV) do host.flush end end + + rename_desc = <<-EOT.unindent + Renames the Host + EOT + + command :rename, rename_desc, :hostid, :name do + helper.perform_action(args[0],options,"renamed") do |o| + o.rename(args[1]) + end + end end diff --git a/src/datastore_mad/remotes/ceph/cp b/src/datastore_mad/remotes/ceph/cp index a388c840d6..5d81aa186a 100755 --- a/src/datastore_mad/remotes/ceph/cp +++ b/src/datastore_mad/remotes/ceph/cp @@ -51,7 +51,7 @@ while IFS= read -r -d '' element; do done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/POOL_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/STAGING_DIR \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ @@ -66,7 +66,7 @@ unset i BASE_PATH="${XPATH_ELEMENTS[i++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[i++]}" SAFE_DIRS="${XPATH_ELEMENTS[i++]}" -DST_HOST="${XPATH_ELEMENTS[i++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[i++]}" POOL_NAME="${XPATH_ELEMENTS[i++]:-$POOL_NAME}" STAGING_DIR="${XPATH_ELEMENTS[i++]:-$STAGING_DIR}" SRC="${XPATH_ELEMENTS[i++]}" @@ -76,8 +76,10 @@ SHA1="${XPATH_ELEMENTS[i++]}" NO_DECOMPRESS="${XPATH_ELEMENTS[i++]}" LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[i++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/iscsi/cp b/src/datastore_mad/remotes/iscsi/cp index dfaec846a6..9f8587abc6 100755 --- a/src/datastore_mad/remotes/iscsi/cp +++ b/src/datastore_mad/remotes/iscsi/cp @@ -51,7 +51,7 @@ while IFS= read -r -d '' element; do done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ @@ -64,7 +64,7 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ BASE_PATH="${XPATH_ELEMENTS[j++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[j++]}" SAFE_DIRS="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" BASE_IQN="${XPATH_ELEMENTS[j++]:-$BASE_IQN}" SRC="${XPATH_ELEMENTS[j++]}" @@ -74,8 +74,10 @@ SHA1="${XPATH_ELEMENTS[j++]}" NO_DECOMPRESS="${XPATH_ELEMENTS[j++]}" LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[j++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/lvm/cp b/src/datastore_mad/remotes/lvm/cp index 7c9d95b0dd..5ed8ab9561 100755 --- a/src/datastore_mad/remotes/lvm/cp +++ b/src/datastore_mad/remotes/lvm/cp @@ -51,7 +51,7 @@ while IFS= read -r -d '' element; do done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ /DS_DRIVER_ACTION_DATA/IMAGE/SIZE \ @@ -63,7 +63,7 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ BASE_PATH="${XPATH_ELEMENTS[j++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[j++]}" SAFE_DIRS="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" SRC="${XPATH_ELEMENTS[j++]}" SIZE="${XPATH_ELEMENTS[j++]}" @@ -72,8 +72,10 @@ SHA1="${XPATH_ELEMENTS[j++]}" NO_DECOMPRESS="${XPATH_ELEMENTS[j++]}" LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[j++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/image/Image.cc b/src/image/Image.cc index cacc154504..5d89810b65 100644 --- a/src/image/Image.cc +++ b/src/image/Image.cc @@ -177,12 +177,17 @@ int Image::insert(SqlDB *db, string& error_str) { if ( source.empty() && path.empty() ) { + if (type != DATABLOCK) + { + goto error_no_path; + } + erase_template_attribute("FSTYPE", fs_type); // DATABLOCK image needs FSTYPE - if (type != DATABLOCK || fs_type.empty()) + if (fs_type.empty()) { - goto error_no_path; + fs_type = "raw"; } } else if ( !source.empty() && !path.empty() ) @@ -210,15 +215,7 @@ error_type: goto error_common; error_no_path: - if ( type == DATABLOCK ) - { - error_str = "A DATABLOCK type IMAGE has to declare a PATH, or both " - "SIZE and FSTYPE."; - } - else - { - error_str = "No PATH in template."; - } + error_str = "No PATH in template."; goto error_common; error_path_and_source: 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 15ea8b3e31..094016ae1a 100644 --- a/src/oca/java/src/org/opennebula/client/cluster/Cluster.java +++ b/src/oca/java/src/org/opennebula/client/cluster/Cluster.java @@ -37,6 +37,7 @@ public class Cluster extends PoolElement{ private static final String DELDATASTORE = METHOD_PREFIX + "deldatastore"; private static final String ADDVNET = METHOD_PREFIX + "addvnet"; private static final String DELVNET = METHOD_PREFIX + "delvnet"; + private static final String RENAME = METHOD_PREFIX + "rename"; /** * Creates a new Cluster representation. @@ -199,6 +200,19 @@ public class Cluster extends PoolElement{ return client.call(DELVNET, id, vnetId); } + /** + * Renames this Cluster. + * + * @param client XML-RPC Client. + * @param id The image id of the target host we want to modify. + * @param name New name for the Cluster + * @return If successful the message contains the cluster id. + */ + public static OneResponse rename(Client client, int id, String name) + { + return client.call(RENAME, id, name); + } + // ================================= // Instanced object XML-RPC methods // ================================= @@ -315,6 +329,17 @@ public class Cluster extends PoolElement{ return delVnet(client, id, vnetId); } + /** + * Renames this Cluster + * + * @param name New name for the Cluster. + * @return If an error occurs the error message contains the reason. + */ + public OneResponse rename(String name) + { + return rename(client, id, name); + } + // ================================= // Helpers // ================================= 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 26a03b8b60..f68b42303f 100644 --- a/src/oca/java/src/org/opennebula/client/datastore/Datastore.java +++ b/src/oca/java/src/org/opennebula/client/datastore/Datastore.java @@ -35,6 +35,7 @@ public class Datastore extends PoolElement private static final String UPDATE = METHOD_PREFIX + "update"; private static final String CHOWN = METHOD_PREFIX + "chown"; private static final String CHMOD = METHOD_PREFIX + "chmod"; + private static final String RENAME = METHOD_PREFIX + "rename"; private static final String[] DATASTORE_TYPES = {"IMAGE", "SYSTEM", "FILE"}; @@ -212,6 +213,19 @@ public class Datastore extends PoolElement return chmod(client, CHMOD, id, octet); } + /** + * Renames this Datastore. + * + * @param client XML-RPC Client. + * @param id The image id of the target host we want to modify. + * @param name New name for the Datastore + * @return If successful the message contains the datastore id. + */ + public static OneResponse rename(Client client, int id, String name) + { + return client.call(RENAME, id, name); + } + // ================================= // Instanced object XML-RPC methods // ================================= @@ -373,6 +387,17 @@ public class Datastore extends PoolElement return chmod(client, id, octet); } + /** + * Renames this Datastore + * + * @param name New name for the Datastore. + * @return If an error occurs the error message contains the reason. + */ + public OneResponse rename(String name) + { + return rename(client, id, name); + } + // ================================= // Helpers // ================================= 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 df36d87eae..f9aba9eb8f 100644 --- a/src/oca/java/src/org/opennebula/client/host/Host.java +++ b/src/oca/java/src/org/opennebula/client/host/Host.java @@ -34,6 +34,7 @@ public class Host extends PoolElement{ private static final String ENABLE = METHOD_PREFIX + "enable"; private static final String UPDATE = METHOD_PREFIX + "update"; private static final String MONITORING = METHOD_PREFIX + "monitoring"; + private static final String RENAME = METHOD_PREFIX + "rename"; private static final String[] HOST_STATES = {"INIT", "MONITORING_MONITORED", "MONITORED", "ERROR", "DISABLED", @@ -189,6 +190,19 @@ public class Host extends PoolElement{ return client.call(MONITORING, id); } + /** + * Renames this Host. + * + * @param client XML-RPC Client. + * @param id The image id of the target host we want to modify. + * @param name New name for the Host + * @return If successful the message contains the host id. + */ + public static OneResponse rename(Client client, int id, String name) + { + return client.call(RENAME, id, name); + } + // ================================= // Instanced object XML-RPC methods // ================================= @@ -280,6 +294,17 @@ public class Host extends PoolElement{ return monitoring(client, id); } + /** + * Renames this Host. + * + * @param name New name for the Host + * @return If successful the message contains the host id. + */ + public OneResponse rename(String name) + { + return rename(client, id, name); + } + // ================================= // Helpers // ================================= diff --git a/src/oca/ruby/opennebula/cluster.rb b/src/oca/ruby/opennebula/cluster.rb index 9f0997d96c..25c9d758f8 100644 --- a/src/oca/ruby/opennebula/cluster.rb +++ b/src/oca/ruby/opennebula/cluster.rb @@ -34,6 +34,7 @@ module OpenNebula :addvnet => "cluster.addvnet", :delvnet => "cluster.delvnet", :update => "cluster.update", + :rename => "cluster.rename" } # Creates a Cluster description with just its identifier @@ -171,6 +172,16 @@ module OpenNebula super(CLUSTER_METHODS[:update], new_template, append ? 1 : 0) end + # Renames this Cluster + # + # @param name [String] New name for the Cluster. + # + # @return [nil, OpenNebula::Error] nil in case of success, Error + # otherwise + def rename(name) + return call(CLUSTER_METHODS[:rename], @pe_id, name) + end + # --------------------------------------------------------------------- # Helpers to get information # --------------------------------------------------------------------- diff --git a/src/oca/ruby/opennebula/datastore.rb b/src/oca/ruby/opennebula/datastore.rb index 6bf2a9abca..fe702abfaa 100644 --- a/src/oca/ruby/opennebula/datastore.rb +++ b/src/oca/ruby/opennebula/datastore.rb @@ -29,7 +29,8 @@ module OpenNebula :delete => "datastore.delete", :update => "datastore.update", :chown => "datastore.chown", - :chmod => "datastore.chmod" + :chmod => "datastore.chmod", + :rename => "datastore.rename" } DATASTORE_TYPES=%w{IMAGE SYSTEM FILE} @@ -146,6 +147,16 @@ module OpenNebula group_m, group_a, other_u, other_m, other_a) end + # Renames this datastore + # + # @param name [String] New name for the datastore + # + # @return [nil, OpenNebula::Error] nil in case of success, Error + # otherwise + def rename(name) + return call(DATASTORE_METHODS[:rename], @pe_id, name) + end + # --------------------------------------------------------------------- # Helpers to get information # --------------------------------------------------------------------- diff --git a/src/oca/ruby/opennebula/host.rb b/src/oca/ruby/opennebula/host.rb index 94ab6f6323..7476e01c9e 100644 --- a/src/oca/ruby/opennebula/host.rb +++ b/src/oca/ruby/opennebula/host.rb @@ -30,7 +30,8 @@ module OpenNebula :delete => "host.delete", :enable => "host.enable", :update => "host.update", - :monitoring => "host.monitoring" + :monitoring => "host.monitoring", + :rename => "host.rename" } HOST_STATES=%w{INIT MONITORING_MONITORED MONITORED ERROR DISABLED MONITORING_ERROR MONITORING_INIT MONITORING_DISABLED} @@ -176,6 +177,16 @@ module OpenNebula return @client.call(HOST_METHODS[:monitoring], @pe_id) end + # Renames this Host + # + # @param name [String] New name for the Host. + # + # @return [nil, OpenNebula::Error] nil in case of success, Error + # otherwise + def rename(name) + return call(HOST_METHODS[:rename], @pe_id, name) + end + ####################################################################### # Helpers to get Host information ####################################################################### diff --git a/src/onedb/fsck.rb b/src/onedb/fsck.rb index 649643234b..1d29fd41fd 100644 --- a/src/onedb/fsck.rb +++ b/src/onedb/fsck.rb @@ -308,9 +308,11 @@ module OneDBFsck cluster = {} - @db.fetch("SELECT oid FROM cluster_pool") do |row| + @db.fetch("SELECT oid, name FROM cluster_pool") do |row| cluster[row[:oid]] = {} + cluster[row[:oid]][:name] = row[:name] + cluster[row[:oid]][:hosts] = [] cluster[row[:oid]][:datastores] = [] cluster[row[:oid]][:vnets] = [] @@ -322,13 +324,21 @@ module OneDBFsck datastores_fix = {} vnets_fix = {} - @db.fetch("SELECT oid,body FROM host_pool") do |row| + @db.fetch("SELECT oid,body,cid FROM host_pool") do |row| doc = Document.new(row[:body]) cluster_id = doc.root.get_text('CLUSTER_ID').to_s.to_i + cluster_name = doc.root.get_text('CLUSTER') + + if cluster_id != row[:cid] + log_error("Host #{row[:oid]} is in cluster #{cluster_id}, but cid column has cluster #{row[:cid]}") + hosts_fix[row[:oid]] = {:body => row[:body], :cid => cluster_id} + end if cluster_id != -1 - if cluster[cluster_id].nil? + cluster_entry = cluster[cluster_id] + + if cluster_entry.nil? log_error("Host #{row[:oid]} is in cluster #{cluster_id}, but it does not exist") doc.root.each_element('CLUSTER_ID') do |e| @@ -339,25 +349,43 @@ module OneDBFsck e.text = "" end - hosts_fix[row[:oid]] = doc.to_s + hosts_fix[row[:oid]] = {:body => doc.to_s, :cid => -1} else - cluster[cluster_id][:hosts] << row[:oid] + if cluster_name != cluster_entry[:name] + log_error("Host #{row[:oid]} has a wrong name for cluster #{cluster_id}, #{cluster_name}. It will be changed to #{cluster_entry[:name]}") + + doc.root.each_element('CLUSTER') do |e| + e.text = cluster_entry[:name] + end + + hosts_fix[row[:oid]] = {:body => doc.to_s, :cid => cluster_id} + end + + cluster_entry[:hosts] << row[:oid] end end end - hosts_fix.each do |id, body| - @db[:host_pool].where(:oid => id).update(:body => body, :cid => -1) + hosts_fix.each do |id, entry| + @db[:host_pool].where(:oid => id).update(:body => entry[:body], :cid => entry[:cid]) end - @db.fetch("SELECT oid,body FROM datastore_pool") do |row| + @db.fetch("SELECT oid,body,cid FROM datastore_pool") do |row| doc = Document.new(row[:body]) cluster_id = doc.root.get_text('CLUSTER_ID').to_s.to_i + cluster_name = doc.root.get_text('CLUSTER') + + if cluster_id != row[:cid] + log_error("Datastore #{row[:oid]} is in cluster #{cluster_id}, but cid column has cluster #{row[:cid]}") + hosts_fix[row[:oid]] = {:body => row[:body], :cid => cluster_id} + end if cluster_id != -1 - if cluster[cluster_id].nil? + cluster_entry = cluster[cluster_id] + + if cluster_entry.nil? log_error("Datastore #{row[:oid]} is in cluster #{cluster_id}, but it does not exist") doc.root.each_element('CLUSTER_ID') do |e| @@ -368,16 +396,16 @@ module OneDBFsck e.text = "" end - datastores_fix[row[:oid]] = doc.to_s + datastores_fix[row[:oid]] = {:body => doc.to_s, :cid => -1} else if doc.root.get_text('TYPE').to_s != "1" - cluster[cluster_id][:datastores] << row[:oid] + cluster_entry[:datastores] << row[:oid] else - if cluster[cluster_id][:system_ds] == 0 - cluster[cluster_id][:datastores] << row[:oid] - cluster[cluster_id][:system_ds] = row[:oid] + if cluster_entry[:system_ds] == 0 + cluster_entry[:datastores] << row[:oid] + cluster_entry[: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]}") + log_error("System Datastore #{row[:oid]} is in Cluster #{cluster_id}, but it already contains System Datastore #{cluster_entry[:system_ds]}") doc.root.each_element('CLUSTER_ID') do |e| e.text = "-1" @@ -387,25 +415,45 @@ module OneDBFsck e.text = "" end - datastores_fix[row[:oid]] = doc.to_s + datastores_fix[row[:oid]] = {:body => doc.to_s, :cid => -1} + + next end end + + if cluster_name != cluster_entry[:name] + log_error("Datastore #{row[:oid]} has a wrong name for cluster #{cluster_id}, #{cluster_name}. It will be changed to #{cluster_entry[:name]}") + + doc.root.each_element('CLUSTER') do |e| + e.text = cluster_entry[:name] + end + + datastores_fix[row[:oid]] = {:body => doc.to_s, :cid => cluster_id} + end end end end - datastores_fix.each do |id, body| - @db[:datastore_pool].where(:oid => id).update(:body => body, :cid => -1) + datastores_fix.each do |id, entry| + @db[:datastore_pool].where(:oid => id).update(:body => entry[:body], :cid => entry[:cid]) end - @db.fetch("SELECT oid,body FROM network_pool") do |row| + @db.fetch("SELECT oid,body,cid FROM network_pool") do |row| doc = Document.new(row[:body]) cluster_id = doc.root.get_text('CLUSTER_ID').to_s.to_i + cluster_name = doc.root.get_text('CLUSTER') + + if cluster_id != row[:cid] + log_error("VNet #{row[:oid]} is in cluster #{cluster_id}, but cid column has cluster #{row[:cid]}") + hosts_fix[row[:oid]] = {:body => row[:body], :cid => cluster_id} + end if cluster_id != -1 - if cluster[cluster_id].nil? + cluster_entry = cluster[cluster_id] + + if cluster_entry.nil? log_error("VNet #{row[:oid]} is in cluster #{cluster_id}, but it does not exist") doc.root.each_element('CLUSTER_ID') do |e| @@ -416,15 +464,25 @@ module OneDBFsck e.text = "" end - vnets_fix[row[:oid]] = doc.to_s + vnets_fix[row[:oid]] = {:body => doc.to_s, :cid => -1} else - cluster[cluster_id][:vnets] << row[:oid] + if cluster_name != cluster_entry[:name] + log_error("VNet #{row[:oid]} has a wrong name for cluster #{cluster_id}, #{cluster_name}. It will be changed to #{cluster_entry[:name]}") + + doc.root.each_element('CLUSTER') do |e| + e.text = cluster_entry[:name] + end + + vnets_fix[row[:oid]] = {:body => doc.to_s, :cid => -1} + end + + cluster_entry[:vnets] << row[:oid] end end end - vnets_fix.each do |id, body| - @db[:network_pool].where(:oid => id).update(:body => body, :cid => -1) + vnets_fix.each do |id, entry| + @db[:network_pool].where(:oid => id).update(:body => entry[:body], :cid => entry[:cid]) end @@ -528,35 +586,49 @@ module OneDBFsck datastore = {} - @db.fetch("SELECT oid FROM datastore_pool") do |row| - datastore[row[:oid]] = [] + @db.fetch("SELECT oid, name FROM datastore_pool") do |row| + datastore[row[:oid]] = {:name => row[:name], :images => []} end - images_fix = {} + ds_1_name = datastore[1][:name] + images_fix = {} @db.fetch("SELECT oid,body FROM image_pool") do |row| doc = Document.new(row[:body]) ds_id = doc.root.get_text('DATASTORE_ID').to_s.to_i + ds_name = doc.root.get_text('DATASTORE') if ds_id != -1 - if datastore[ds_id].nil? - log_error("Image #{row[:oid]} has datastore #{ds_id}, but it does not exist. It will be moved to the Datastore default (1), but it is probably unusable anymore") + ds_entry = datastore[ds_id] + + if ds_entry.nil? + log_error("Image #{row[:oid]} has datastore #{ds_id}, but it does not exist. It will be moved to the Datastore #{ds_1_name} (1), but it is probably unusable anymore") doc.root.each_element('DATASTORE_ID') do |e| e.text = "1" end doc.root.each_element('DATASTORE') do |e| - e.text = "default" + e.text = ds_1_name end images_fix[row[:oid]] = doc.to_s - datastore[1] << row[:oid] + datastore[1][:images] << row[:oid] else - datastore[ds_id] << row[:oid] + if ds_name != ds_entry[:name] + log_error("Image #{row[:oid]} has a wrong name for datastore #{ds_id}, #{ds_name}. It will be changed to #{ds_entry[:name]}") + + doc.root.each_element('DATASTORE') do |e| + e.text = ds_entry[:name] + end + + images_fix[row[:oid]] = doc.to_s + end + + ds_entry[:images] << row[:oid] end end end @@ -576,7 +648,7 @@ module OneDBFsck images_new_elem = doc.root.add_element("IMAGES") - datastore[ds_id].each do |id| + datastore[ds_id][:images].each do |id| id_elem = images_elem.elements.delete("ID[.=#{id}]") if id_elem.nil? @@ -611,8 +683,9 @@ module OneDBFsck counters[:vnet] = {} # Initialize all the host counters to 0 - @db.fetch("SELECT oid FROM host_pool") do |row| + @db.fetch("SELECT oid, name FROM host_pool") do |row| counters[:host][row[:oid]] = { + :name => row[:name], :memory => 0, :cpu => 0, :rvms => Set.new @@ -655,6 +728,8 @@ module OneDBFsck } end + vms_fix = {} + # Aggregate information of the RUNNING vms @db.fetch("SELECT oid,body FROM vm_pool WHERE state<>6") do |row| vm_doc = Document.new(row[:body]) @@ -713,21 +788,41 @@ module OneDBFsck cpu = e.text.to_f } - # Get hostid + # Get hostid, hostname hid = -1 vm_doc.root.each_element("HISTORY_RECORDS/HISTORY[last()]/HID") { |e| hid = e.text.to_i } - if counters[:host][hid].nil? + hostname = "" + vm_doc.root.each_element("HISTORY_RECORDS/HISTORY[last()]/HOSTNAME") { |e| + hostname = e.text + } + + counters_host = counters[:host][hid] + + if counters_host.nil? log_error("VM #{row[:oid]} is using Host #{hid}, but it does not exist") else - counters[:host][hid][:memory] += memory - counters[:host][hid][:cpu] += cpu - counters[:host][hid][:rvms].add(row[:oid]) + if counters_host[:name] != hostname + log_error("VM #{row[:oid]} has a wrong hostname for Host #{hid}, #{hostname}. It will be changed to #{counters_host[:name]}") + + vm_doc.root.each_element("HISTORY_RECORDS/HISTORY[last()]/HOSTNAME") { |e| + e.text = counters_host[:name] + } + + vms_fix[row[:oid]] = vm_doc.to_s + end + + counters_host[:memory] += memory + counters_host[:cpu] += cpu + counters_host[:rvms].add(row[:oid]) end end + vms_fix.each do |id, body| + @db[:vm_pool].where(:oid => id).update(:body => body) + end ######################################################################## @@ -752,9 +847,11 @@ module OneDBFsck hid = row[:oid] - rvms = counters[:host][hid][:rvms].size - cpu_usage = (counters[:host][hid][:cpu]*100).to_i - mem_usage = counters[:host][hid][:memory]*1024 + counters_host = counters[:host][hid] + + rvms = counters_host[:rvms].size + cpu_usage = (counters_host[:cpu]*100).to_i + mem_usage = counters_host[:memory]*1024 # rewrite running_vms host_doc.root.each_element("HOST_SHARE/RUNNING_VMS") {|e| @@ -770,7 +867,7 @@ module OneDBFsck vms_new_elem = host_doc.root.add_element("VMS") - counters[:host][hid][:rvms].each do |id| + counters_host[:rvms].each do |id| id_elem = vms_elem.elements.delete("ID[.=#{id}]") if id_elem.nil? diff --git a/src/rm/RequestManager.cc b/src/rm/RequestManager.cc index 31dc020d6f..bdd4b5e3f9 100644 --- a/src/rm/RequestManager.cc +++ b/src/rm/RequestManager.cc @@ -407,6 +407,9 @@ void RequestManager::register_xml_methods() xmlrpc_c::methodPtr vn_rename(new VirtualNetworkRename()); xmlrpc_c::methodPtr image_rename(new ImageRename()); xmlrpc_c::methodPtr doc_rename(new DocumentRename()); + xmlrpc_c::methodPtr cluster_rename(new ClusterRename()); + xmlrpc_c::methodPtr datastore_rename(new DatastoreRename()); + xmlrpc_c::methodPtr host_rename(new HostRename()); /* VM related methods */ RequestManagerRegistry.addMethod("one.vm.deploy", vm_deploy); @@ -454,6 +457,7 @@ void RequestManager::register_xml_methods() RequestManagerRegistry.addMethod("one.host.delete", host_delete); RequestManagerRegistry.addMethod("one.host.info", host_info); RequestManagerRegistry.addMethod("one.host.monitoring", host_monitoring); + RequestManagerRegistry.addMethod("one.host.rename", host_rename); RequestManagerRegistry.addMethod("one.hostpool.info", hostpool_info); RequestManagerRegistry.addMethod("one.hostpool.monitoring", host_pool_monitoring); @@ -528,6 +532,7 @@ void RequestManager::register_xml_methods() RequestManagerRegistry.addMethod("one.datastore.update", datastore_update); RequestManagerRegistry.addMethod("one.datastore.chown", datastore_chown); RequestManagerRegistry.addMethod("one.datastore.chmod", datastore_chmod); + RequestManagerRegistry.addMethod("one.datastore.rename", datastore_rename); RequestManagerRegistry.addMethod("one.datastorepool.info",datastorepool_info); @@ -536,6 +541,7 @@ void RequestManager::register_xml_methods() RequestManagerRegistry.addMethod("one.cluster.delete", cluster_delete); RequestManagerRegistry.addMethod("one.cluster.info", cluster_info); RequestManagerRegistry.addMethod("one.cluster.update", cluster_update); + RequestManagerRegistry.addMethod("one.cluster.rename", cluster_rename); RequestManagerRegistry.addMethod("one.cluster.addhost", cluster_addhost); RequestManagerRegistry.addMethod("one.cluster.delhost", cluster_delhost); diff --git a/src/rm/RequestManagerRename.cc b/src/rm/RequestManagerRename.cc index c5c899adcf..0685f3fa75 100644 --- a/src/rm/RequestManagerRename.cc +++ b/src/rm/RequestManagerRename.cc @@ -36,16 +36,27 @@ void RequestManagerRename::request_execute(xmlrpc_c::paramList const& paramList, PoolObjectAuth operms; PoolObjectSQL * object; + if (test_and_set_rename(oid) == false) + { + failure_response(INTERNAL, + request_error("Object is being renamed", ""), att); + + return; + } + rc = get_info(pool, oid, auth_object, att, operms, old_name); if ( rc == -1 ) { + clear_rename(oid); return; } if (old_name == new_name) { success_response(oid, att); + + clear_rename(oid); return; } @@ -62,12 +73,12 @@ void RequestManagerRename::request_execute(xmlrpc_c::paramList const& paramList, failure_response(AUTHORIZATION, authorization_error(ar.message, att), att); - + clear_rename(oid); return; } } - // --------------- Check name uniqueness ----------------------------------- + // ----------------------- Check name uniqueness --------------------------- object = get(new_name, operms.uid, true); @@ -85,10 +96,12 @@ void RequestManagerRename::request_execute(xmlrpc_c::paramList const& paramList, << id; failure_response(ACTION, request_error(oss.str(), ""), att); + + clear_rename(oid); return; } - // --------------- Update the object --------------------------------------- + // -------------------------- Update the object ---------------------------- object = pool->get(oid, true); @@ -97,6 +110,9 @@ void RequestManagerRename::request_execute(xmlrpc_c::paramList const& paramList, failure_response(NO_EXISTS, get_error(object_name(auth_object), oid), att); + + clear_rename(oid); + return; } if ( object->set_name(new_name, error_str) != 0 ) @@ -104,6 +120,8 @@ void RequestManagerRename::request_execute(xmlrpc_c::paramList const& paramList, object->unlock(); failure_response(ACTION, request_error(error_str, ""), att); + + clear_rename(oid); return; } @@ -113,8 +131,174 @@ void RequestManagerRename::request_execute(xmlrpc_c::paramList const& paramList, pool->update_cache_index(old_name, operms.uid, new_name, operms.uid); + batch_rename(oid); + success_response(oid, att); + clear_rename(oid); + return; } +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void ClusterRename::batch_rename(int oid) +{ + Cluster * cluster = static_cast(pool)->get(oid, true); + + if (cluster == 0) + { + return; + } + + const set & hosts = cluster->get_host_ids(); + const set & datastores = cluster->get_datastore_ids(); + const set & vnets = cluster->get_vnet_ids(); + + set::iterator it; + + string cluster_name = cluster->get_name(); + + cluster->unlock(); + + Host * host; + HostPool* hpool = Nebula::instance().get_hpool(); + + Datastore * ds; + DatastorePool* dspool = Nebula::instance().get_dspool(); + + VirtualNetwork* vnet; + VirtualNetworkPool* vnpool = Nebula::instance().get_vnpool(); + + for (it = hosts.begin(); it != hosts.end(); it++) + { + host = hpool->get(*it, true); + + if (host != 0) + { + if (host->get_cluster_id() == oid) + { + host->set_cluster(oid, cluster_name); + hpool->update(host); + } + + host->unlock(); + } + } + + for (it = datastores.begin(); it != datastores.end(); it++) + { + ds = dspool->get(*it, true); + + if (ds != 0) + { + if (ds->get_cluster_id() == oid) + { + ds->set_cluster(oid, cluster_name); + dspool->update(ds); + } + + ds->unlock(); + } + } + + for (it = vnets.begin(); it != vnets.end(); it++) + { + vnet = vnpool->get(*it, true); + + if (vnet != 0) + { + if (vnet->get_cluster_id() == oid) + { + vnet->set_cluster(oid, cluster_name); + vnpool->update(vnet); + } + + vnet->unlock(); + } + } +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void DatastoreRename::batch_rename(int oid) +{ + Datastore * datastore = static_cast(pool)->get(oid, true); + + if (datastore == 0) + { + return; + } + + const set & images = datastore->get_image_ids(); + + set::iterator it; + + string image_name = datastore->get_name(); + + datastore->unlock(); + + Image * image; + ImagePool * ipool = Nebula::instance().get_ipool(); + + for (it = images.begin(); it != images.end(); it++) + { + image = ipool->get(*it, true); + + if (image != 0) + { + if (image->get_ds_id() == oid) + { + image->set_ds_name(image_name); + ipool->update(image); + } + + image->unlock(); + } + } +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void HostRename::batch_rename(int oid) +{ + Host * host = static_cast(pool)->get(oid, true); + + if (host == 0) + { + return; + } + + const set & vms = host->get_vm_ids(); + + set::iterator it; + + string host_name = host->get_name(); + + host->unlock(); + + VirtualMachine * vm; + VirtualMachinePool * vmpool = Nebula::instance().get_vmpool(); + + for (it = vms.begin(); it != vms.end(); it++) + { + vm = vmpool->get(*it, true); + + if (vm != 0) + { + if (vm->hasHistory() && vm->get_hid() == oid) + { + vm->set_hostname(host_name); + vmpool->update(vm); + } + + vm->unlock(); + } + } +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml index 4d4fc77898..3f6286503c 100644 --- a/src/sunstone/etc/sunstone-views/admin.yaml +++ b/src/sunstone/etc/sunstone-views/admin.yaml @@ -54,6 +54,8 @@ tabs: User.update_password: true User.quotas_dialog: true User.chgrp: true + User.addgroup: true + User.delgroup: true User.chauth: true User.delete: true groups-tab: diff --git a/src/sunstone/etc/sunstone-views/cloud.yaml b/src/sunstone/etc/sunstone-views/cloud.yaml index 1e5bf5b7f0..7f43dfd8d1 100644 --- a/src/sunstone/etc/sunstone-views/cloud.yaml +++ b/src/sunstone/etc/sunstone-views/cloud.yaml @@ -55,6 +55,8 @@ tabs: User.update_password: true User.quotas_dialog: true User.chgrp: true + User.addgroup: true + User.delgroup: true User.chauth: true User.delete: true groups-tab: diff --git a/src/sunstone/etc/sunstone-views/user.yaml b/src/sunstone/etc/sunstone-views/user.yaml index f3c5175274..e6dd473d01 100644 --- a/src/sunstone/etc/sunstone-views/user.yaml +++ b/src/sunstone/etc/sunstone-views/user.yaml @@ -55,6 +55,8 @@ tabs: User.update_password: true User.quotas_dialog: true User.chgrp: true + User.addgroup: true + User.delgroup: true User.chauth: true User.delete: true groups-tab: diff --git a/src/sunstone/etc/sunstone-views/vdcadmin.yaml b/src/sunstone/etc/sunstone-views/vdcadmin.yaml index dccafc9e96..3fea87e030 100644 --- a/src/sunstone/etc/sunstone-views/vdcadmin.yaml +++ b/src/sunstone/etc/sunstone-views/vdcadmin.yaml @@ -55,6 +55,8 @@ tabs: User.update_password: true User.quotas_dialog: true User.chgrp: true + User.addgroup: true + User.delgroup: true User.chauth: true User.delete: true groups-tab: diff --git a/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb index c2d8a09c12..8713d15574 100644 --- a/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb @@ -43,6 +43,7 @@ module OpenNebulaJSON when "addvnet" then self.addvnet(action_hash['params']) when "delvnet" then self.delvnet(action_hash['params']) when "update" then self.update(action_hash['params']) + when "rename" then self.rename(action_hash['params']) else error_msg = "#{action_hash['perform']} action not " << @@ -78,5 +79,9 @@ module OpenNebulaJSON def update(params=Hash.new) super(params['template_raw']) end + + def rename(params=Hash.new) + super(params['name']) + end end end diff --git a/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb b/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb index e7ff02b4ea..a17ad80f7e 100644 --- a/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb @@ -50,6 +50,7 @@ module OpenNebulaJSON when "update" then self.update(action_hash['params']) when "chown" then self.chown(action_hash['params']) when "chmod" then self.chmod_octet(action_hash['params']) + when "rename" then self.rename(action_hash['params']) else error_msg = "#{action_hash['perform']} action not " << " available for this resource" @@ -68,5 +69,9 @@ module OpenNebulaJSON def chmod_octet(params=Hash.new) super(params['octet']) end + + def rename(params=Hash.new) + super(params['name']) + end end end diff --git a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb index 196010d609..57adb5df10 100644 --- a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb @@ -51,6 +51,7 @@ module OpenNebulaJSON when "enable" then self.enable when "disable" then self.disable when "update" then self.update(action_hash['params']) + when "rename" then self.rename(action_hash['params']) else error_msg = "#{action_hash['perform']} action not " << " available for this resource" @@ -62,5 +63,8 @@ module OpenNebulaJSON super(params['template_raw']) end + def rename(params=Hash.new) + super(params['name']) + end end end diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 878e005170..6798355b49 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -531,6 +531,13 @@ var OpenNebula = { }, "pool_monitor" : function(params){ OpenNebula.Action.monitor(params,OpenNebula.Host.resource,true); + }, + "rename" : function(params){ + var action_obj = params.data.extra_param; + OpenNebula.Action.simple_action(params, + OpenNebula.Host.resource, + "rename", + action_obj); } }, @@ -936,18 +943,17 @@ var OpenNebula = { "set_quota" : function(params){ var action_obj = { quotas : params.data.extra_param }; OpenNebula.Action.simple_action(params,OpenNebula.User.resource,"set_quota",action_obj); + }, + "addgroup" : function(params){ + var action_obj = {"group_id": params.data.extra_param }; + OpenNebula.Action.simple_action(params,OpenNebula.User.resource, + "addgroup",action_obj); + }, + "delgroup" : function(params){ + var action_obj = {"group_id": params.data.extra_param }; + OpenNebula.Action.simple_action(params,OpenNebula.User.resource, + "delgroup",action_obj); } - - // "addgroup" : function(params){ - // var action_obj = {"group_id": params.data.extra_param }; - // OpenNebula.Action.simple_action(params,OpenNebula.User.resource, - // "addgroup",action_obj); - // }, - // "delgroup" : function(params){ - // var action_obj = {"group_id": params.data.extra_param }; - // OpenNebula.Action.simple_action(params,OpenNebula.User.resource, - // "delgroup",action_obj); - // } }, "Image": { @@ -1152,6 +1158,13 @@ var OpenNebula = { OpenNebula.Cluster.resource, "update", action_obj); + }, + "rename" : function(params){ + var action_obj = params.data.extra_param; + OpenNebula.Action.simple_action(params, + OpenNebula.Cluster.resource, + "rename", + action_obj); } }, "Datastore" : { @@ -1191,6 +1204,13 @@ var OpenNebula = { }, "fetch_template" : function(params){ OpenNebula.Action.show(params,OpenNebula.Datastore.resource,"template"); + }, + "rename" : function(params){ + var action_obj = params.data.extra_param; + OpenNebula.Action.simple_action(params, + OpenNebula.Datastore.resource, + "rename", + action_obj); } }, diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index 53f372bf6b..245c255590 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -1070,6 +1070,18 @@ var cluster_actions = { type: "single", call: popUpUpdateClusterDialog }, + + "Cluster.rename" : { + type: "single", + call: OpenNebula.Cluster.rename, + callback: function(request) { + notifyMessage(tr("Cluster renamed correctly")); + Sunstone.runAction('Cluster.showinfo',request.request.data[0]); + Sunstone.runAction('Cluster.list'); + }, + error: onError, + notify: true + } }; var cluster_buttons = { @@ -1233,18 +1245,22 @@ function updateClusterInfo(request,cluster){
\ \ \ - \ \ \ \ \ - \ + \ \ \ - \ - \ + \ + \ + \ \ \
' + +
' + tr("Cluster") + ' - '+cluster_info.NAME+'
' + tr("id") + ''+cluster_info.ID+''+cluster_info.ID+'
' + tr("Name") + ''+cluster_info.NAME+''+tr("Name")+''+cluster_info.NAME+'
\ + \ +
\ +
\ @@ -1291,6 +1307,25 @@ function updateClusterInfo(request,cluster){
' } + $("#div_edit_rename_link").die(); + $(".input_edit_value_rename").die(); + + // Listener for edit link for rename + $("#div_edit_rename_link").live("click", function() { + var value_str = $(".value_td_rename").text(); + $(".value_td_rename").html(''); + }); + + $(".input_edit_value_rename").live("change", function() { + var value_str = $(".input_edit_value_rename").val(); + if(value_str!="") + { + // Let OpenNebula know + var name_template = {"name": value_str}; + Sunstone.runAction("Cluster.rename",cluster_info.ID,name_template); + } + }); + //Sunstone.updateInfoPanelTab(info_panel_name,tab_name, new tab object); Sunstone.updateInfoPanelTab("cluster_info_panel","cluster_info_tab",info_tab); Sunstone.updateInfoPanelTab("cluster_info_panel","cluster_host_tab",cluster_host_tab); diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js index 9a749b11af..845bc93e12 100644 --- a/src/sunstone/public/js/plugins/config-tab.js +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -94,7 +94,7 @@ var config_tab_content =
\ \ \ - \ + \ \ \ \ @@ -153,7 +153,18 @@ var config_tab_content = \
    \
  • \ -
  • \ +
  • \ +
    \ +
    \ + \ +
    \ +
    \ + \ +
    \ +
    \ +
    \ +
  • \
\ \ \ @@ -202,12 +213,7 @@ Sunstone.addActions({ call: OpenNebula.User.update, callback: function(request) { notifyMessage(tr("Template updated correctly")); - OpenNebula.User.show({ - data : { - id: "-1" - }, - success: updateUserConfigInfo - }); + fillUserInfo(); }, error: onError }, @@ -307,6 +313,16 @@ function setupConfigDialog() { } }) }); + + $("#quota_group_sel").die(); + + $("#quota_group_sel").live("change", function() { + var value_str = $('select#quota_group_sel').val(); + if(value_str!="") + { + fillGroupQuotas(value_str) + } + }); } function tr(str){ @@ -333,23 +349,32 @@ function updateUserConfigInfo(request,user_json) { $("#user_information tbody").html('\ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ - \ - \ + \ + \ + \ + \ + \ + \ + \ \ \ \ - \ + \ ') $("#setting_user_template").html( @@ -358,28 +383,57 @@ function updateUserConfigInfo(request,user_json) { "-1", tr("Custom Attributes")) ) + + $("#div_edit_chg_group_link").die(); + $("#group_confirm_select").die(); + + // Listener for key,value pair edit action + $("#div_edit_chg_group_link").live("click", function() { + // TODO: do not call group.list again, use the callback from + // $("span.user-login a.configuration").click + OpenNebula.Group.list( + { + success: function(request, group_list) { + var value_str = $(".value_td_group").text(); + var select_str='"; + $(".value_td_group").html(select_str); + $("select#group_confirm_select").val(info.GID); + }, + error: onError + }) + }); + + $("#group_confirm_select").live("change", function() { + var value_str = $('select#group_confirm_select').val(); + if(value_str!="") + { + // Let OpenNebula know + var resource_struct = new Array(); + resource_struct[0] = info.ID; + Sunstone.runAction("User.chgrp",resource_struct,value_str); + fillUserInfo(); + } + }); } -$(document).ready(function(){ - setupConfigDialog(); - setupUpdatePassword(); - - $("span.user-login a.configuration").click(function(){ - OpenNebula.User.show({ - data : { - id: '-1' - }, - success: updateUserConfigInfo - }); - +function fillGroupQuotas(group_id){ OpenNebula.Group.show({ data : { - id: '-1' + id: group_id }, success: function(request,group_json){ var info = group_json.GROUP; - var default_group_quotas = Quotas.default_quotas(info.DEFAULT_GROUP_QUOTAS) + var default_group_quotas = Quotas.default_quotas(info.DEFAULT_GROUP_QUOTAS); + var quotas_tab_html = Quotas.vms(info, default_group_quotas); quotas_tab_html += Quotas.cpu(info, default_group_quotas); quotas_tab_html += Quotas.memory(info, default_group_quotas); @@ -387,10 +441,46 @@ $(document).ready(function(){ quotas_tab_html += Quotas.network(info, default_group_quotas); quotas_tab_html += Quotas.datastore(info, default_group_quotas); - $("#group_quotasTab").html(quotas_tab_html); + $("#group_quotasTabBody").html(quotas_tab_html); + + $("select#quota_group_sel").val(info.ID); } }); +} - $config_dialog.reveal(); - }); +function fillUserInfo(){ + OpenNebula.User.show({ + data : { + id: '-1' + }, + success: updateUserConfigInfo + }); +} + +$(document).ready(function(){ + setupConfigDialog(); + setupUpdatePassword(); + + $("span.user-login a.configuration").click(function(){ + fillUserInfo(); + + OpenNebula.Group.list( + { + success: function(request, group_list) { + var group_dropdown_options = ""; + $.each(group_list,function(){ + group_dropdown_options += + ''; + }); + + $('select#quota_group_sel', $config_dialog).html(group_dropdown_options); + + fillGroupQuotas('-1'); + } + }); + + $config_dialog.reveal(); + }); }); \ No newline at end of file diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 9913f3d759..5bcf24703f 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -231,16 +231,6 @@ var create_datastore_tmpl =
'+tr("Paths that can not be used to register images. A space separated list of paths. This will prevent users registering important files as VM images and accessing them thourgh their VMs. OpenNebula will automatically add its configuration directories: /var/lib/one, /etc/one and oneadmin's home ($HOME).")+'
\ \ \ -
\ -
\ - \ -
\ -
\ - \ -
\ -
\ -
\ -
\
\
\ \ @@ -251,12 +241,13 @@ var create_datastore_tmpl =
\
\
\ - \ + \
\
\ - \ + \
\
\ +
'+tr("Space separated list of Server names or IPs where OpenNebula will be staging the new images into. This server will act as the entry point for new inmages in the datastore.")+'
\
\
\
\ @@ -524,6 +515,18 @@ var datastore_actions = { hideDialog(); $('div#datastores_tab div.legend_div').slideToggle(); } + }, + + "Datastore.rename" : { + type: "single", + call: OpenNebula.Datastore.rename, + callback: function(request) { + notifyMessage(tr("Datastore renamed correctly")); + Sunstone.runAction('Datastore.showinfo',request.request.data[0]); + Sunstone.runAction('Datastore.list'); + }, + error: onError, + notify: true } }; @@ -733,9 +736,12 @@ function updateDatastoreInfo(request,ds){
\ \ \ - \ - \ - \ + \ + \ + \ \ '+ cluster_str + @@ -787,6 +793,24 @@ function updateDatastoreInfo(request,ds){ content : '
' + tr("User information") +'
' + tr("User information") +'
' + tr("ID") + ''+info.ID+''+info.ID+'
' + tr("Name") + ''+info.NAME+''+info.NAME+'
' + tr("Group ID") + ''+info.GID+''+info.GID+'
' + tr("Group Name") + ''+info.GNAME+'' + tr("Group") + ''+ info.GNAME +'\ +
\ + \ +
\ +
' + tr("Secondary groups") + ''+(typeof info.GROUPS.ID == "object" ? info.GROUPS.ID.join(",") : "-")+'
' + tr("Password") + '
'+tr("Name")+''+info.NAME+''+tr("Name")+''+info.NAME+'
\ + \ +
\ +
' + datastore_image_table_tmpl + '
' } + $("#div_edit_rename_link").die(); + $(".input_edit_value_rename").die(); + + // Listener for edit link for rename + $("#div_edit_rename_link").live("click", function() { + var value_str = $(".value_td_rename").text(); + $(".value_td_rename").html(''); + }); + + $(".input_edit_value_rename").live("change", function() { + var value_str = $(".input_edit_value_rename").val(); + if(value_str!="") + { + // Let OpenNebula know + var name_template = {"name": value_str}; + Sunstone.runAction("Datastore.rename",info.ID,name_template); + } + }); // Add tabs Sunstone.updateInfoPanelTab("datastore_info_panel","datastore_info_tab",info_tab); @@ -829,10 +853,9 @@ function hide_all(context) { // Hide all the options that depends on datastore type // and reset the selects - $('label[for="bridge_list"],input#bridge_list',context).hide(); $('label[for="ds_use_ssh"],input#ds_use_ssh',context).hide(); $('label[for="tm_use_ssh"],input#tm_use_ssh',context).hide(); - $('label[for="host"],input#host',context).hide(); + $('label[for="bridge_list"],input#bridge_list',context).parent().parent().hide(); $('label[for="base_iqn"],input#base_iqn',context).hide(); $('label[for="vg_name"],input#vg_name',context).hide(); $('select#ds_mad').removeAttr('disabled'); @@ -922,10 +945,10 @@ function setupCreateDatastoreDialog(){ var bridge_list = $('#bridge_list',context).val(); var ds_use_ssh = $('#ds_use_ssh',context).is(':checked'); var tm_use_ssh = $('#tm_use_ssh',context).is(':checked'); - var host = $('#host',context).val(); var base_iqn = $('#base_iqn',context).val(); var vg_name = $('#vg_name',context).val(); + if (!name){ notifyError("Please provide a name"); return false; @@ -961,14 +984,11 @@ function setupCreateDatastoreDialog(){ if (tm_use_ssh) ds_obj.datastore.tm_use_ssh = "YES"; - if (host) - ds_obj.datastore.host = host; - if (base_iqn) ds_obj.datastore.base_iqn = base_iqn; if (vg_name) - ds_obj.datastore.vg_name = vg_name; + ds_obj.datastore.vg_name = vg_name; Sunstone.runAction("Datastore.create",ds_obj); @@ -1034,7 +1054,7 @@ function select_filesystem(){ } function select_vmware_vmfs(){ - $('label[for="bridge_list"],input#bridge_list').fadeIn(); + $('label[for="bridge_list"],input#bridge_list').parent().parent().fadeIn(); $('label[for="ds_use_ssh"],input#ds_use_ssh').fadeIn(); $('label[for="tm_use_ssh"],input#tm_use_ssh').fadeIn(); $('select#ds_mad').val('vmfs'); @@ -1050,7 +1070,7 @@ function select_iscsi(){ $('select#ds_mad').attr('disabled', 'disabled'); $('select#tm_mad').val('iscsi'); $('select#tm_mad').attr('disabled', 'disabled'); - $('label[for="host"],input#host').fadeIn(); + $('label[for="bridge_list"],input#bridge_list').parent().parent().fadeIn(); $('label[for="base_iqn"],input#base_iqn').fadeIn(); $('label[for="vg_name"],input#vg_name').fadeIn(); $('select#disk_type').children('option').each(function() { @@ -1069,6 +1089,7 @@ function select_ceph(){ $('select#ds_mad').attr('disabled', 'disabled'); $('select#tm_mad').val('ceph'); $('select#tm_mad').attr('disabled', 'disabled'); + $('label[for="bridge_list"],input#bridge_list').parent().parent().fadeIn(); $('select#disk_type').val('RBD'); } @@ -1077,7 +1098,7 @@ function select_lvm(){ $('select#ds_mad').attr('disabled', 'disabled'); $('select#tm_mad').val('lvm'); $('select#tm_mad').attr('disabled', 'disabled'); - $('label[for="host"],input#host').fadeIn(); + $('label[for="bridge_list"],input#bridge_list').parent().parent().fadeIn(); $('label[for="vg_name"],input#vg_name').fadeIn(); $('select#disk_type').children('option').each(function() { var value_str = $(this).val(); diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js index 96d88e5456..f926825033 100644 --- a/src/sunstone/public/js/plugins/files-tab.js +++ b/src/sunstone/public/js/plugins/files-tab.js @@ -353,7 +353,7 @@ var file_actions = { type: "single", call: OpenNebula.Image.rename, callback: function(request) { - notifyMessage("File renamed correctly"); + notifyMessage(tr("File renamed correctly")); Sunstone.runAction('Image.showinfo',request.request.data[0]); Sunstone.runAction('Image.list'); }, diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 2ef52deb31..956724045a 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -384,8 +384,19 @@ var host_actions = { hideDialog(); $('div#hosts_tab div.legend_div').slideToggle(); } - } + }, + "Host.rename" : { + type: "single", + call: OpenNebula.Host.rename, + callback: function(request) { + notifyMessage(tr("Host renamed correctly")); + Sunstone.runAction('Host.showinfo',request.request.data[0]); + Sunstone.runAction('Host.list'); + }, + error: onError, + notify: true + } }; var host_buttons = { @@ -732,8 +743,12 @@ function updateHostInfo(request,host){ '+host_info.ID+'\ \ \ - ' + tr("Name") + '\ - '+host_info.NAME+'\ + '+tr("Name")+'\ + '+host_info.NAME+'\ +
\ + \ +
\ + \ \ ' + insert_cluster_dropdown("Host",host_info.ID,host_info.CLUSTER,host_info.CLUSTER_ID) + @@ -828,6 +843,25 @@ function updateHostInfo(request,host){ ' } + $("#div_edit_rename_link").die(); + $(".input_edit_value_rename").die(); + + // Listener for edit link for rename + $("#div_edit_rename_link").live("click", function() { + var value_str = $(".value_td_rename").text(); + $(".value_td_rename").html(''); + }); + + $(".input_edit_value_rename").live("change", function() { + var value_str = $(".input_edit_value_rename").val(); + if(value_str!="") + { + // Let OpenNebula know + var name_template = {"name": value_str}; + Sunstone.runAction("Host.rename",host_info.ID,name_template); + } + }); + //Sunstone.updateInfoPanelTab(info_panel_name,tab_name, new tab object); Sunstone.updateInfoPanelTab("host_info_panel","host_info_tab",info_tab); Sunstone.updateInfoPanelTab("host_info_panel","host_monitoring_tab",monitor_tab); diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 2a50f9fb51..006fee889a 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -522,7 +522,7 @@ var image_actions = { type: "single", call: OpenNebula.Image.rename, callback: function(request) { - notifyMessage("Image renamed correctly"); + notifyMessage(tr("Image renamed correctly")); Sunstone.runAction('Image.showinfo',request.request.data[0]); Sunstone.runAction('Image.list'); }, diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index fe01ebd4e4..9b6c9778e4 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -195,7 +195,7 @@ var easy_provision_vm_template_tmpl ='\
\
\
\ - '+tr("Step 3: Select a template")+'\ + '+tr("Step 2: Select a template")+'\
\
\ \ @@ -281,8 +281,7 @@ var easy_provision_vm_template_tmpl ='\ \
\
\ -
\ -
\ +
'+tr("Identifier of the image to be used as the main disk for this Virtual Machine. This choice will select the Operating System the VM will run under.")+'
\
\
\
\ @@ -381,6 +380,7 @@ var template_actions = { type: "single", call: OpenNebula.Template.rename, callback: function(request) { + notifyMessage(tr("Template renamed correctly")); Sunstone.runAction('Template.showinfo',request.request.data[0]); Sunstone.runAction("Template.show",request.request.data[0]); }, @@ -970,7 +970,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ ''+ '
'+ '
'+ - '
'+ + '
'+tr("Image ID to be used in the Virtual Image disk.")+ '
'+ '
'+ '
'+ @@ -984,7 +984,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ ''+ ''+ '
'+ - '
'+ + '
'+tr("Name of the image to be used in the Virtual Image disk.")+ '
'+ '
'+ '
'+ @@ -1000,7 +1000,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ ''+ ''+ '
'+ - '
'+ + '
'+tr("Identifier of the user owner of the image to reduce ambiguity.")+ '
'+ '
'+ '
'+ @@ -1014,7 +1014,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ ''+ ''+ '
'+ - '
'+ + '
'+tr("Name of the user owner of the image to reduce ambiguity.")+ '
'+ '
'+ '
'+ @@ -1708,7 +1708,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){ ''+ ''+ '
'+ - '
'+ + '
'+tr("Identifier of the virtual network from which to lease an IP and MAC address to this Virtual Machine network interface.")+ '
'+ '
'+ '
'+ @@ -1722,7 +1722,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){ ''+ ''+ '
'+ - '
'+ + '
'+tr("Name of the virtual network from which to lease an IP and MAC address to this Virtual Machine network interface.")+ '
'+ '
'+ '
'+ @@ -1738,7 +1738,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){ ''+ ''+ '
'+ - '
'+ + '
'+tr("Identifier of the user owner of the virtual network from which to lease an IP and MAC address to this Virtual Machine network interface.")+ '
'+ '
'+ '
'+ @@ -1752,7 +1752,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){ ''+ ''+ '
'+ - '
'+ + '
'+tr("Name of the user owner of the virtual network from which to lease an IP and MAC address to this Virtual Machine network interface.")+ '
'+ '
'+ '
'+ @@ -2864,7 +2864,7 @@ function setupCreateTemplateDialog(){ } }); - + $("#refresh_ramdisk_table").die(); $("#refresh_ramdisk_table").live('click', function(){ @@ -3088,7 +3088,7 @@ function setupCreateTemplateDialog(){ ''+tr("SSH")+''+ '
'+ '
'+ - ''+ + ''+ '
'+ '
'+ ''+ @@ -3099,12 +3099,12 @@ function setupCreateTemplateDialog(){ '
'+ '
'+ '
'+ - ''+ + ''+ '
'+ '
'+ '
'+ '
'+ - '