diff --git a/README.md b/README.md index 687277f083..043ac07130 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ -OpenNebula - The OpenSource Toolkit for Cloud Computing +OpenNebula - Flexible Enterprise Cloud Made Simple ## DESCRIPTION -OpenNebula is an open-source project aimed at building the industry standard -open source cloud computing tool to manage the complexity and heterogeneity of -distributed data center infrastructures. +OpenNebula is an open-source project delivering a simple but feature-rich and +flexible solution to build and manage enterprise clouds and virtualized data centers. Complete documentation can be found at diff --git a/SConstruct b/SConstruct index 4180d1ae10..5d92c9106b 100644 --- a/SConstruct +++ b/SConstruct @@ -246,7 +246,8 @@ build_scripts=[ 'share/man/SConstruct', 'src/sunstone/locale/languages/SConstruct', 'share/scripts/context-packages/SConstruct', - 'share/rubygems/SConstruct' + 'share/rubygems/SConstruct', + 'src/im_mad/collectd/SConstruct' ] # Testing diff --git a/include/Host.h b/include/Host.h index 1a479db757..2ca409d055 100644 --- a/include/Host.h +++ b/include/Host.h @@ -23,6 +23,7 @@ #include "Clusterable.h" #include "ObjectCollection.h" #include "NebulaLog.h" +#include "NebulaUtil.h" using namespace std; @@ -85,6 +86,21 @@ public: (state == MONITORING_DISABLED)); } + /** + * Check if host is hybrid + * @return true if the host is enabled + */ + bool isHybrid() const; + + /** + * Return an element of the hypervisor array. The calling function + * must check that the index is valid. + */ + static const char * get_hybrid_hypervisor_by_id(int i) + { + return HYBRID_HYPERVISORS[i]; + } + /** * Disables the current host, it will not be monitored nor used by the * scheduler @@ -459,6 +475,7 @@ private: */ ObjectCollection vm_collection; + // ************************************************************************* // Constructor // ************************************************************************* @@ -489,6 +506,17 @@ private: static const char * monit_table; + /** + * Array containing the hybrid hypervisors, and counter. There is a + * correspondence between Host::HYBRID_HYPERVISOR and + * VirtualMachine::HYBRID_ATTRIBUTES. Attributes in HYBRID_ATTRIBUTES[i] are + * meant to be used in hosts reporting a a hypervisor of type + * HYBRID_HYPERVISOR[i] + */ + static const char * HYBRID_HYPERVISORS[]; + + static const int NUM_HYBRID_HYPERVISORS; + /** * Execute an INSERT or REPLACE Sql query. * @param db The SQL DB diff --git a/include/MySqlDB.h b/include/MySqlDB.h index d9059190c3..df3beea811 100644 --- a/include/MySqlDB.h +++ b/include/MySqlDB.h @@ -58,7 +58,7 @@ public: * @param obj Callbackable obj to call if the query succeeds * @return 0 on success */ - int exec(ostringstream& cmd, Callbackable* obj=0); + int exec(ostringstream& cmd, Callbackable* obj=0, bool quiet=false); /** * This function returns a legal SQL string that can be used in an SQL @@ -143,7 +143,7 @@ public: ~MySqlDB(){}; - int exec(ostringstream& cmd, Callbackable* obj=0){return -1;}; + int exec(ostringstream& cmd, Callbackable* obj=0, bool quiet=false){return -1;}; char * escape_str(const string& str){return 0;}; diff --git a/include/Nebula.h b/include/Nebula.h index 3c54369f03..ce98100187 100644 --- a/include/Nebula.h +++ b/include/Nebula.h @@ -330,18 +330,23 @@ public: */ static string version() { - return "OpenNebula 4.3.0"; + return "OpenNebula 4.3.80"; }; static string db_version() { - return "4.3.0"; + return "4.3.80"; } /** * Starts all the modules and services for OpenNebula */ - void start(); + void start(bool bootstrap_only=false); + + /** + * Initialize the database + */ + void bootstrap_db(); // ----------------------------------------------------------------------- // Configuration attributes (read from oned.conf) diff --git a/include/QuotaVirtualMachine.h b/include/QuotaVirtualMachine.h index e46c47c0c3..ab3bc24ad9 100644 --- a/include/QuotaVirtualMachine.h +++ b/include/QuotaVirtualMachine.h @@ -22,12 +22,14 @@ /** * VM Quotas, defined as: * VM = [ - * VMS = - * MEMORY = - * CPU = - * VMS_USED = Current number of VMs - * MEMORY_USED = Overall Memory requested - * CPU_USED = Overall CPU requested + * VMS = + * MEMORY = + * CPU = + * VOLATILE_SIZE = + * VMS_USED = Current number of VMs + * MEMORY_USED = Overall Memory requested + * CPU_USED = Overall CPU requested + * VOLATILE_SIZE_USED = * ] * * 0 = unlimited, default if missing diff --git a/include/RequestManagerVirtualMachine.h b/include/RequestManagerVirtualMachine.h index 789a0aebb7..cf845f2468 100644 --- a/include/RequestManagerVirtualMachine.h +++ b/include/RequestManagerVirtualMachine.h @@ -56,6 +56,16 @@ protected: PoolObjectAuth * ds_perm, AuthRequest::Operation op); + bool quota_resize_authorization( + Template * deltas, + RequestAttributes& att, + PoolObjectAuth& vm_perms); + + bool quota_resize_authorization( + int oid, + Template * deltas, + RequestAttributes& att); + int get_host_information( int hid, string& name, diff --git a/include/SqlDB.h b/include/SqlDB.h index 4daafeb8c0..b0e9552d0e 100644 --- a/include/SqlDB.h +++ b/include/SqlDB.h @@ -37,10 +37,10 @@ public: * Performs a DB transaction * @param sql_cmd the SQL command * @param callbak function to execute on each data returned - * @param arg to pass to the callback function + * @param quiet True to log errors with DDEBUG level instead of ERROR * @return 0 on success */ - virtual int exec(ostringstream& cmd, Callbackable* obj=0) = 0; + virtual int exec(ostringstream& cmd, Callbackable* obj=0, bool quiet=false) = 0; /** * This function returns a legal SQL string that can be used in an SQL diff --git a/include/SqliteDB.h b/include/SqliteDB.h index 197712782a..43c7476310 100644 --- a/include/SqliteDB.h +++ b/include/SqliteDB.h @@ -57,7 +57,7 @@ public: * @param arg to pass to the callback function * @return 0 on success */ - int exec(ostringstream& cmd, Callbackable* obj=0); + int exec(ostringstream& cmd, Callbackable* obj=0, bool quiet=false); /** * This function returns a legal SQL string that can be used in an SQL @@ -113,7 +113,7 @@ public: ~SqliteDB(){}; - int exec(ostringstream& cmd, Callbackable* obj=0){return -1;}; + int exec(ostringstream& cmd, Callbackable* obj=0, bool quiet=false){return -1;}; char * escape_str(const string& str){return 0;}; diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 645dc0b377..0b9f50e714 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -1068,6 +1068,21 @@ public: */ void release_disk_images(); + /** + * Check if the given disk is volatile + */ + static bool isVolatile(const VectorAttribute * disk); + + /** + * Check if the template contains a volatile disk + */ + static bool isVolatile(const Template * tmpl); + + /** + * Return the total SIZE of volatile disks + */ + static float get_volatile_disk_size(Template * tmpl); + // ------------------------------------------------------------------------ // Context related functions // ------------------------------------------------------------------------ diff --git a/include/VirtualMachineTemplate.h b/include/VirtualMachineTemplate.h index c637f48168..a30132e78e 100644 --- a/include/VirtualMachineTemplate.h +++ b/include/VirtualMachineTemplate.h @@ -67,12 +67,30 @@ public: */ void remove_all_except_restricted(); + /** + * Returns the hypervisor name if the template is hybrid + * @param hypervisor the resulting hypervisor string + * @return true if any hybrid hypervisor attribute found, false otherwise + */ + bool get_hybrid_hypervisor(string& hypervisor) const; + private: friend class VirtualMachinePool; static vector restricted_attributes; + /** + * Array containing the hybrid attributes, and counter. There is a + * correspondence between Host::HYBRID_HYPERVISOR and + * VirtualMachine::HYBRID_ATTRIBUTES. Attributes in HYBRID_ATTRIBUTES[i] are + * meant to be used in hosts reporting a a hypervisor of type + * HYBRID_HYPERVISOR[i] + */ + static const char * HYBRID_ATTRIBUTES[]; + + static const int NUM_HYBRID_ATTRIBUTES; + /** * Stores the attributes as restricted, these attributes will be used in * VirtualMachineTemplate::check diff --git a/install.sh b/install.sh index 31878aee22..d1ad6ae114 100755 --- a/install.sh +++ b/install.sh @@ -227,9 +227,7 @@ SHARE_DIRS="$SHARE_LOCATION/examples \ $SHARE_LOCATION/tgt \ $SHARE_LOCATION/websockify" -ETC_DIRS="$ETC_LOCATION/im_ec2 \ - $ETC_LOCATION/vmm_ec2 \ - $ETC_LOCATION/vmm_exec \ +ETC_DIRS="$ETC_LOCATION/vmm_exec \ $ETC_LOCATION/hm \ $ETC_LOCATION/auth \ $ETC_LOCATION/auth/certificates \ @@ -264,12 +262,17 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/im/kvm.d \ $VAR_LOCATION/remotes/im/xen3.d \ $VAR_LOCATION/remotes/im/xen4.d \ + $VAR_LOCATION/remotes/im/kvm-probes.d \ + $VAR_LOCATION/remotes/im/xen3-probes.d \ + $VAR_LOCATION/remotes/im/xen4-probes.d \ $VAR_LOCATION/remotes/im/vmware.d \ + $VAR_LOCATION/remotes/im/ec2.d \ $VAR_LOCATION/remotes/vmm \ $VAR_LOCATION/remotes/vmm/kvm \ $VAR_LOCATION/remotes/vmm/xen3 \ $VAR_LOCATION/remotes/vmm/xen4 \ $VAR_LOCATION/remotes/vmm/vmware \ + $VAR_LOCATION/remotes/vmm/ec2 \ $VAR_LOCATION/remotes/vnm \ $VAR_LOCATION/remotes/vnm/802.1Q \ $VAR_LOCATION/remotes/vnm/dummy \ @@ -447,9 +450,13 @@ INSTALL_FILES=( MADS_LIB_FILES:$LIB_LOCATION/mads IM_PROBES_FILES:$VAR_LOCATION/remotes/im IM_PROBES_KVM_FILES:$VAR_LOCATION/remotes/im/kvm.d + IM_PROBES_KVM_PROBES_FILES:$VAR_LOCATION/remotes/im/kvm-probes.d IM_PROBES_XEN3_FILES:$VAR_LOCATION/remotes/im/xen3.d + IM_PROBES_XEN3_PROBES_FILES:$VAR_LOCATION/remotes/im/xen3-probes.d IM_PROBES_XEN4_FILES:$VAR_LOCATION/remotes/im/xen4.d + IM_PROBES_XEN4_PROBES_FILES:$VAR_LOCATION/remotes/im/xen4-probes.d IM_PROBES_VMWARE_FILES:$VAR_LOCATION/remotes/im/vmware.d + IM_PROBES_EC2_FILES:$VAR_LOCATION/remotes/im/ec2.d AUTH_SSH_FILES:$VAR_LOCATION/remotes/auth/ssh AUTH_X509_FILES:$VAR_LOCATION/remotes/auth/x509 AUTH_LDAP_FILES:$VAR_LOCATION/remotes/auth/ldap @@ -461,6 +468,7 @@ INSTALL_FILES=( VMM_EXEC_XEN3_SCRIPTS:$VAR_LOCATION/remotes/vmm/xen3 VMM_EXEC_XEN4_SCRIPTS:$VAR_LOCATION/remotes/vmm/xen4 VMM_EXEC_VMWARE_SCRIPTS:$VAR_LOCATION/remotes/vmm/vmware + VMM_EXEC_EC2_SCRIPTS:$VAR_LOCATION/remotes/vmm/ec2 TM_FILES:$VAR_LOCATION/remotes/tm TM_SHARED_FILES:$VAR_LOCATION/remotes/tm/shared TM_SHARED_LVM_FILES:$VAR_LOCATION/remotes/tm/shared_lvm @@ -656,9 +664,8 @@ INSTALL_ONEFLOW_ETC_FILES=( INSTALL_ETC_FILES=( ETC_FILES:$ETC_LOCATION VMWARE_ETC_FILES:$ETC_LOCATION - VMM_EC2_ETC_FILES:$ETC_LOCATION/vmm_ec2 + EC2_ETC_FILES:$ETC_LOCATION VMM_EXEC_ETC_FILES:$ETC_LOCATION/vmm_exec - IM_EC2_ETC_FILES:$ETC_LOCATION/im_ec2 HM_ETC_FILES:$ETC_LOCATION/hm AUTH_ETC_FILES:$ETC_LOCATION/auth ECO_ETC_FILES:$ETC_LOCATION @@ -743,18 +750,15 @@ MADS_LIB_FILES="src/mad/sh/madcommon.sh \ src/vmm_mad/exec/one_vmm_exec \ src/vmm_mad/exec/one_vmm_sh \ src/vmm_mad/exec/one_vmm_ssh \ - src/vmm_mad/ec2/one_vmm_ec2.rb \ - src/vmm_mad/ec2/one_vmm_ec2 \ src/vmm_mad/dummy/one_vmm_dummy.rb \ src/vmm_mad/dummy/one_vmm_dummy \ src/im_mad/im_exec/one_im_exec.rb \ src/im_mad/im_exec/one_im_exec \ src/im_mad/im_exec/one_im_ssh \ src/im_mad/im_exec/one_im_sh \ - src/im_mad/ec2/one_im_ec2.rb \ - src/im_mad/ec2/one_im_ec2 \ src/im_mad/dummy/one_im_dummy.rb \ src/im_mad/dummy/one_im_dummy \ + src/im_mad/collectd/collectd \ src/tm_mad/one_tm \ src/tm_mad/one_tm.rb \ src/hm_mad/one_hm.rb \ @@ -851,32 +855,65 @@ VMM_EXEC_VMWARE_SCRIPTS="src/vmm_mad/remotes/vmware/cancel \ src/vmm_mad/remotes/vmware/vmware_driver.rb \ src/vmm_mad/remotes/vmware/vi_driver.rb" +#------------------------------------------------------------------------------ +# VMM Driver EC2 scripts, to be installed under $REMOTES_LOCATION/vmm/ec2 +#------------------------------------------------------------------------------ + +VMM_EXEC_EC2_SCRIPTS="src/vmm_mad/remotes/ec2/cancel \ + src/vmm_mad/remotes/ec2/attach_disk \ + src/vmm_mad/remotes/ec2/detach_disk \ + src/vmm_mad/remotes/ec2/attach_nic \ + src/vmm_mad/remotes/ec2/detach_nic \ + src/vmm_mad/remotes/ec2/snapshot_create \ + src/vmm_mad/remotes/ec2/snapshot_revert \ + src/vmm_mad/remotes/ec2/snapshot_delete \ + src/vmm_mad/remotes/ec2/deploy \ + src/vmm_mad/remotes/ec2/migrate \ + src/vmm_mad/remotes/ec2/restore \ + src/vmm_mad/remotes/ec2/reboot \ + src/vmm_mad/remotes/ec2/reset \ + src/vmm_mad/remotes/ec2/save \ + src/vmm_mad/remotes/ec2/poll \ + src/vmm_mad/remotes/ec2/shutdown \ + src/vmm_mad/remotes/ec2/ec2_driver.rb" + #------------------------------------------------------------------------------- # Information Manager Probes, to be installed under $REMOTES_LOCATION/im #------------------------------------------------------------------------------- IM_PROBES_FILES="src/im_mad/remotes/run_probes" -IM_PROBES_KVM_FILES="src/im_mad/remotes/kvm.d/kvm.rb \ - src/im_mad/remotes/kvm.d/architecture.sh \ - src/im_mad/remotes/kvm.d/cpu.sh \ - src/im_mad/remotes/kvm.d/poll.sh \ - src/im_mad/remotes/kvm.d/name.sh" +IM_PROBES_KVM_FILES="src/im_mad/remotes/kvm.d/collectd-client_control.sh \ + src/im_mad/remotes/kvm.d/collectd-client.rb" -IM_PROBES_XEN3_FILES="src/im_mad/remotes/xen.d/xen.rb \ - src/im_mad/remotes/xen.d/architecture.sh \ - src/im_mad/remotes/xen.d/cpu.sh \ - src/im_mad/remotes/xen.d/poll3.sh \ - src/im_mad/remotes/xen.d/name.sh" +IM_PROBES_KVM_PROBES_FILES="src/im_mad/remotes/kvm-probes.d/kvm.rb \ + src/im_mad/remotes/kvm-probes.d/architecture.sh \ + src/im_mad/remotes/kvm-probes.d/cpu.sh \ + src/im_mad/remotes/kvm-probes.d/poll.sh \ + src/im_mad/remotes/kvm-probes.d/name.sh" -IM_PROBES_XEN4_FILES="src/im_mad/remotes/xen.d/xen.rb \ - src/im_mad/remotes/xen.d/architecture.sh \ - src/im_mad/remotes/xen.d/cpu.sh \ - src/im_mad/remotes/xen.d/poll4.sh \ - src/im_mad/remotes/xen.d/name.sh" +IM_PROBES_XEN3_FILES="src/im_mad/remotes/xen.d/collectd-client_control.sh \ + src/im_mad/remotes/xen.d/collectd-client.rb" + +IM_PROBES_XEN3_PROBES_FILES="src/im_mad/remotes/xen-probes.d/xen.rb \ + src/im_mad/remotes/xen-probes.d/architecture.sh \ + src/im_mad/remotes/xen-probes.d/cpu.sh \ + src/im_mad/remotes/xen-probes.d/poll3.sh \ + src/im_mad/remotes/xen-probes.d/name.sh" + +IM_PROBES_XEN4_FILES="src/im_mad/remotes/xen.d/collectd-client_control.sh \ + src/im_mad/remotes/xen.d/collectd-client.rb" + +IM_PROBES_XEN4_PROBES_FILES="src/im_mad/remotes/xen-probes.d/xen.rb \ + src/im_mad/remotes/xen-probes.d/architecture.sh \ + src/im_mad/remotes/xen-probes.d/cpu.sh \ + src/im_mad/remotes/xen-probes.d/poll4.sh \ + src/im_mad/remotes/xen-probes.d/name.sh" IM_PROBES_VMWARE_FILES="src/im_mad/remotes/vmware.d/vmware.rb" +IM_PROBES_EC2_FILES="src/im_mad/remotes/ec2.d/poll" + #------------------------------------------------------------------------------- # Auth Manager drivers to be installed under $REMOTES_LOCATION/auth #------------------------------------------------------------------------------- @@ -1152,14 +1189,14 @@ ETC_FILES="share/etc/oned.conf \ VMWARE_ETC_FILES="src/vmm_mad/remotes/vmware/vmwarerc" +EC2_ETC_FILES="src/vmm_mad/remotes/ec2/ec2_driver.conf \ + src/vmm_mad/remotes/ec2/ec2_driver.default" + #------------------------------------------------------------------------------- # Virtualization drivers config. files, to be installed under $ETC_LOCATION -# - ec2, $ETC_LOCATION/vmm_ec2 # - ssh, $ETC_LOCATION/vmm_exec #------------------------------------------------------------------------------- -VMM_EC2_ETC_FILES="src/vmm_mad/ec2/vmm_ec2rc \ - src/vmm_mad/ec2/vmm_ec2.conf" VMM_EXEC_ETC_FILES="src/vmm_mad/exec/vmm_execrc \ src/vmm_mad/exec/vmm_exec_kvm.conf \ @@ -1167,14 +1204,6 @@ VMM_EXEC_ETC_FILES="src/vmm_mad/exec/vmm_execrc \ src/vmm_mad/exec/vmm_exec_xen4.conf \ src/vmm_mad/exec/vmm_exec_vmware.conf" -#------------------------------------------------------------------------------- -# Information drivers config. files, to be installed under $ETC_LOCATION -# - ec2, $ETC_LOCATION/im_ec2 -#------------------------------------------------------------------------------- - -IM_EC2_ETC_FILES="src/im_mad/ec2/im_ec2rc \ - src/im_mad/ec2/im_ec2.conf" - #------------------------------------------------------------------------------- # Hook Manager driver config. files, to be installed under $ETC_LOCATION/hm #------------------------------------------------------------------------------- diff --git a/share/doc/xsd/group.xsd b/share/doc/xsd/group.xsd index 56c2438f7c..f34dee62fb 100644 --- a/share/doc/xsd/group.xsd +++ b/share/doc/xsd/group.xsd @@ -57,6 +57,8 @@ + + diff --git a/share/doc/xsd/group_pool.xsd b/share/doc/xsd/group_pool.xsd index a217be7b08..3ff318f090 100644 --- a/share/doc/xsd/group_pool.xsd +++ b/share/doc/xsd/group_pool.xsd @@ -60,6 +60,8 @@ + + diff --git a/share/doc/xsd/user.xsd b/share/doc/xsd/user.xsd index d2eae5fe4e..7716f54cb1 100644 --- a/share/doc/xsd/user.xsd +++ b/share/doc/xsd/user.xsd @@ -63,6 +63,8 @@ + + diff --git a/share/doc/xsd/user_pool.xsd b/share/doc/xsd/user_pool.xsd index c7d72c0594..af35614963 100644 --- a/share/doc/xsd/user_pool.xsd +++ b/share/doc/xsd/user_pool.xsd @@ -67,6 +67,8 @@ + + diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 5c39ab3628..64208dc270 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -177,6 +177,23 @@ DEFAULT_DEVICE_PREFIX = "hd" # /etc/one/ if OpenNebula was installed in /) #******************************************************************************* +#------------------------------------------------------------------------------- +# Information Collector for KVM and Xen IM's. +#------------------------------------------------------------------------------- +# This driver CANNOT BE ASSIGNED TO A HOST, and needs to be used with KVM or +# Xen drivers +# -h prints this help. +# -a Address to bind the collectd sockect (defults 0.0.0.0) +# -p UDP port to listen for monitor information (default 4124) +# -f Interval in seconds to flush collected information (default 5) +# -t Number of threads for the server (defult 50) +#------------------------------------------------------------------------------- +IM_MAD = [ + name = "collectd", + executable = "collectd", + arguments = "-p 4124 -f 5 -t 50" ] +#------------------------------------------------------------------------------- + #------------------------------------------------------------------------------- # KVM Information Driver Manager Configuration # -r number of retries when monitoring a host @@ -224,8 +241,8 @@ IM_MAD = [ #------------------------------------------------------------------------------- #IM_MAD = [ # name = "ec2", -# executable = "one_im_ec2", -# arguments = "im_ec2/im_ec2.conf" ] +# executable = "one_im_sh", +# arguments = "-c -t 1 -r 0 ec2" ] #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -318,14 +335,13 @@ VM_MAD = [ #------------------------------------------------------------------------------- # EC2 Virtualization Driver Manager Configuration -# arguments: default values for the EC2 driver, can be an absolute path or -# relative to $ONE_LOCATION/etc (or /etc/one/ if OpenNebula was -# installed in /). +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of actions performed at the same time #------------------------------------------------------------------------------- #VM_MAD = [ # name = "ec2", -# executable = "one_vmm_ec2", -# arguments = "vmm_ec2/vmm_ec2.conf", +# executable = "one_vmm_sh", +# arguments = "-t 15 -r 0 ec2", # type = "xml" ] #------------------------------------------------------------------------------- diff --git a/share/man/econe-allocate-address.1 b/share/man/econe-allocate-address.1 index 2dfc9c5ce5..9f88ec3a47 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" "August 2013" "" "econe-allocate-address(1) -- Allocates a new elastic IP address for the user" +.TH "ECONE\-ALLOCATE\-ADDRESS" "1" "October 2013" "" "econe-allocate-address(1) -- Allocates a new elastic IP address for the user" . .SH "NAME" \fBecone\-allocate\-address\fR @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 2b40789570..50ea57631d 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" "August 2013" "" "econe-associate-address(1) -- Associates a publicIP of the user with a given instance" +.TH "ECONE\-ASSOCIATE\-ADDRESS" "1" "October 2013" "" "econe-associate-address(1) -- Associates a publicIP of the user with a given instance" . .SH "NAME" \fBecone\-associate\-address\fR @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 1a89f0e5fa..0b80a1ddf9 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" "August 2013" "" "econe-attach-volume(1) -- Attaches a DATABLOCK to an instance" +.TH "ECONE\-ATTACH\-VOLUME" "1" "October 2013" "" "econe-attach-volume(1) -- Attaches a DATABLOCK to an instance" . .SH "NAME" \fBecone\-attach\-volume\fR @@ -45,7 +45,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 44fa3b778c..7bb79cd531 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" "August 2013" "" "econe-create-keypair(1) -- Creates the named keypair" +.TH "ECONE\-CREATE\-KEYPAIR" "1" "October 2013" "" "econe-create-keypair(1) -- Creates the named keypair" . .SH "NAME" \fBecone\-create\-keypair\fR @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 578c3590af..edf5de1dd8 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" "August 2013" "" "econe-create-volume(1) -- Creates a new DATABLOCK in OpenNebula" +.TH "ECONE\-CREATE\-VOLUME" "1" "October 2013" "" "econe-create-volume(1) -- Creates a new DATABLOCK in OpenNebula" . .SH "NAME" \fBecone\-create\-volume\fR @@ -40,7 +40,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 a142a23d88..467603f7e4 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" "August 2013" "" "econe-delete-keypair(1) -- Deletes the named keypair, removes the associated keys" +.TH "ECONE\-DELETE\-KEYPAIR" "1" "October 2013" "" "econe-delete-keypair(1) -- Deletes the named keypair, removes the associated keys" . .SH "NAME" \fBecone\-delete\-keypair\fR @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 eb47e26c9c..d34f4906b0 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" "August 2013" "" "econe-delete-volume(1) -- Deletes an existing DATABLOCK" +.TH "ECONE\-DELETE\-VOLUME" "1" "October 2013" "" "econe-delete-volume(1) -- Deletes an existing DATABLOCK" . .SH "NAME" \fBecone\-delete\-volume\fR @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 d2ff32e20b..5fa9b08800 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" "August 2013" "" "econe-describe-addresses(1) -- Lists elastic IP addresses" +.TH "ECONE\-DESCRIBE\-ADDRESSES" "1" "October 2013" "" "econe-describe-addresses(1) -- Lists elastic IP addresses" . .SH "NAME" \fBecone\-describe\-addresses\fR @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 12e507e5e3..294eca6ee1 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" "August 2013" "" "econe-describe-images(1) -- Lists all registered images belonging to one particular user" +.TH "ECONE\-DESCRIBE\-IMAGES" "1" "October 2013" "" "econe-describe-images(1) -- Lists all registered images belonging to one particular user" . .SH "SYNOPSIS" econe\-describe\-images \fIOPTIONS\fR @@ -36,7 +36,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 bc43d2eef2..c4f446cbe5 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" "August 2013" "" "econe-describe-instances(1) -- Outputs a list of launched images belonging to one particular user" +.TH "ECONE\-DESCRIBE\-INSTANCES" "1" "October 2013" "" "econe-describe-instances(1) -- Outputs a list of launched images belonging to one particular user" . .SH "NAME" \fBecone\-describe\-instances\fR @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 dd039a958d..eacb30b6fa 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" "August 2013" "" "econe-describe-keypairs(1) -- List and describe the key pairs available to the user" +.TH "ECONE\-DESCRIBE\-KEYPAIRS" "1" "October 2013" "" "econe-describe-keypairs(1) -- List and describe the key pairs available to the user" . .SH "NAME" \fBecone\-describe\-keypairs\fR @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 22d61287f3..312a7fd3da 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" "August 2013" "" "econe-describe-volumes(1) -- Describe all available DATABLOCKs for this user" +.TH "ECONE\-DESCRIBE\-VOLUMES" "1" "October 2013" "" "econe-describe-volumes(1) -- Describe all available DATABLOCKs for this user" . .SH "NAME" \fBecone\-describe\-volumes\fR @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 523b2f6e72..1b59d49571 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" "August 2013" "" "econe-detach-volume(1) -- Detaches a DATABLOCK from an instance" +.TH "ECONE\-DETACH\-VOLUME" "1" "October 2013" "" "econe-detach-volume(1) -- Detaches a DATABLOCK from an instance" . .SH "NAME" \fBecone\-detach\-volume\fR @@ -45,7 +45,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 290c323c08..4dfe0a9a7a 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" "August 2013" "" "econe-disassociate-address(1) -- Disasociate a publicIP of the user currently associated with an instance" +.TH "ECONE\-DISASSOCIATE\-ADDRESS" "1" "October 2013" "" "econe-disassociate-address(1) -- Disasociate a publicIP of the user currently associated with an instance" . .SH "NAME" \fBecone\-disassociate\-address\fR @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 fdf2178c92..d9586d2de5 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" "August 2013" "" "econe-reboot-instances(1) -- Reboots a set of virtual machines" +.TH "ECONE\-REBOOT\-INSTANCES" "1" "October 2013" "" "econe-reboot-instances(1) -- Reboots a set of virtual machines" . .SH "NAME" \fBecone\-reboot\-instances\fR @@ -45,7 +45,7 @@ instance_id The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 867b43ccc5..2a46cdb1eb 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" "August 2013" "" "econe-register(1) -- Registers an image" +.TH "ECONE\-REGISTER" "1" "October 2013" "" "econe-register(1) -- Registers an image" . .SH "NAME" \fBecone\-register\fR @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 a4966da799..fd3dc7de63 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" "August 2013" "" "econe-release-address(1) -- Releases a publicIP of the user" +.TH "ECONE\-RELEASE\-ADDRESS" "1" "October 2013" "" "econe-release-address(1) -- Releases a publicIP of the user" . .SH "NAME" \fBecone\-release\-address\fR @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 8987a8da12..64314bdfca 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" "August 2013" "" "econe-run-instances(1) -- Runs an instance of a particular image (that needs to be referenced)" +.TH "ECONE\-RUN\-INSTANCES" "1" "October 2013" "" "econe-run-instances(1) -- Runs an instance of a particular image (that needs to be referenced)" . .SH "NAME" \fBecone\-run\-instances\fR @@ -53,7 +53,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 950fb5e5b1..5dc2b347c8 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" "August 2013" "" "econe-start-instances(1) -- Starts a set of virtual machines" +.TH "ECONE\-START\-INSTANCES" "1" "October 2013" "" "econe-start-instances(1) -- Starts a set of virtual machines" . .SH "NAME" \fBecone\-start\-instances\fR @@ -45,7 +45,7 @@ instance_id The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 2561b1905f..3d919fca09 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" "August 2013" "" "econe-stop-instances(1) -- Stops a set of virtual machines" +.TH "ECONE\-STOP\-INSTANCES" "1" "October 2013" "" "econe-stop-instances(1) -- Stops a set of virtual machines" . .SH "NAME" \fBecone\-stop\-instances\fR @@ -45,7 +45,7 @@ instance_id The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 441c666978..b806a4da45 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" "August 2013" "" "econe-terminate-instances(1) -- Shutdowns a set of virtual machines (or cancel, depending on its state)" +.TH "ECONE\-TERMINATE\-INSTANCES" "1" "October 2013" "" "econe-terminate-instances(1) -- Shutdowns a set of virtual machines (or cancel, depending on its state)" . .SH "NAME" \fBecone\-terminate\-instances\fR @@ -45,7 +45,7 @@ instance_id The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 9229db88b2..a3392659a3 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" "August 2013" "" "econe-upload(1) -- Uploads an image to OpenNebula" +.TH "ECONE\-UPLOAD" "1" "October 2013" "" "econe-upload(1) -- Uploads an image to OpenNebula" . .SH "NAME" \fBecone\-upload\fR @@ -43,7 +43,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 58aa18db76..465972e6d0 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" "August 2013" "OpenNebula 4.3.0" "User Commands" +.TH OPENNEBULA "1" "October 2013" "OpenNebula 4.3.80" "User Commands" .SH NAME OpenNebula \- OCCI Manage Compute .SH SYNOPSIS diff --git a/share/man/occi-instance-type.1 b/share/man/occi-instance-type.1 index ff6ad134f7..8244aeeeaa 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" "August 2013" "OpenNebula 4.3.0" "User Commands" +.TH OPENNEBULA "1" "October 2013" "OpenNebula 4.3.80" "User Commands" .SH NAME OpenNebula \- OCCI Manage Instance .SH SYNOPSIS diff --git a/share/man/occi-network.1 b/share/man/occi-network.1 index a2e846b674..bbb14c6932 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" "August 2013" "OpenNebula 4.3.0" "User Commands" +.TH OPENNEBULA "1" "October 2013" "OpenNebula 4.3.80" "User Commands" .SH NAME OpenNebula \- OCCI Manage Network .SH SYNOPSIS diff --git a/share/man/occi-storage.1 b/share/man/occi-storage.1 index 07fc876812..599378bb08 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" "August 2013" "OpenNebula 4.3.0" "User Commands" +.TH OPENNEBULA "1" "October 2013" "OpenNebula 4.3.80" "User Commands" .SH NAME OpenNebula \- OCCI Manage Storage .SH SYNOPSIS diff --git a/share/man/oneacct.1 b/share/man/oneacct.1 index 0719873349..34f01e58b5 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" "August 2013" "" "oneacct(1) -- OpenNebula Accounting Tool" +.TH "ONEACCT" "1" "October 2013" "" "oneacct(1) -- OpenNebula Accounting Tool" . .SH "NAME" \fBoneacct\fR @@ -46,7 +46,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 0e87b1c3f0..9f757e75cf 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" "August 2013" "" "oneacl(1) -- manages OpenNebula ACLs" +.TH "ONEACL" "1" "October 2013" "" "oneacl(1) -- manages OpenNebula ACLs" . .SH "NAME" \fBoneacl\fR @@ -54,7 +54,7 @@ aclid_list Comma\-separated list of OpenNebula ACL names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 99687e4632..a71592a242 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" "August 2013" "" "onecluster(1) -- manages OpenNebula clusters" +.TH "ONECLUSTER" "1" "October 2013" "" "onecluster(1) -- manages OpenNebula clusters" . .SH "NAME" \fBonecluster\fR @@ -65,6 +65,9 @@ delvnet \fIclusterid\fR \fIvnetid\fR Deletes a Virtual Network from the given Cl .IP "\(bu" 4 update \fIclusterid\fR [\fIfile\fR] Update the template contents\. If a path is not provided the editor will be launched to modify the current content\. valid options: append . +.IP "\(bu" 4 +rename \fIclusterid\fR \fIname\fR Renames the Cluster +. .IP "" 0 . .SH "ARGUMENT FORMATS" @@ -96,7 +99,7 @@ datastoreid OpenNebula DATASTORE name or id .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 f7a0f4a4f4..3996cc7a46 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" "August 2013" "" "onedatastore(1) -- manages OpenNebula datastores" +.TH "ONEDATASTORE" "1" "October 2013" "" "onedatastore(1) -- manages OpenNebula datastores" . .SH "NAME" \fBonedatastore\fR @@ -57,6 +57,9 @@ show \fIdatastoreid\fR Shows information for the given Datastore valid options: .IP "\(bu" 4 update \fIdatastoreid\fR [\fIfile\fR] Update the template contents\. If a path is not provided the editor will be launched to modify the current content\. valid options: append . +.IP "\(bu" 4 +rename \fIdatastoreid\fR \fIname\fR Renames the Datastore +. .IP "" 0 . .SH "ARGUMENT FORMATS" @@ -88,7 +91,7 @@ userid OpenNebula USER name or id .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 38ea32ac36..276ecd9914 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" "August 2013" "" "onedb(1) -- OpenNebula database migration tool" +.TH "ONEDB" "1" "October 2013" "" "onedb(1) -- OpenNebula database migration tool" . .SH "NAME" \fBonedb\fR diff --git a/share/man/oneflow-template.1 b/share/man/oneflow-template.1 index e70fbcf2f2..a90adc9f71 100644 --- a/share/man/oneflow-template.1 +++ b/share/man/oneflow-template.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEFLOW\-TEMPLATE" "1" "August 2013" "" "oneflow-template(1) -- Manage oneFlow Templates" +.TH "ONEFLOW\-TEMPLATE" "1" "October 2013" "" "oneflow-template(1) -- Manage oneFlow Templates" . .SH "NAME" \fBoneflow\-template\fR @@ -84,7 +84,7 @@ templateid_list Comma\-separated list of OpenNebula SERVICE TEMPLATE names or id .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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/oneflow.1 b/share/man/oneflow.1 index 75fe05304f..b69e522256 100644 --- a/share/man/oneflow.1 +++ b/share/man/oneflow.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ONEFLOW" "1" "August 2013" "" "oneflow(1) -- Manage oneFlow Services" +.TH "ONEFLOW" "1" "October 2013" "" "oneflow(1) -- Manage oneFlow Services" . .SH "NAME" \fBoneflow\fR @@ -94,7 +94,7 @@ vm_action Actions supported: shutdown, shutdown\-hard, undeploy, undeploy\-hard, .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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/onegroup.1 b/share/man/onegroup.1 index 19d6f6b9b1..3317255ba7 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" "August 2013" "" "onegroup(1) -- manages OpenNebula groups" +.TH "ONEGROUP" "1" "October 2013" "" "onegroup(1) -- manages OpenNebula groups" . .SH "NAME" \fBonegroup\fR @@ -74,7 +74,7 @@ groupid_list Comma\-separated list of OpenNebula GROUP names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 253dad2b0c..0ed54871bd 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" "August 2013" "" "onehost(1) -- manages OpenNebula hosts" +.TH "ONEHOST" "1" "October 2013" "" "onehost(1) -- manages OpenNebula hosts" . .SH "NAME" \fBonehost\fR @@ -66,6 +66,9 @@ top Lists Hosts continuously valid options: list, delay, filter, xml, numeric, k .IP "\(bu" 4 flush \fIrange|hostid_list\fR Disables the host and reschedules all the running VMs in it\. . +.IP "\(bu" 4 +rename \fIhostid\fR \fIname\fR Renames the Host +. .IP "" 0 . .SH "ARGUMENT FORMATS" @@ -88,7 +91,7 @@ hostid_list Comma\-separated list of OpenNebula HOST names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 535430d810..d52cfd187f 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" "August 2013" "" "oneimage(1) -- manages OpenNebula images" +.TH "ONEIMAGE" "1" "October 2013" "" "oneimage(1) -- manages OpenNebula images" . .SH "NAME" \fBoneimage\fR @@ -161,7 +161,7 @@ type Image type: OS, CDROM, DATABLOCK, KERNEL, RAMDISK, CONTEXT .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 4ec744d289..4e735c2984 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" "August 2013" "" "onetemplate(1) -- manages OpenNebula templates" +.TH "ONETEMPLATE" "1" "October 2013" "" "onetemplate(1) -- manages OpenNebula templates" . .SH "NAME" \fBonetemplate\fR @@ -31,12 +31,22 @@ \-\-raw string Raw string to add to the template\. Not to be confused with the RAW attribute \-\-vnc Add VNC server to the VM + \-\-vnc\-password password VNC password + \-\-vnc\-listen ip VNC IP where to listen for connections\. By + default is 0\.0\.0\.0 (all interfaces)\. + \-\-spice Add spice server to the VM + \-\-spice\-password password spice password + \-\-spice\-listen ip spice IP where to listen for connections\. By + default is 0\.0\.0\.0 (all interfaces)\. \-\-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) + \-\-files_ds file1,file2 Add files to the contextualization CD from + thefiles datastore + \-\-init script1,script2 Script or scripts to start in context \-\-dry Just print the template \-m, \-\-multiple x Instance multiple VMs \-\-hold Creates the new VM on hold state instead of @@ -81,7 +91,7 @@ Examples: onetempate create \-\-name "test vm" \-\-memory 128 \-\-cpu 1 \e \-\-disk arch,data -valid options: name, cpu, vcpu, arch, memory, disk, nic, raw, vnc, ssh, net_context, context, boot, dry +valid options: name, cpu, vcpu, arch, memory, disk, nic, raw, vnc, vnc_password, vnc_listen, spice, spice_password, spice_listen, ssh, net_context, context, boot, files_ds, init, dry . .fi . @@ -95,7 +105,7 @@ clone \fItemplateid\fR \fIname\fR Creates a new Template from an existing one delete \fIrange|templateid_list\fR Deletes the given Image . .IP "\(bu" 4 -instantiate \fItemplateid\fR [\fIfile\fR] Creates a new VM instance from the given Template\. This VM can be managed with the \'onevm\' command valid options: name, multiple, hold, cpu, vcpu, arch, memory, disk, nic, raw, vnc, ssh, net_context, context, boot +instantiate \fItemplateid\fR [\fIfile\fR] Creates a new VM instance from the given Template\. This VM can be managed with the \'onevm\' command valid options: name, multiple, hold, cpu, vcpu, arch, memory, disk, nic, raw, vnc, vnc_password, vnc_listen, spice, spice_password, spice_listen, ssh, net_context, context, boot, files_ds, init . .IP "\(bu" 4 chgrp \fIrange|templateid_list\fR \fIgroupid\fR Changes the Template group @@ -152,7 +162,7 @@ filterflag a, all all the known VMTEMPLATEs m, mine the VMTEMPLATE belonging to .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 d4ab60b4bc..0ba4c9f478 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" "August 2013" "" "oneuser(1) -- manages OpenNebula users" +.TH "ONEUSER" "1" "October 2013" "" "oneuser(1) -- manages OpenNebula users" . .SH "NAME" \fBoneuser\fR @@ -99,7 +99,13 @@ delete \fIrange|userid_list\fR Deletes the given User passwd \fIuserid\fR [\fIpassword\fR] Changes the given User\'s password valid options: read_file, sha1, ssh, x509, key, cert, driver . .IP "\(bu" 4 -chgrp \fIrange|userid_list\fR \fIgroupid\fR Changes the User\'s main group +chgrp \fIrange|userid_list\fR \fIgroupid\fR Changes the User\'s primary group +. +.IP "\(bu" 4 +addgroup \fIrange|userid_list\fR \fIgroupid\fR Adds the User to a secondary group +. +.IP "\(bu" 4 +delgroup \fIrange|userid_list\fR \fIgroupid\fR Removes the User from a secondary group . .IP "\(bu" 4 chauth \fIuserid\fR [\fIauth\fR] [\fIpassword\fR] Changes the User\'s auth driver and its password (optional) Examples: oneuser chauth my_user core oneuser chauth my_user core new_password oneuser chauth my_user core \-r /tmp/mypass oneuser chauth my_user \-\-ssh \-\-key /home/oneadmin/\.ssh/id_rsa oneuser chauth my_user \-\-ssh \-r /tmp/public_key oneuser chauth my_user \-\-x509 \-\-cert /tmp/my_cert\.pem valid options: read_file, sha1, ssh, x509, key, cert, driver @@ -141,7 +147,7 @@ password User password .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 4de10a9916..bccf713327 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" "August 2013" "" "onevdc(1) -- manages OpenNebula Virtual DataCenters" +.TH "ONEVDC" "1" "October 2013" "" "onevdc(1) -- manages OpenNebula Virtual DataCenters" . .SH "NAME" \fBonevdc\fR @@ -63,7 +63,7 @@ vdcid VDC ID .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 a81b5e0033..fe0ec9c7c7 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" "August 2013" "" "onevm(1) -- manages OpenNebula virtual machines" +.TH "ONEVM" "1" "October 2013" "" "onevm(1) -- manages OpenNebula virtual machines" . .SH "NAME" \fBonevm\fR @@ -31,12 +31,22 @@ \-\-raw string Raw string to add to the template\. Not to be confused with the RAW attribute \-\-vnc Add VNC server to the VM + \-\-vnc\-password password VNC password + \-\-vnc\-listen ip VNC IP where to listen for connections\. By + default is 0\.0\.0\.0 (all interfaces)\. + \-\-spice Add spice server to the VM + \-\-spice\-password password spice password + \-\-spice\-listen ip spice IP where to listen for connections\. By + default is 0\.0\.0\.0 (all interfaces)\. \-\-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) + \-\-files_ds file1,file2 Add files to the contextualization CD from + thefiles datastore + \-\-init script1,script2 Script or scripts to start in context \-\-dry Just print the template \-a, \-\-append Append new attributes to the current template \-\-schedule TIME Schedules this action to be executed afterthe @@ -98,7 +108,7 @@ Examples: \- a vm with two disks onevm create \-\-name "test vm" \-\-memory 128 \-\-cpu 1 \-\-disk arch,data -valid options: multiple, hold, name, cpu, vcpu, arch, memory, disk, nic, raw, vnc, ssh, net_context, context, boot, dry +valid options: multiple, hold, name, cpu, vcpu, arch, memory, disk, nic, raw, vnc, vnc_password, vnc_listen, spice, spice_password, spice_listen, ssh, net_context, context, boot, files_ds, init, dry . .fi . @@ -183,7 +193,7 @@ shutdown \fIrange|vmid_list\fR Shuts down the given VM\. The VM life cycle will With \-\-hard it unplugs the VM\. -States: RUNNING +States: RUNNING, UNKNOWN (with \-\-hard) valid options: schedule, hard . .fi @@ -241,7 +251,7 @@ valid options: schedule, hard . .IP "\(bu" 4 -deploy \fIrange|vmid_list\fR \fIhostid\fR Deploys the given VM in the specified Host\. This command forces the deployment, in a standard installation the Scheduler is in charge of this decision +deploy \fIrange|vmid_list\fR \fIhostid\fR [\fIdatastoreid\fR] Deploys the given VM in the specified Host\. This command forces the deployment, in a standard installation the Scheduler is in charge of this decision . .IP "" 4 . @@ -491,6 +501,9 @@ groupid OpenNebula GROUP name or id userid OpenNebula USER name or id . .IP "\(bu" 4 +datastoreid OpenNebula DATASTORE name or id +. +.IP "\(bu" 4 vmid OpenNebula VM name or id . .IP "\(bu" 4 @@ -505,7 +518,7 @@ diskid Integer .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 ac389d38c6..c5f3feaf93 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" "August 2013" "" "onevnet(1) -- manages OpenNebula networks" +.TH "ONEVNET" "1" "October 2013" "" "onevnet(1) -- manages OpenNebula networks" . .SH "NAME" \fBonevnet\fR @@ -104,7 +104,7 @@ filterflag a, all all the known VNETs m, mine the VNET belonging to the user in .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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 a00f9333a8..087748d7c3 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" "August 2013" "" "onezone(1) -- manages OpenNebula zones" +.TH "ONEZONE" "1" "October 2013" "" "onezone(1) -- manages OpenNebula zones" . .SH "NAME" \fBonezone\fR @@ -53,7 +53,7 @@ zoneid Zone ID .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.80 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/pkgs/openSUSE/systemd/onedsetup b/share/pkgs/openSUSE/systemd/onedsetup index ec82ef2811..65e0f9fb3e 100644 --- a/share/pkgs/openSUSE/systemd/onedsetup +++ b/share/pkgs/openSUSE/systemd/onedsetup @@ -79,7 +79,7 @@ if [ ! -d /var/lock/one ]; then fi # Start the one daemon -$ONED -f 2>&1 & +$ONED -i 2>&1 & STARTED=$? CURPID=$! @@ -89,9 +89,10 @@ if [ $STARTED -ne 0 ]; then fi # Give oned a chance to do it's thing... -sleep 2 +sleep 5 # OK we're all done here +# Just in case the process gets stuck, kill it kill -TERM $CURPID > /dev/null 2>&1 counter=0 @@ -105,4 +106,4 @@ while ps $CURPID > /dev/null 2>&1; do done # If the lock file is left over remove it -rm -f /var/lol/one/one +rm -f /var/lock/one/one diff --git a/share/rubygems/generate b/share/rubygems/generate index 7a7ad50f31..704b61ebb0 100755 --- a/share/rubygems/generate +++ b/share/rubygems/generate @@ -21,7 +21,7 @@ require 'tmpdir' DEFAULTS={ - :version => "4.3.0", + :version => "4.3.80", :date => Time.now.strftime("%Y-%m-%d"), :dependencies => [] } diff --git a/share/scripts/context-packages/generate.sh b/share/scripts/context-packages/generate.sh index 3515d5cf00..0b3e090080 100755 --- a/share/scripts/context-packages/generate.sh +++ b/share/scripts/context-packages/generate.sh @@ -16,7 +16,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -VERSION=${VERSION:-4.3.0} +VERSION=${VERSION:-4.3.80} MAINTAINER=${MAINTAINER:-C12G Labs } LICENSE=${LICENSE:-Apache 2.0} PACKAGE_NAME=${PACKAGE_NAME:-one-context} diff --git a/src/cli/one_helper/onehost_helper.rb b/src/cli/one_helper/onehost_helper.rb index dd8f30e91b..a190e7bb31 100644 --- a/src/cli/one_helper/onehost_helper.rb +++ b/src/cli/one_helper/onehost_helper.rb @@ -29,7 +29,7 @@ class OneHostHelper < OpenNebulaHelper::OneHelper def self.state_to_str(id) id = id.to_i state_str = Host::HOST_STATES[id] - + return Host::SHORT_HOST_STATES[state_str] end @@ -114,7 +114,7 @@ class OneHostHelper < OpenNebulaHelper::OneHelper "#{cpu_usage} / #{max_cpu} (#{ratio}%)" else "#{cpu_usage} / -" - end + end end end @@ -156,6 +156,84 @@ class OneHostHelper < OpenNebulaHelper::OneHelper table end + + NUM_THREADS = 15 + def sync(host_ids, options) + cluster_id = options[:cluster] + + # Get remote_dir (implies oneadmin group) + rc = OpenNebula::System.new(@client).get_configuration + return -1, rc.message if OpenNebula.is_error?(rc) + + conf = rc + remote_dir = conf['SCRIPTS_REMOTE_DIR'] + + # Verify the existence of REMOTES_LOCATION + if !File.directory? REMOTES_LOCATION + error_msg = "'#{REMOTES_LOCATION}' does not exist. " << + "This command must be run in the frontend." + return -1,error_msg + end + + # Touch the update file + FileUtils.touch(File.join(REMOTES_LOCATION,'.update')) + + # Get the Host pool + filter_flag ||= OpenNebula::Pool::INFO_ALL + + pool = factory_pool(filter_flag) + + rc = pool.info + return -1, rc.message if OpenNebula.is_error?(rc) + + # Assign hosts to threads + i = 0 + hs_threads = Array.new + + pool.each do |host| + if host_ids + next if !host_ids.include?(host['ID'].to_i) + elsif cluster_id + next if host['CLUSTER_ID'].to_i != cluster_id + end + + hs_threads[i % NUM_THREADS] ||= [] + hs_threads[i % NUM_THREADS] << host['NAME'] + i+=1 + end + + # Run the jobs in threads + host_errors = Array.new + lock = Mutex.new + + ts = hs_threads.map do |t| + Thread.new { + t.each do |host| + sync_cmd = "scp -rp #{REMOTES_LOCATION}/. #{host}:#{remote_dir} 2> /dev/null" + `#{sync_cmd} 2>/dev/null` + + if !$?.success? + lock.synchronize { + host_errors << host + } + end + end + } + end + + # Wait for threads to finish + ts.each{|t| t.join} + + if host_errors.empty? + puts "All hosts updated successfully." + 0 + else + STDERR.puts "Failed to update the following hosts:" + host_errors.each{|h| STDERR.puts "* #{h}"} + -1 + end + end + private def factory(id=nil) diff --git a/src/cli/one_helper/onequota_helper.rb b/src/cli/one_helper/onequota_helper.rb index 3290d76306..947b959f3c 100644 --- a/src/cli/one_helper/onequota_helper.rb +++ b/src/cli/one_helper/onequota_helper.rb @@ -31,9 +31,10 @@ class OneQuotaHelper # ] # # VM = [ - # VMS = - # MEMORY = - # CPU = + # VMS = + # MEMORY = + # CPU = + # VOLATILE_SIZE = # ] # # NETWORK = [ @@ -180,14 +181,14 @@ class OneQuotaHelper if !vm_quotas[0].nil? CLIHelper::ShowTable.new(nil, self) do - column :"NUMBER OF VMS", "", :right, :size=>20 do |d| + column :"NUMBER OF VMS", "", :right, :size=>17 do |d| if !d.nil? elem = 'VMS' limit = d[elem] limit = helper.get_default_limit( limit, "VM_QUOTA/VM/#{elem}") - "%8d / %8d" % [d["VMS_USED"], limit] + "%7d / %7d" % [d["VMS_USED"], limit] end end @@ -215,6 +216,20 @@ class OneQuotaHelper "%8.2f / %8.2f" % [d["CPU_USED"], limit] end end + + column :"VOLATILE_SIZE", "", :right, :size=>20 do |d| + if !d.nil? + elem = 'VOLATILE_SIZE' + limit = d[elem] + limit = helper.get_default_limit( + limit, "VM_QUOTA/VM/#{elem}") + + "%8s / %8s" % [ + OpenNebulaHelper.unit_to_str(d["VOLATILE_SIZE_USED"].to_i,{},"M"), + OpenNebulaHelper.unit_to_str(limit.to_i,{},"M") + ] + end + end end.show(vm_quotas, {}) puts diff --git a/src/cli/onehost b/src/cli/onehost index 108db2d3fd..145f3bc616 100755 --- a/src/cli/onehost +++ b/src/cli/onehost @@ -20,8 +20,10 @@ ONE_LOCATION=ENV["ONE_LOCATION"] if !ONE_LOCATION RUBY_LIB_LOCATION="/usr/lib/one/ruby" + REMOTES_LOCATION="/var/lib/one/remotes" else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" + REMOTES_LOCATION=ONE_LOCATION+"/var/remotes/" end $: << RUBY_LIB_LOCATION @@ -72,6 +74,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do } CREAT_OPTIONS = [ IM, VMM, VNET, OneClusterHelper::CLUSTER ] + SYNC_OPTIONS = [ OneClusterHelper::CLUSTER ] ######################################################################## # Formatters for arguments @@ -164,16 +167,14 @@ cmd=CommandParser::CmdParser.new(ARGV) do sync_desc = <<-EOT.unindent Synchronizes probes in /var/lib/one/remotes ($ONE_LOCATION/var/remotes in self-contained installations) with Hosts. - The copy is performed the next time the Host is monitored + Examples: + onehost sync + onehost sync -c myCluster + onehost sync host01,host02,host03 EOT - command :sync, sync_desc do - if ONE_LOCATION - FileUtils.touch "#{ONE_LOCATION}/var/remotes" - else - FileUtils.touch "/var/lib/one/remotes" - end - 0 + command :sync, sync_desc, [:range,:hostid_list, nil], :options=>SYNC_OPTIONS do + helper.sync(args[0],options) end list_desc = <<-EOT.unindent diff --git a/src/cloud/common/CloudClient.rb b/src/cloud/common/CloudClient.rb index 770f6f2936..36aaa86459 100644 --- a/src/cloud/common/CloudClient.rb +++ b/src/cloud/common/CloudClient.rb @@ -50,7 +50,7 @@ end module CloudClient # OpenNebula version - VERSION = '4.3.0' + VERSION = '4.3.80' # ######################################################################### # Default location for the authentication file diff --git a/src/datastore_mad/remotes/vmfs/monitor b/src/datastore_mad/remotes/vmfs/monitor index c335f3fadd..f88824d3c1 100755 --- a/src/datastore_mad/remotes/vmfs/monitor +++ b/src/datastore_mad/remotes/vmfs/monitor @@ -64,10 +64,10 @@ set -e USED_MB=\$($DU -sLm ${BASE_PATH%/} 2>/dev/null | $CUT -f1) -DF_STR=\$($DF -m | grep ${BASE_PATH%/} | $SED 's/ \+/:/g') +DF_STR=\$($DF -m | grep ${BASE_PATH%/} | sed -e 's/ \+/:/g') -TOTAL_MB=\$(echo \$DF_STR | $CUT -d':' -f 2) -FREE_MB=\$(echo \$DF_STR | $CUT -d':' -f 4) +TOTAL_MB=\$(echo \$DF_STR | $CUT -d: -f 2) +FREE_MB=\$(echo \$DF_STR | $CUT -d: -f 4) echo "USED_MB=\$USED_MB" echo "TOTAL_MB=\$TOTAL_MB" diff --git a/src/host/Host.cc b/src/host/Host.cc index ad03f7209f..25e480e403 100644 --- a/src/host/Host.cc +++ b/src/host/Host.cc @@ -23,6 +23,13 @@ #include "Host.h" #include "Nebula.h" +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +const char * Host::HYBRID_HYPERVISORS[] = {"EC2"}; + +const int Host::NUM_HYBRID_HYPERVISORS = 1; + /* ************************************************************************ */ /* Host :: Constructor/Destructor */ /* ************************************************************************ */ @@ -426,6 +433,29 @@ error_common: return -1; } +/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------ */ + +bool Host::isHybrid() const +{ + string hypervisor; + bool is_hybrid = false; + + get_template_attribute("HYPERVISOR", hypervisor); + one_util::toupper(hypervisor); + + for(int i=0; i < NUM_HYBRID_HYPERVISORS; i++) + { + if(hypervisor==HYBRID_HYPERVISORS[i]) + { + is_hybrid = true; + break; + } + } + + return is_hybrid; +} + /* ************************************************************************ */ /* Host :: Misc */ /* ************************************************************************ */ diff --git a/src/im/InformationManager.cc b/src/im/InformationManager.cc index f8efeddd62..d29f1d143b 100644 --- a/src/im/InformationManager.cc +++ b/src/im/InformationManager.cc @@ -98,8 +98,6 @@ int InformationManager::start() return -1; } - utime(remotes_location.c_str(), 0); - NebulaLog::log("InM",Log::INFO,"Starting Information Manager..."); pthread_attr_init (&pattr); @@ -145,8 +143,6 @@ void InformationManager::timer_action() time_t now; ostringstream oss; - struct stat sb; - set discovered_hosts; set::iterator it; @@ -182,14 +178,6 @@ void InformationManager::timer_action() return; } - if (stat(remotes_location.c_str(), &sb) == -1) - { - sb.st_mtime = 0; - - NebulaLog::log("InM",Log::ERROR,"Could not stat remotes directory, " - "will not update remotes."); - } - for(it=discovered_hosts.begin();it!=discovered_hosts.end();it++) { host = hpool->get(*it,true); @@ -257,8 +245,8 @@ void InformationManager::timer_action() { bool update_remotes = false; - if ((sb.st_mtime != 0) && - (sb.st_mtime > host->get_last_monitored())) + //Force remotes update if the host has never been monitored. + if (host->get_last_monitored() == 0) { update_remotes = true; } diff --git a/src/im_mad/collectd/ListenerThread.cc b/src/im_mad/collectd/ListenerThread.cc new file mode 100644 index 0000000000..c5bb30ef31 --- /dev/null +++ b/src/im_mad/collectd/ListenerThread.cc @@ -0,0 +1,137 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ +/* */ +/* Licensed 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 "ListenerThread.h" + +#include +#include + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +const size_t ListenerThread::MESSAGE_SIZE = 100000; +const size_t ListenerThread::BUFFER_SIZE = 100; + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void ListenerThread::flush_buffer(int fd) +{ + lock(); + + std::vector::iterator it; + + for(it = monitor_data.begin() ; it != monitor_data.end(); ++it) + { + size_t size = (*it).size(); + const char * message = (*it).c_str(); + + write(fd, message, size); + } + + monitor_data.clear(); + + unlock(); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void ListenerThread::monitor_loop() +{ + char buffer[MESSAGE_SIZE]; + size_t rc; + + struct sockaddr addr; + socklen_t addr_size = sizeof(struct sockaddr); + + while(true) + { + rc = recvfrom(socket, buffer, MESSAGE_SIZE, 0, &addr, &addr_size); + + if (rc > 0 && rc < MESSAGE_SIZE) + { + std::string message(buffer, rc); + + lock(); + + monitor_data.push_back(message); + + unlock(); + } + } +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +extern "C" void * listener_main(void *arg) +{ + ListenerThread * listener = static_cast(arg); + + listener->monitor_loop(); + + return 0; +}; + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +ListenerPool::~ListenerPool() +{ + std::vector::iterator it; + + for(it = listeners.begin() ; it != listeners.end(); ++it) + { + pthread_cancel((*it).thread_id()); + } +}; + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void ListenerPool::start_pool() +{ + pthread_attr_t attr; + pthread_t id; + + std::vector::iterator it; + + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + for(it = listeners.begin() ; it != listeners.end(); ++it) + { + pthread_create(&id, &attr, listener_main, (void *)&(*it)); + + (*it).thread_id(id); + } + + pthread_attr_destroy(&attr); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void ListenerPool::flush_pool() +{ + std::vector::iterator it; + + for(it = listeners.begin() ; it != listeners.end(); ++it) + { + (*it).flush_buffer(out_fd); + } +} diff --git a/src/im_mad/collectd/ListenerThread.h b/src/im_mad/collectd/ListenerThread.h new file mode 100644 index 0000000000..f3abdedf95 --- /dev/null +++ b/src/im_mad/collectd/ListenerThread.h @@ -0,0 +1,133 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ +/* */ +/* Licensed 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 +#include + +#include + +/** + * This class implements a listener thread for the IM collector. It receives + * messages from a UDP port and stores it in a BUFFER. The class is controlled + * by two parameters + * - BUFFER_SIZE the number of pre-allocated capacity to store monitor + * messages. It should be roughly equal to the number of hosts per thread + * - MESSAGE_SIZE the size of each monitor message (100K by default). Each VM + * needs ~100bytes so ~1000VMs per host + */ +class ListenerThread +{ +public: + /** + * @param _socket descriptor to listen for messages + */ + ListenerThread(int _socket):socket(_socket) + { + pthread_mutex_init(&mutex,0); + + monitor_data.reserve(BUFFER_SIZE); + }; + + ~ListenerThread() + { + pthread_mutex_destroy(&mutex); + }; + + /** + * Write the contents of the message buffer to a descriptor. Buffer is + * cleared + * @param fd file descriptor to send monitor data. + */ + void flush_buffer(int fd); + + /** + * Waits for UDP messages in a loop and store them in a buffer + */ + void monitor_loop(); + + /** + * Set the thread ID for the listener + */ + void thread_id(pthread_t id) + { + _thread_id = id; + } + + /** + * Get the thread ID of the listener + */ + pthread_t thread_id() + { + return _thread_id; + } + +private: + static const size_t MESSAGE_SIZE; /**< Monitor message size */ + static const size_t BUFFER_SIZE; /**< Pre-allocated capacoty */ + + pthread_mutex_t mutex; + pthread_t _thread_id; + + std::vector monitor_data; + + int socket; + + void lock() + { + pthread_mutex_lock(&mutex); + } + + void unlock() + { + pthread_mutex_unlock(&mutex); + } +}; + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +/** + * Main function for each listener, starts the monitor loop + */ +extern "C" void * listener_main(void *arg); + +/** + * Represents a pool of listener threads, it should be periodically flushed to + * a file descriptor + */ +class ListenerPool +{ +public: + /** + * @param fd descriptor to flush the data + * @param sock socket for the UDP connections + * @param num number of threads in the pool + */ + ListenerPool(int fd, int sock, size_t num) + :listeners(num, ListenerThread(sock)), out_fd(fd), socket(sock){}; + + ~ListenerPool(); + + void start_pool(); + + void flush_pool(); + +private: + std::vector listeners; + + int out_fd; + int socket; +}; diff --git a/src/im_mad/collectd/OpenNebulaDriver.cc b/src/im_mad/collectd/OpenNebulaDriver.cc new file mode 100644 index 0000000000..2d539a318a --- /dev/null +++ b/src/im_mad/collectd/OpenNebulaDriver.cc @@ -0,0 +1,194 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ +/* */ +/* Licensed 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 +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "OpenNebulaDriver.h" +#include "ListenerThread.h" + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +int OpenNebulaDriver::read_one(std::string& message) +{ + fd_set in_pipes; + std::ostringstream oss; + + char c; + int rc; + + FD_ZERO(&in_pipes); + FD_SET (0,&in_pipes); + + rc = select(1, &in_pipes, NULL, NULL, NULL); + + if (rc == -1) + { + return -1; + } + + do + { + rc = read(0, (void *) &c, sizeof(char)); + oss << c; + } + while ( rc > 0 && c != '\n' ); + + if (rc < 0) + { + return -1; + } + + message = oss.str(); + + return 0; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void OpenNebulaDriver::driver_loop() +{ + while (true) + { + std::string message; + + if (read_one(message) == 0) + { + std::istringstream is(message); + std::string action; + + if ( is.good() ) + { + is >> action >> std::ws; + } + else + { + continue; + } + + if (action == "INIT") + { + write2one("INIT SUCCESS\n",13); + } + else if (action == "FINALIZE") + { + break; + } + else + { + driver_action(action, is); + } + } + } +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +int IMCollectorDriver::init_collector() +{ + struct sockaddr_in im_server; + int rc; + + int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); + + if ( sock < 0 ) + { + std::cerr << strerror(errno); + return -1; + } + + im_server.sin_family = AF_INET; + im_server.sin_port = htons(_port); + + if (_address == "0.0.0.0") + { + im_server.sin_addr.s_addr = htonl (INADDR_ANY); + } + else if (inet_pton(AF_INET,_address.c_str(),&im_server.sin_addr.s_addr) < 0) + { + std::cerr << strerror(errno); + return -1; + } + + rc = bind(sock, (struct sockaddr *) &im_server, sizeof(struct sockaddr_in)); + + if ( rc < 0 ) + { + std::cerr << strerror(errno); + return -1; + } + + pool = new ListenerPool(1, sock, _threads); + + return 0; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void IMCollectorDriver::start_collector() +{ + pthread_attr_t attr; + pthread_t id; + + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + pthread_create(&id, &attr, flush_thread, (void *)this); + + pool->start_pool(); + + start(); + + pthread_attr_destroy(&attr); + + pthread_cancel(id); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +extern "C" void * flush_thread(void *arg) +{ + IMCollectorDriver * collectd = static_cast(arg); + + collectd->flush_loop(); + + return 0; +} + +/* -------------------------------------------------------------------------- */ + +void IMCollectorDriver::flush_loop() +{ + while(true) + { + sleep(_flush_period); + + pool->flush_pool(); + } +}; diff --git a/src/im_mad/collectd/OpenNebulaDriver.h b/src/im_mad/collectd/OpenNebulaDriver.h new file mode 100644 index 0000000000..e512150451 --- /dev/null +++ b/src/im_mad/collectd/OpenNebulaDriver.h @@ -0,0 +1,108 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ +/* */ +/* Licensed 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 _OPENNEBULA_DRIVER_H +#define _OPENNEBULA_DRIVER_H + +#include +#include + +class OpenNebulaDriver +{ +public: + + OpenNebulaDriver(){}; + + virtual ~OpenNebulaDriver(){}; + + void start() + { + driver_loop(); + }; + +protected: + + void write2one(const char * buf, size_t bsize) const + { + write(1, buf, bsize); + }; + + + void write2one(const std::string& buf) const + { + write2one(buf.c_str(), buf.size()); + } + +private: + + /** + * Main driver loop. reads actions from OpenNebula core and deals with them + */ + void driver_loop(); + + /** + * Read OpenNebula message + * @param message from OpenNebula + * @retuen 0 on success + */ + int read_one(std::string& message); + + /** + * Generic Driver Action + */ + virtual void driver_action(const std::string& action, + std::istringstream &is) = 0; +}; + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +extern "C" void * flush_thread(void *arg); + +class ListenerPool; + +class IMCollectorDriver: public OpenNebulaDriver +{ +public: + + IMCollectorDriver(std::string address, int port, int threads, + int flush_period) + :OpenNebulaDriver(),_address(address),_port(port),_threads(threads), + _flush_period(flush_period){}; + + virtual ~IMCollectorDriver(){}; + + int init_collector(); + + void flush_loop(); + + void start_collector(); + +private: + void driver_action(const std::string& action, std::istringstream &is){}; + + std::string _address; + + int _port; + + int _threads; + + int _flush_period; + + ListenerPool *pool; +}; + +#endif diff --git a/src/im_mad/collectd/SConstruct b/src/im_mad/collectd/SConstruct new file mode 100644 index 0000000000..fda4483f0a --- /dev/null +++ b/src/im_mad/collectd/SConstruct @@ -0,0 +1,42 @@ +# ---------------------------------------------------------------------------- # +# 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 # +# 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. # +# ---------------------------------------------------------------------------- # + +import os +Import('env') + +cwd=os.getcwd() + +env.Append(LIBPATH=[ + cwd +]) + +lib_name='im_collectd' + +source_files=[ + 'OpenNebulaDriver.cc', + 'ListenerThread.cc' + ] + +# Build library +env.StaticLibrary(lib_name, source_files) + +# Build daemon +env.Prepend(LIBS=[ + 'im_collectd', + 'util' +]) + +env.Program('collectd.cc') diff --git a/src/im_mad/collectd/collectd.cc b/src/im_mad/collectd/collectd.cc new file mode 100644 index 0000000000..256392bdaa --- /dev/null +++ b/src/im_mad/collectd/collectd.cc @@ -0,0 +1,92 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */ +/* */ +/* Licensed 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 "OpenNebulaDriver.h" +#include +#include +#include +#include + +static const char * usage = +"\n collectd [-h] [-a address] [-p port] [-t threads] [-f flush]\n\n" +"SYNOPSIS\n" +" Information Collector for OpenNebula. It should not be started directly\n\n" +"OPTIONS\n" +"\t-h\tprints this help.\n" +"\t-a\tAddress to bind the collectd sockect\n" +"\t-p\tUDP port to listen for monitor information\n" +"\t-f\tInterval in seconds to flush collected information\n" +"\t-t\tNumber of threads for the server\n"; + +int main(int argc, char ** argv) +{ + std::string address = "0.0.0.0"; + int port = 4124; + int threads = 50; + int flush = 5; + + std::istringstream iss; + int opt; + + while((opt = getopt(argc,argv,":ha:p:t:f:")) != -1) + switch(opt) + { + case 'h': + std::cout << usage; + return 0; + break; + case 'a': + address = optarg; + break; + + case 'p': + iss.clear(); + iss.str(optarg); + + iss >> port; + break; + + case 't': + iss.clear(); + iss.str(optarg); + + iss >> threads; + break; + + case 'f': + iss.clear(); + iss.str(optarg); + + iss >> flush; + break; + + default: + std::cerr << usage; + return -1; + break; + } + + + IMCollectorDriver collectd(address, port, threads, flush); + + if ( collectd.init_collector() != 0 ) + { + std::cerr << ". Could not init collectd, exiting...\n"; + return -1; + } + + collectd.start_collector(); +} diff --git a/src/im_mad/ec2/im_ec2.conf b/src/im_mad/ec2/im_ec2.conf deleted file mode 100644 index 4feb01b512..0000000000 --- a/src/im_mad/ec2/im_ec2.conf +++ /dev/null @@ -1,7 +0,0 @@ -#------------------------------------------------------------------------------- -# Max number of instances that can be launched into EC2 -#------------------------------------------------------------------------------- - -SMALL_INSTANCES=5 -LARGE_INSTANCES= -EXTRALARGE_INSTANCES= diff --git a/src/im_mad/ec2/one_im_ec2.rb b/src/im_mad/ec2/one_im_ec2.rb deleted file mode 100755 index cbe5b54025..0000000000 --- a/src/im_mad/ec2/one_im_ec2.rb +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env ruby - -# -------------------------------------------------------------------------- # -# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); you may # -# not use this file except in compliance with the License. You may obtain # -# a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -#--------------------------------------------------------------------------- # - -ONE_LOCATION=ENV["ONE_LOCATION"] - -if !ONE_LOCATION - RUBY_LIB_LOCATION="/usr/lib/one/ruby" -else - RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" -end - -$: << RUBY_LIB_LOCATION - -require 'pp' -require 'OpenNebulaDriver' -require 'base64' - -# The EC2 Information Manager Driver -class EC2InformationManagerDriver < OpenNebulaDriver - # Init the driver, and compute the predefined maximum capacity for this - # EC2 cloud - def initialize() - super('', - :concurrency => 1, - :threaded => false - ) - - register_action(:MONITOR, method("action_monitor")) - - sinst = ENV["SMALL_INSTANCES"].to_i - linst = ENV["LARGE_INSTANCES"].to_i - xlinst = ENV["EXTRALARGE_INSTANCES"].to_i - - smem = 1048576 * 1.7 * sinst - scpu = 100 * sinst - - lmem = 1048576 * 7.5 * linst - lcpu = 400 * linst - - xlmem = 1048576 * 15 * xlinst - xlcpu = 800 * xlinst - - totalmemory = smem + lmem + xlmem - totalcpu = scpu + lcpu + xlcpu - - @info="HYPERVISOR=ec2\nTOTALMEMORY=#{totalmemory}\n"<< - "TOTALCPU=#{totalcpu}\nCPUSPEED=1000\nFREEMEMORY=#{totalmemory}"<< - "\nFREECPU=#{totalcpu}\n" - end - - # The monitor action, just print the capacity info and hostname - def action_monitor(num, host, not_used) - info = "HOSTNAME=\"#{host}\"\n#{@info}" - info64 = Base64::encode64(info).strip.delete("\n") - send_message("MONITOR", RESULT[:success], num, info64) - end -end - -# The EC2 Information Driver main program -im = EC2InformationManagerDriver.new -im.start_driver diff --git a/src/im_mad/im_exec/one_im_exec.rb b/src/im_mad/im_exec/one_im_exec.rb index 1b2f8e5f12..457ca09e0b 100755 --- a/src/im_mad/im_exec/one_im_exec.rb +++ b/src/im_mad/im_exec/one_im_exec.rb @@ -49,6 +49,14 @@ class InformationManagerDriver < OpenNebulaDriver # register actions register_action(:MONITOR, method("action_monitor")) + + # collectd port + @collectd_port = 4124 + begin + im_collectd = @config["IM_MAD"].select{|e| e.match(/collectd/)}[0] + @collectd_port = im_collectd.match(/-p (\d+)/)[1] + rescue + end end # Execute the run_probes in the remote host @@ -73,8 +81,8 @@ class InformationManagerDriver < OpenNebulaDriver end end - do_action("#{@hypervisor}", number, host, :MONITOR, - :script_name => 'run_probes', :base64 => true) + do_action("#{@hypervisor} #{number} #{@collectd_port}", number, host, + :MONITOR, :script_name => 'run_probes', :base64 => true) end end diff --git a/src/im_mad/remotes/common.d/collectd-client.rb b/src/im_mad/remotes/common.d/collectd-client.rb new file mode 100644 index 0000000000..3ebfb7f636 --- /dev/null +++ b/src/im_mad/remotes/common.d/collectd-client.rb @@ -0,0 +1,135 @@ +#!/usr/bin/env ruby + +# -------------------------------------------------------------------------- # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # +# # +# Licensed 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 'socket' +require 'base64' + +DIRNAME = File.dirname(__FILE__) +REMOTE_DIR_UPDATE = File.join(DIRNAME, '../../.update') + +CYCLE = 20 +TOTAL_HOSTS = 1000 + +SLEEP = 1 + +class CollectdClient + def initialize(hypervisor, number, host, port) + # Arguments + @hypervisor = hypervisor + @number = number.to_i + @host = host + @port = port + + # Monitorization slot + hosts_per_cycle = TOTAL_HOSTS / CYCLE + @my_slot = (@number % TOTAL_HOSTS) / hosts_per_cycle + + # Probes + run_probes_cmd = File.join(DIRNAME, '..', "run_probes") + @run_probes_cmd = "#{run_probes_cmd} #{@hypervisor}-probes" + + # Get last update + @last_update = get_last_update + + # Socket + @s = UDPSocket.new + end + + def run_probes + data = `#{@run_probes_cmd}` + data64 = Base64::encode64(data).strip.delete("\n") + + return data64 + end + + def send(data) + @s.send("MONITOR SUCCESS #{@number} #{data}\n", 0, @host, @port) + end + + def do_send?(current, last_send) + current_cycle = current[0] + current_slot = current[1] + + last_cycle = last_send[0] + last_slot = last_send[1] + + if last_slot < @my_slot + min_cycle = last_cycle + else + min_cycle = last_cycle + 1 + end + + if current_cycle > min_cycle + return true + elsif current_cycle < min_cycle + return false + else + return current_slot >= @my_slot + end + end + + def monitor + initial = true + data = run_probes + + last_send = nil + + loop do + # Stop the execution if we receive the update signal + exit 0 if stop? + + t = Time.now.to_i + + current_cycle = t / CYCLE + current_slot = t % CYCLE + + current = [current_cycle, current_slot] + + if initial + last_send = current + initial = false + end + + if do_send?(current, last_send) + send data + last_send = current + + data = run_probes + end + + sleep SLEEP + end + end + + def get_last_update + File.stat(REMOTE_DIR_UPDATE).mtime.to_i rescue 0 + end + + def stop? + get_last_update.to_i != @last_update.to_i + end +end + +hypervisor = ARGV[0] +number = ARGV[1] +port = ARGV[2] + +host = ENV['SSH_CLIENT'].split.first + +client = CollectdClient.new(hypervisor, number, host, port) +client.monitor diff --git a/src/vmm_mad/ec2/vmm_ec2rc b/src/im_mad/remotes/common.d/collectd-client_control.sh old mode 100644 new mode 100755 similarity index 55% rename from src/vmm_mad/ec2/vmm_ec2rc rename to src/im_mad/remotes/common.d/collectd-client_control.sh index 69435d5ff1..0f89c4c17e --- a/src/vmm_mad/ec2/vmm_ec2rc +++ b/src/im_mad/remotes/common.d/collectd-client_control.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # -------------------------------------------------------------------------- # # Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # @@ -14,22 +16,53 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -#May be needed in some setups -#CLASSPATH="" +ARGV=$* -#---------------------------------------------------------------------------- -# EC2 API TOOLS Configuration. -#---------------------------------------------------------------------------- -#EC2_HOME="" -#EC2_PRIVATE_KEY="" -#EC2_CERT="" +# Directory that contains this file +DIR=$(pwd) -# -#---------------------------------------------------------------------------- -# Driver configuration -#---------------------------------------------------------------------------- -# Arguments for the JAVA Virtual Machine -EC2_JVM_ARGS="-Xms16m -Xmx64m" +# Basename +BASENAME=$(basename $0 _control.sh) -# Number of concurrent EC2 operations (not instances) -EC2_JVM_CONCURRENCY=10 +# Collectd client (Ruby) +CLIENT=$DIR/${BASENAME}.rb + +# Collectd client PID +CLIENT_PID_FILE=/tmp/one-collectd-client.pid + +# Launch the client +function start_client() { + /usr/bin/env ruby $CLIENT $ARGV & +} + +# Write the PID +function write_pid() { + echo $1 > $CLIENT_PID_FILE +} + +# Check if running process +function check_running() { + # Assume the process is not running if there is no pid file + test ! -f $CLIENT_PID_FILE && return 1 + + PID=$(cat $CLIENT_PID_FILE) + + if ps --no-headers -o command $PID 2>/dev/null | grep -q $BASENAME; then + return 0 + else + # Stale PID file + rm -f $CLIENT_PID_FILE + return 1 + fi +} + +if ! check_running; then + start_client + write_pid $! +fi + +# This script returns the run_probes execution +HYPERVISOR=$1 +set $HYPERVISOR-probes $@ + +$DIR/../run_probes $@ diff --git a/src/im_mad/remotes/ec2.d/poll b/src/im_mad/remotes/ec2.d/poll new file mode 100755 index 0000000000..5ecdc0c7cc --- /dev/null +++ b/src/im_mad/remotes/ec2.d/poll @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby + +# -------------------------------------------------------------------------- # +# 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 # +# 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. # +# -------------------------------------------------------------------------- # + +$: << File.join(File.dirname(__FILE__), '../../vmm/ec2') + +require 'ec2_driver' + +host = ARGV[2] +ec2_drv = EC2Driver.new(host) + +ec2_drv.monitor_all_vms + diff --git a/src/im_mad/remotes/kvm.d/architecture.sh b/src/im_mad/remotes/kvm-probes.d/architecture.sh similarity index 100% rename from src/im_mad/remotes/kvm.d/architecture.sh rename to src/im_mad/remotes/kvm-probes.d/architecture.sh diff --git a/src/im_mad/remotes/kvm.d/cpu.sh b/src/im_mad/remotes/kvm-probes.d/cpu.sh similarity index 100% rename from src/im_mad/remotes/kvm.d/cpu.sh rename to src/im_mad/remotes/kvm-probes.d/cpu.sh diff --git a/src/im_mad/remotes/kvm.d/kvm.rb b/src/im_mad/remotes/kvm-probes.d/kvm.rb similarity index 100% rename from src/im_mad/remotes/kvm.d/kvm.rb rename to src/im_mad/remotes/kvm-probes.d/kvm.rb diff --git a/src/im_mad/remotes/kvm.d/name.sh b/src/im_mad/remotes/kvm-probes.d/name.sh similarity index 100% rename from src/im_mad/remotes/kvm.d/name.sh rename to src/im_mad/remotes/kvm-probes.d/name.sh diff --git a/src/im_mad/remotes/kvm.d/poll.sh b/src/im_mad/remotes/kvm-probes.d/poll.sh similarity index 100% rename from src/im_mad/remotes/kvm.d/poll.sh rename to src/im_mad/remotes/kvm-probes.d/poll.sh diff --git a/src/im_mad/remotes/kvm.d/collectd-client.rb b/src/im_mad/remotes/kvm.d/collectd-client.rb new file mode 120000 index 0000000000..bcef3f5682 --- /dev/null +++ b/src/im_mad/remotes/kvm.d/collectd-client.rb @@ -0,0 +1 @@ +../common.d/collectd-client.rb \ No newline at end of file diff --git a/src/im_mad/remotes/kvm.d/collectd-client_control.sh b/src/im_mad/remotes/kvm.d/collectd-client_control.sh new file mode 120000 index 0000000000..c062769fd0 --- /dev/null +++ b/src/im_mad/remotes/kvm.d/collectd-client_control.sh @@ -0,0 +1 @@ +../common.d/collectd-client_control.sh \ No newline at end of file diff --git a/src/im_mad/remotes/xen.d/architecture.sh b/src/im_mad/remotes/xen-probes.d/architecture.sh similarity index 100% rename from src/im_mad/remotes/xen.d/architecture.sh rename to src/im_mad/remotes/xen-probes.d/architecture.sh diff --git a/src/im_mad/remotes/xen.d/cpu.sh b/src/im_mad/remotes/xen-probes.d/cpu.sh similarity index 100% rename from src/im_mad/remotes/xen.d/cpu.sh rename to src/im_mad/remotes/xen-probes.d/cpu.sh diff --git a/src/im_mad/remotes/xen.d/name.sh b/src/im_mad/remotes/xen-probes.d/name.sh similarity index 100% rename from src/im_mad/remotes/xen.d/name.sh rename to src/im_mad/remotes/xen-probes.d/name.sh diff --git a/src/im_mad/remotes/xen.d/poll3.sh b/src/im_mad/remotes/xen-probes.d/poll3.sh similarity index 100% rename from src/im_mad/remotes/xen.d/poll3.sh rename to src/im_mad/remotes/xen-probes.d/poll3.sh diff --git a/src/im_mad/remotes/xen.d/poll4.sh b/src/im_mad/remotes/xen-probes.d/poll4.sh similarity index 100% rename from src/im_mad/remotes/xen.d/poll4.sh rename to src/im_mad/remotes/xen-probes.d/poll4.sh diff --git a/src/im_mad/remotes/xen.d/xen.rb b/src/im_mad/remotes/xen-probes.d/xen.rb similarity index 100% rename from src/im_mad/remotes/xen.d/xen.rb rename to src/im_mad/remotes/xen-probes.d/xen.rb diff --git a/src/im_mad/remotes/xen.d/collectd-client.rb b/src/im_mad/remotes/xen.d/collectd-client.rb new file mode 120000 index 0000000000..bcef3f5682 --- /dev/null +++ b/src/im_mad/remotes/xen.d/collectd-client.rb @@ -0,0 +1 @@ +../common.d/collectd-client.rb \ No newline at end of file diff --git a/src/im_mad/remotes/xen.d/collectd-client_control.sh b/src/im_mad/remotes/xen.d/collectd-client_control.sh new file mode 120000 index 0000000000..c062769fd0 --- /dev/null +++ b/src/im_mad/remotes/xen.d/collectd-client_control.sh @@ -0,0 +1 @@ +../common.d/collectd-client_control.sh \ No newline at end of file diff --git a/src/lcm/LifeCycleStates.cc b/src/lcm/LifeCycleStates.cc index 612caca169..5991d36541 100644 --- a/src/lcm/LifeCycleStates.cc +++ b/src/lcm/LifeCycleStates.cc @@ -1346,12 +1346,21 @@ void LifeCycleManager::attach_failure_action(int vid) tmpl.set(disk); - Quotas::quota_del(Quotas::IMAGE, uid, gid, &tmpl); - if ( disk->vector_value("IMAGE_ID", image_id) == 0 ) { + // Disk using an Image + Quotas::quota_del(Quotas::IMAGE, uid, gid, &tmpl); + imagem->release_image(oid, image_id, false); } + else // Volatile disk + { + // It is an update of the volatile counter without + // shutting destroying a VM + tmpl.add("VMS", 0); + + Quotas::quota_del(Quotas::VM, uid, gid, &tmpl); + } } } else diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index d462db9cc1..2d9afb4f5e 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -15,7 +15,7 @@ #--------------------------------------------------------------------------- # # This module provides an abstraction to generate an execution context for -# OpenNebula Drivers. The module has been designed to be included as part +# OpenNebula Drivers. The module has been designed to be included as part # of a driver and not to be used standalone. module DriverExecHelper # Action result strings for messages @@ -27,7 +27,7 @@ module DriverExecHelper def self.failed?(rc_str) return rc_str == RESULT[:failure] end - + #Initialize module variables def initialize_helper(directory, options) @config = read_configuration @@ -51,7 +51,7 @@ module DriverExecHelper # # METHODS FOR COMMAND LINE & ACTION PATHS - # + # # Given the action name and the parameter returns full path of the script # and appends its parameters. It uses @local_actions hash to know if the # actions is remote or local. If the local actions has defined an special @@ -96,7 +96,7 @@ module DriverExecHelper # # METHODS FOR LOGS & COMMAND OUTPUT - # + # # Sends a message to the OpenNebula core through stdout def send_message(action="-", result=RESULT[:failure], id="-", info="-") @send_mutex.synchronize { @@ -151,7 +151,7 @@ module DriverExecHelper } end - #This method returns the result in terms + #This method returns the result in terms def get_info_from_execution(command_exe) if command_exe.code == 0 result = RESULT[:success] @@ -165,10 +165,10 @@ module DriverExecHelper [result, info] end - + # - # - # Simple parser for the config file generated by OpenNebula + # + # Simple parser for the config file generated by OpenNebula def read_configuration one_config=nil @@ -192,7 +192,16 @@ module DriverExecHelper if m name=m[1].strip.upcase value=m[2].strip - config[name]=value + + if config[name] + if config[name].instance_of? Array + config[name] << value + else + config[name] = [config[name], value] + end + else + config[name]=value + end end end rescue Exception => e diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index 45c64c373f..66a03d9494 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -128,7 +128,7 @@ int SystemDB::check_db_version() oss << "SELECT version FROM " << ver_table << " WHERE oid=(SELECT MAX(oid) FROM " << ver_table << ")"; - db->exec(oss, this); + db->exec(oss, this, true); oss.str(""); unset_callback(); @@ -138,7 +138,7 @@ int SystemDB::check_db_version() // Table user_pool is present for all OpenNebula versions, and it // always contains at least the oneadmin user. oss << "SELECT MAX(oid) FROM user_pool"; - rc = db->exec(oss); + rc = db->exec(oss, 0, true); oss.str(""); @@ -268,7 +268,15 @@ int SystemDB::select_sys_attribute(const string& attr_name, string& attr_xml) /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -void Nebula::start() +void Nebula::bootstrap_db() +{ + start(true); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +void Nebula::start(bool bootstrap_only) { int rc; int fd; @@ -376,7 +384,7 @@ void Nebula::start() xmlInitParser(); // ----------------------------------------------------------- - // Pools + // Database // ----------------------------------------------------------- try { @@ -510,6 +518,19 @@ void Nebula::start() throw; } + if (bootstrap_only) + { + //XML Library + xmlCleanupParser(); + + NebulaLog::log("ONE", Log::INFO, "Database bootstrap finalized, exiting.\n"); + + return; + } + + // ----------------------------------------------------------- + // Pools + // ----------------------------------------------------------- try { int size; diff --git a/src/nebula/oned.cc b/src/nebula/oned.cc index 81e45adec3..5cfeda178f 100644 --- a/src/nebula/oned.cc +++ b/src/nebula/oned.cc @@ -32,9 +32,10 @@ static const char * usage = "SYNOPSIS\n" " Starts the OpenNebula daemon\n\n" "OPTIONS\n" -"\t-h\tprints this help.\n" "\t-v\tprints OpenNebula version and license\n" -"\t-f\tforeground, do not fork the oned daemon\n"; +"\t-h\tprints this help.\n" +"\t-f\tforeground, do not fork the oned daemon\n" +"\t-i\tinitialize the dabase and exit.\n"; static const char * susage = "usage: oned [-h] [-v] [-f]\n"; @@ -50,6 +51,24 @@ static void print_license() << "(http://www.apache.org/licenses/LICENSE-2.0).\n"; } +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +static void oned_init() +{ + try + { + Nebula& nd = Nebula::instance(); + nd.bootstrap_db(); + } + catch (exception &e) + { + cerr << e.what() << endl; + + return; + } +} + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -58,19 +77,19 @@ static void oned_main() try { Nebula& nd = Nebula::instance(); - nd.start(); + nd.start(); } catch (exception &e) { cerr << e.what() << endl; - + return; } } - + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ - + int main(int argc, char **argv) { int opt; @@ -80,8 +99,8 @@ int main(int argc, char **argv) pid_t pid,sid; string wd; int rc; - - while((opt = getopt(argc,argv,"vhf")) != -1) + + while((opt = getopt(argc,argv,"vhif")) != -1) switch(opt) { case 'v': @@ -92,9 +111,13 @@ int main(int argc, char **argv) cout << usage; exit(0); break; + case 'i': + oned_init(); + exit(0); + break; case 'f': foreground = true; - break; + break; default: cerr << susage; exit(-1); @@ -102,24 +125,24 @@ int main(int argc, char **argv) } // --------------------------------- - // Check if other oned is running - // --------------------------------- - + // Check if other oned is running + // --------------------------------- + string lockfile; string var_location; - + nl = getenv("ONE_LOCATION"); if (nl == 0) // OpenNebula in root of FSH { - var_location = "/var/lib/one/"; + var_location = "/var/lib/one/"; lockfile = "/var/lock/one/one"; } else { var_location = nl; var_location += "/var/"; - + lockfile = var_location + ".lock"; } @@ -127,70 +150,70 @@ int main(int argc, char **argv) if( fd == -1) { - cerr<< "Error: Cannot start oned, opening lock file " << lockfile + cerr<< "Error: Cannot start oned, opening lock file " << lockfile << endl; - + exit(-1); } close(fd); - - // ---------------------------- - // Fork & exit main process - // ---------------------------- - + + // ---------------------------- + // Fork & exit main process + // ---------------------------- + if (foreground == true) { pid = 0; //Do not fork } else { - pid = fork(); + pid = fork(); } - + switch (pid){ case -1: // Error - cerr << "Error: Unable to fork.\n"; + cerr << "Error: Unable to fork.\n"; exit(-1); - + case 0: // Child process - + rc = chdir(var_location.c_str()); - + if (rc != 0) { goto error_chdir; } - + if (foreground == false) - { + { sid = setsid(); - + if (sid == -1) { goto error_sid; } } - + oned_main(); - - unlink(lockfile.c_str()); + + unlink(lockfile.c_str()); break; default: // Parent process - break; + break; } - + return 0; - + error_chdir: cerr << "Error: cannot change to dir " << wd << "\n"; unlink(lockfile.c_str()); exit(-1); -error_sid: +error_sid: cerr << "Error: creating new session\n"; unlink(lockfile.c_str()); exit(-1); diff --git a/src/oca/java/src/org/opennebula/client/OneSystem.java b/src/oca/java/src/org/opennebula/client/OneSystem.java index 4b2fae4ba2..f899167940 100644 --- a/src/oca/java/src/org/opennebula/client/OneSystem.java +++ b/src/oca/java/src/org/opennebula/client/OneSystem.java @@ -32,7 +32,7 @@ public class OneSystem private static final String GROUP_QUOTA_INFO = "groupquota.info"; private static final String GROUP_QUOTA_UPDATE = "groupquota.update"; - public static final String VERSION = "4.3.0"; + public static final String VERSION = "4.3.80"; public OneSystem(Client client) { diff --git a/src/oca/ruby/opennebula.rb b/src/oca/ruby/opennebula.rb index 74a45b79c0..5e9feea709 100644 --- a/src/oca/ruby/opennebula.rb +++ b/src/oca/ruby/opennebula.rb @@ -54,5 +54,5 @@ require 'opennebula/system' module OpenNebula # OpenNebula version - VERSION = '4.3.0' + VERSION = '4.3.80' end diff --git a/src/onedb/4.2.0_to_4.3.80.rb b/src/onedb/4.2.0_to_4.3.80.rb index e79db99b15..4c893b9b03 100644 --- a/src/onedb/4.2.0_to_4.3.80.rb +++ b/src/onedb/4.2.0_to_4.3.80.rb @@ -28,7 +28,7 @@ module Migrator def up ######################################################################## - # Feature #1742 + # Feature #1742 & #1612 ######################################################################## @db.run "ALTER TABLE user_pool RENAME TO old_user_pool;" @@ -39,6 +39,11 @@ module Migrator doc.root.add_element("GROUPS").add_element("ID").text = row[:gid].to_s + # oneadmin does not have quotas + if row[:oid] != 0 + redo_vm_quotas(doc, "uid=#{row[:oid]}") + end + @db[:user_pool].insert( :oid => row[:oid], :name => row[:name], @@ -52,6 +57,44 @@ module Migrator @db.run "DROP TABLE old_user_pool;" + ######################################################################## + # Feature #1612 + ######################################################################## + + @db.run "ALTER TABLE group_pool RENAME TO old_group_pool;" + @db.run "CREATE TABLE group_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));" + + # oneadmin group does not have quotas + @db.fetch("SELECT * FROM old_group_pool WHERE oid=0") do |row| + @db[:group_pool].insert( + :oid => row[:oid], + :name => row[:name], + :body => row[:body], + :uid => row[:oid], + :gid => row[:gid], + :owner_u => row[:owner_u], + :group_u => row[:group_u], + :other_u => row[:other_u]) + end + + @db.fetch("SELECT * FROM old_group_pool WHERE oid>0") do |row| + doc = REXML::Document.new(row[:body]) + + redo_vm_quotas(doc, "gid=#{row[:oid]}") + + @db[:group_pool].insert( + :oid => row[:oid], + :name => row[:name], + :body => doc.root.to_s, + :uid => row[:oid], + :gid => row[:gid], + :owner_u => row[:owner_u], + :group_u => row[:group_u], + :other_u => row[:other_u]) + end + + @db.run "DROP TABLE old_group_pool;" + ######################################################################## # Bug #2330 ######################################################################## @@ -82,4 +125,81 @@ module Migrator return true end + + def redo_vm_quotas(doc, where_filter) + cpu_limit = "-1" + mem_limit = "-1" + vms_limit = "-1" + vol_limit = "-1" + + doc.root.each_element("VM_QUOTA/VM/CPU") { |e| + cpu_limit = e.text + } + + doc.root.each_element("VM_QUOTA/VM/MEMORY") { |e| + mem_limit = e.text + } + + doc.root.each_element("VM_QUOTA/VM/VMS") { |e| + vms_limit = e.text + } + + doc.root.delete_element("VM_QUOTA") + vm_quota = doc.root.add_element("VM_QUOTA") + + # VM quotas + cpu_used = 0 + mem_used = 0 + vms_used = 0 + vol_used = 0 + + @db.fetch("SELECT body FROM vm_pool WHERE #{where_filter} AND state<>6") do |vm_row| + vmdoc = REXML::Document.new(vm_row[:body]) + + # VM quotas + vmdoc.root.each_element("TEMPLATE/CPU") { |e| + cpu_used += e.text.to_f + } + + vmdoc.root.each_element("TEMPLATE/MEMORY") { |e| + mem_used += e.text.to_i + } + + vmdoc.root.each_element("TEMPLATE/DISK") { |e| + type = "" + + e.each_element("TYPE") { |t_elem| + type = t_elem.text.upcase + } + + if ( type == "SWAP" || type == "FS") + e.each_element("SIZE") { |size_elem| + vol_used += size_elem.text.to_f + } + end + } + + vms_used += 1 + end + + if (vms_used != 0 || + cpu_limit != "-1" || mem_limit != "-1" || vms_limit != "-1" || vol_limit != "-1" ) + + # VM quotas + vm_elem = vm_quota.add_element("VM") + + vm_elem.add_element("CPU").text = cpu_limit + vm_elem.add_element("CPU_USED").text = sprintf('%.2f', cpu_used) + + vm_elem.add_element("MEMORY").text = mem_limit + vm_elem.add_element("MEMORY_USED").text = mem_used.to_s + + vm_elem.add_element("VMS").text = vms_limit + vm_elem.add_element("VMS_USED").text = vms_used.to_s + + vm_elem.add_element("VOLATILE_SIZE").text = vol_limit + vm_elem.add_element("VOLATILE_SIZE_USED").text = sprintf('%.2f', vol_used) + end + end + end diff --git a/src/onedb/fsck.rb b/src/onedb/fsck.rb index 1d29fd41fd..306432af17 100644 --- a/src/onedb/fsck.rb +++ b/src/onedb/fsck.rb @@ -20,7 +20,7 @@ require 'ipaddr' require 'set' module OneDBFsck - VERSION = "4.3.0" + VERSION = "4.3.80" def db_version VERSION @@ -1286,6 +1286,7 @@ module OneDBFsck cpu_used = 0.0 mem_used = 0 vms_used = 0 + vol_used = 0.0 # VNet quotas vnet_usage = {} @@ -1301,12 +1302,28 @@ module OneDBFsck # truncate to 2 decimals cpu = (e.text.to_f * 100).to_i / 100.0 cpu_used += cpu + cpu_used = (cpu_used * 100).to_i / 100.0 } vmdoc.root.each_element("TEMPLATE/MEMORY") { |e| mem_used += e.text.to_i } + vmdoc.root.each_element("TEMPLATE/DISK") { |e| + type = "" + + e.each_element("TYPE") { |t_elem| + type = t_elem.text.upcase + } + + if ( type == "SWAP" || type == "FS") + e.each_element("SIZE") { |size_elem| + vol_used += size_elem.text.to_f + vol_used = (vol_used * 100).to_i / 100.0 + } + end + } + vms_used += 1 # VNet quotas @@ -1342,6 +1359,9 @@ module OneDBFsck vm_elem.add_element("VMS").text = "-1" vm_elem.add_element("VMS_USED").text = "0" + + vm_elem.add_element("VOLATILE_SIZE").text = "-1" + vm_elem.add_element("VOLATILE_SIZE_USED").text = "0" end @@ -1378,6 +1398,20 @@ module OneDBFsck end } + vm_elem.each_element("VOLATILE_SIZE_USED") { |e| + # Check if the float value or the string representation mismatch, + # but ignoring the precision + + different = ( e.text.to_f != vol_used || + ![sprintf('%.2f', vol_used), sprintf('%.1f', vol_used), sprintf('%.0f', vol_used)].include?(e.text) ) + + vol_used_str = sprintf('%.2f', vol_used) + + if different + log_error("#{resource} #{oid} quotas: VOLATILE_SIZE_USED has #{e.text} \tis\t#{vol_used_str}") + e.text = vol_used_str + end + } # VNet quotas diff --git a/src/ozones/Server/templates/index.html b/src/ozones/Server/templates/index.html index f3b170cb26..91397897a8 100644 --- a/src/ozones/Server/templates/index.html +++ b/src/ozones/Server/templates/index.html @@ -65,7 +65,7 @@
diff --git a/src/ozones/Server/templates/login.html b/src/ozones/Server/templates/login.html index 80ca0fe6df..18b7580f56 100644 --- a/src/ozones/Server/templates/login.html +++ b/src/ozones/Server/templates/login.html @@ -49,7 +49,7 @@
diff --git a/src/rm/RequestManagerVirtualMachine.cc b/src/rm/RequestManagerVirtualMachine.cc index 9688b42370..f53bf7171b 100644 --- a/src/rm/RequestManagerVirtualMachine.cc +++ b/src/rm/RequestManagerVirtualMachine.cc @@ -96,6 +96,120 @@ bool RequestManagerVirtualMachine::vm_authorization( /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ +bool RequestManagerVirtualMachine::quota_resize_authorization( + int oid, + Template * deltas, + RequestAttributes& att) +{ + PoolObjectAuth vm_perms; + VirtualMachine * vm = Nebula::instance().get_vmpool()->get(oid, true); + + if (vm == 0) + { + failure_response(NO_EXISTS, + get_error(object_name(PoolObjectSQL::VM),oid), + att); + + return false; + } + + vm->get_permissions(vm_perms); + + vm->unlock(); + + return quota_resize_authorization(deltas, att, vm_perms); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +bool RequestManagerVirtualMachine::quota_resize_authorization( + Template * deltas, + RequestAttributes& att, + PoolObjectAuth& vm_perms) +{ + int rc; + + string error_str; + + Nebula& nd = Nebula::instance(); + UserPool* upool = nd.get_upool(); + GroupPool* gpool = nd.get_gpool(); + + Quotas user_dquotas = nd.get_default_user_quota(); + Quotas group_dquotas = nd.get_default_group_quota(); + + if (vm_perms.uid != UserPool::ONEADMIN_ID) + { + User * user = upool->get(vm_perms.uid, true); + + if ( user != 0 ) + { + rc = user->quota.quota_update(Quotas::VM, deltas, user_dquotas, error_str); + + if (rc == false) + { + ostringstream oss; + + oss << object_name(PoolObjectSQL::USER) + << " [" << vm_perms.uid << "] " + << error_str; + + failure_response(AUTHORIZATION, + request_error(oss.str(), ""), + att); + + user->unlock(); + + return false; + } + + upool->update(user); + + user->unlock(); + } + } + + if (vm_perms.gid != GroupPool::ONEADMIN_ID) + { + Group * group = gpool->get(vm_perms.gid, true); + + if ( group != 0 ) + { + rc = group->quota.quota_update(Quotas::VM, deltas, group_dquotas, error_str); + + if (rc == false) + { + ostringstream oss; + RequestAttributes att_tmp(vm_perms.uid, -1, att); + + oss << object_name(PoolObjectSQL::GROUP) + << " [" << vm_perms.gid << "] " + << error_str; + + failure_response(AUTHORIZATION, + request_error(oss.str(), ""), + att); + + group->unlock(); + + quota_rollback(deltas, Quotas::VM, att_tmp); + + return false; + } + + gpool->update(group); + + group->unlock(); + } + } + + return true; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + int RequestManagerVirtualMachine::get_default_ds_information( int cluster_id, int& ds_id, @@ -1226,10 +1340,13 @@ void VirtualMachineAttach::request_execute(xmlrpc_c::paramList const& paramList, DispatchManager * dm = nd.get_dm(); VirtualMachineTemplate * tmpl = new VirtualMachineTemplate(); + VirtualMachineTemplate * deltas = 0; PoolObjectAuth host_perms; + PoolObjectAuth vm_perms; int rc; string error_str; + bool volatile_disk; int id = xmlrpc_c::value_int(paramList.getInt(1)); string str_tmpl = xmlrpc_c::value_string(paramList.getString(2)); @@ -1258,17 +1375,43 @@ void VirtualMachineAttach::request_execute(xmlrpc_c::paramList const& paramList, return; } - if ( quota_authorization(tmpl, Quotas::IMAGE, att) == false ) + volatile_disk = VirtualMachine::isVolatile(tmpl); + + if ( volatile_disk ) { - delete tmpl; - return; + deltas = new VirtualMachineTemplate(*tmpl); + + deltas->add("VMS", 0); + + if (quota_resize_authorization(id, deltas, att) == false) + { + delete tmpl; + delete deltas; + + return; + } + } + else + { + if ( quota_authorization(tmpl, Quotas::IMAGE, att) == false ) + { + delete tmpl; + return; + } } rc = dm->attach(id, tmpl, error_str); if ( rc != 0 ) { - quota_rollback(tmpl, Quotas::IMAGE, att); + if ( volatile_disk ) + { + quota_rollback(deltas, Quotas::VM, att); + } + else + { + quota_rollback(tmpl, Quotas::IMAGE, att); + } failure_response(ACTION, request_error(error_str, ""), @@ -1280,6 +1423,8 @@ void VirtualMachineAttach::request_execute(xmlrpc_c::paramList const& paramList, } delete tmpl; + delete deltas; + return; } @@ -1338,14 +1483,8 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList, int nvcpu, ovcpu; Nebula& nd = Nebula::instance(); - UserPool* upool = nd.get_upool(); - GroupPool* gpool = nd.get_gpool(); HostPool * hpool = nd.get_hpool(); - - Quotas user_dquotas = nd.get_default_user_quota(); - Quotas group_dquotas = nd.get_default_group_quota(); - - Host * host; + Host * host; Template deltas; string error_str; @@ -1494,69 +1633,9 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList, /* Check quotas */ /* ---------------------------------------------------------------------- */ - if (vm_perms.uid != UserPool::ONEADMIN_ID) + if (quota_resize_authorization(&deltas, att, vm_perms) == false) { - User * user = upool->get(vm_perms.uid, true); - - if ( user != 0 ) - { - rc = user->quota.quota_update(Quotas::VM, &deltas, user_dquotas, error_str); - - if (rc == false) - { - ostringstream oss; - - oss << object_name(PoolObjectSQL::USER) - << " [" << vm_perms.uid << "] " - << error_str; - - failure_response(AUTHORIZATION, - request_error(oss.str(), ""), - att); - - user->unlock(); - - return; - } - - upool->update(user); - - user->unlock(); - } - } - - if (vm_perms.gid != GroupPool::ONEADMIN_ID) - { - Group * group = gpool->get(vm_perms.gid, true); - - if ( group != 0 ) - { - rc = group->quota.quota_update(Quotas::VM, &deltas, group_dquotas, error_str); - - if (rc == false) - { - ostringstream oss; - RequestAttributes att_tmp(vm_perms.uid, -1, att); - - oss << object_name(PoolObjectSQL::GROUP) - << " [" << vm_perms.gid << "] " - << error_str; - - failure_response(AUTHORIZATION, - request_error(oss.str(), ""), - att); - - group->unlock(); - - quota_rollback(&deltas, Quotas::VM, att_tmp); - - return; - } - - gpool->update(group); - - group->unlock(); - } + return; } /* ---------------------------------------------------------------------- */ diff --git a/src/scheduler/src/sched/Scheduler.cc b/src/scheduler/src/sched/Scheduler.cc index 220fa426cf..c959eb6634 100644 --- a/src/scheduler/src/sched/Scheduler.cc +++ b/src/scheduler/src/sched/Scheduler.cc @@ -863,7 +863,7 @@ void Scheduler::dispatch() //------------------------------------------------------------------ // Dispatch and update host and DS capacity, and dispatch counters //------------------------------------------------------------------ - if (vmpool->dispatch(vm_it->first, hid, dsid, false) != 0) + if (vmpool->dispatch(vm_it->first, hid, dsid, vm->is_resched()) != 0) { continue; } diff --git a/src/sql/MySqlDB.cc b/src/sql/MySqlDB.cc index 652b799af8..90cccd1d3e 100644 --- a/src/sql/MySqlDB.cc +++ b/src/sql/MySqlDB.cc @@ -132,7 +132,7 @@ MySqlDB::~MySqlDB() /* -------------------------------------------------------------------------- */ -int MySqlDB::exec(ostringstream& cmd, Callbackable* obj) +int MySqlDB::exec(ostringstream& cmd, Callbackable* obj, bool quiet) { int rc; @@ -142,6 +142,8 @@ int MySqlDB::exec(ostringstream& cmd, Callbackable* obj) str = cmd.str(); c_str = str.c_str(); + Log::MessageType error_level = quiet ? Log::DDEBUG : Log::ERROR; + MYSQL *db; db = get_db_connection(); @@ -176,7 +178,7 @@ int MySqlDB::exec(ostringstream& cmd, Callbackable* obj) oss << ", error " << err_num << " : " << err_msg; } - NebulaLog::log("ONE",Log::ERROR,oss); + NebulaLog::log("ONE",error_level,oss); free_db_connection(db); @@ -204,7 +206,7 @@ int MySqlDB::exec(ostringstream& cmd, Callbackable* obj) oss << "SQL command was: " << c_str; oss << ", error " << err_num << " : " << err_msg; - NebulaLog::log("ONE",Log::ERROR,oss); + NebulaLog::log("ONE",error_level,oss); free_db_connection(db); diff --git a/src/sql/SqliteDB.cc b/src/sql/SqliteDB.cc index 11b2f7d7bd..e629addf0d 100644 --- a/src/sql/SqliteDB.cc +++ b/src/sql/SqliteDB.cc @@ -66,7 +66,7 @@ SqliteDB::~SqliteDB() /* -------------------------------------------------------------------------- */ -int SqliteDB::exec(ostringstream& cmd, Callbackable* obj) +int SqliteDB::exec(ostringstream& cmd, Callbackable* obj, bool quiet) { int rc; @@ -119,10 +119,12 @@ int SqliteDB::exec(ostringstream& cmd, Callbackable* obj) { if (err_msg != 0) { + Log::MessageType error_level = quiet ? Log::DDEBUG : Log::ERROR; + ostringstream oss; oss << "SQL command was: " << c_str << ", error: " << err_msg; - NebulaLog::log("ONE",Log::ERROR,oss); + NebulaLog::log("ONE",error_level,oss); sqlite3_free(err_msg); } diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js index 23ec93b022..8c68f1e907 100644 --- a/src/sunstone/public/js/plugins/config-tab.js +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -360,6 +360,7 @@ function updateUserConfigInfo(request,user_json) { var quotas_tab_html = Quotas.vms(info, default_user_quotas); quotas_tab_html += Quotas.cpu(info, default_user_quotas); quotas_tab_html += Quotas.memory(info, default_user_quotas); + quotas_tab_html += Quotas.volatile_size(info, default_user_quotas); quotas_tab_html += Quotas.image(info, default_user_quotas); quotas_tab_html += Quotas.network(info, default_user_quotas); quotas_tab_html += Quotas.datastore(info, default_user_quotas); @@ -456,6 +457,7 @@ function fillGroupQuotas(group_id){ 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); + quotas_tab_html += Quotas.volatile_size(info, default_group_quotas); quotas_tab_html += Quotas.image(info, default_group_quotas); quotas_tab_html += Quotas.network(info, default_group_quotas); quotas_tab_html += Quotas.datastore(info, default_group_quotas); diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index a0367c3798..e6c497d3dd 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -1047,6 +1047,8 @@ function setupCreateDatastoreDialog(){ $create_datastore_dialog.remove(); setupCreateDatastoreDialog(); + window.ds_wizard_is_not_first="false"; + popUpCreateDatastoreDialog(); }); @@ -1055,6 +1057,8 @@ function setupCreateDatastoreDialog(){ $create_datastore_dialog.remove(); setupCreateDatastoreDialog(); + window.ds_wizard_is_not_first="false"; + popUpCreateDatastoreDialog(); $("a[href='#datastore_manual']").click(); }); @@ -1155,8 +1159,12 @@ function popUpCreateDatastoreDialog(){ $('select#datastore_cluster_raw',$create_datastore_dialog).html(clusters_sel()); $create_datastore_dialog.reveal(); $("input#name",$create_datastore_dialog).focus(); - hide_all($create_datastore_dialog); - select_filesystem(); + if(window.ds_wizard_is_not_first != "true") + { + hide_all($create_datastore_dialog); + select_filesystem(); + window.ds_wizard_is_not_first="true"; + } } //Prepares autorefresh diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index bf59d3caae..bac5cd7650 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -133,10 +133,10 @@ var group_quotas_tmpl = '
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\ @@ -144,10 +144,10 @@ var group_quotas_tmpl = '
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\ @@ -155,16 +155,27 @@ var group_quotas_tmpl = '
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\
\
\
\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ +
\ +
\ +
\
\
\
\ @@ -528,9 +539,10 @@ function updateGroupInfo(request,group){ var info = group.GROUP; 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) + '
'; + 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) + '
'; + quotas_tab_html += '
' + Quotas.volatile_size(info, default_group_quotas) + '
'; quotas_tab_html += '

'; quotas_tab_html += '
' + Quotas.image(info, default_group_quotas) + '
'; quotas_tab_html += '
' + Quotas.network(info, default_group_quotas) + '
'; diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index 2a1aa1d57a..2add849c63 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -219,10 +219,10 @@ var user_quotas_tmpl = '
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\ @@ -230,10 +230,10 @@ var user_quotas_tmpl = '
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\ @@ -241,16 +241,27 @@ var user_quotas_tmpl = '
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\
\
\
\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ +
\ +
\ +
\
\
\
\ @@ -780,9 +791,10 @@ function updateUserInfo(request,user){ }; var default_user_quotas = Quotas.default_quotas(info.DEFAULT_USER_QUOTAS) - var quotas_tab_html = '
' + Quotas.vms(info, default_user_quotas) + '
'; - quotas_tab_html += '
' + Quotas.cpu(info, default_user_quotas) + '
'; - quotas_tab_html += '
' + Quotas.memory(info, default_user_quotas) + '
'; + var quotas_tab_html = '
' + Quotas.vms(info, default_user_quotas) + '
'; + quotas_tab_html += '
' + Quotas.cpu(info, default_user_quotas) + '
'; + quotas_tab_html += '
' + Quotas.memory(info, default_user_quotas) + '
'; + quotas_tab_html += '
' + Quotas.volatile_size(info, default_user_quotas) + '
'; quotas_tab_html += '

'; quotas_tab_html += '
' + Quotas.image(info, default_user_quotas) + '
'; quotas_tab_html += '
' + Quotas.network(info, default_user_quotas) + '
'; diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index 24062c3a13..1641c756bc 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -1238,6 +1238,21 @@ var Quotas = { return ''; } }, + "volatile_size" : function(info, default_quotas){ + if (!$.isEmptyObject(info.VM_QUOTA)){ + var volatile_bar = quotaBarMB( + info.VM_QUOTA.VM.VOLATILE_SIZE_USED, + info.VM_QUOTA.VM.VOLATILE_SIZE, + default_quotas.VM_QUOTA.VM.VOLATILE_SIZE); + + var quotas_tab_html = + '
' + tr("Volatile disks") + '
'+volatile_bar+'

' + + return quotas_tab_html; + } else { + return ''; + } + }, "datastore" : function(info, default_quotas) { if (!$.isEmptyObject(info.DATASTORE_QUOTA)){ var quotas_tab_html = @@ -1410,9 +1425,10 @@ var Quotas = { if ($.isEmptyObject(default_quotas.VM_QUOTA)){ default_quotas.VM_QUOTA = { "VM" : { - "VMS" : "0", - "MEMORY" : "0", - "CPU" : "0" + "VMS" : "0", + "MEMORY" : "0", + "CPU" : "0", + "VOLATILE_SIZE" : "0" } } } @@ -1581,6 +1597,7 @@ function setupQuotaIcons(){ $('div#vm_quota input[name="VMS"]',dialog).val(quota.VMS); $('div#vm_quota input[name="MEMORY"]',dialog).val(quota.MEMORY); $('div#vm_quota input[name="CPU"]',dialog).val(quota.CPU); + $('div#vm_quota input[name="VOLATILE_SIZE"]',dialog).val(quota.VOLATILE_SIZE); break; case "DATASTORE": $('div#datastore_quota select[name="ID"]',dialog).val(quota.ID); @@ -1675,7 +1692,8 @@ function quotaListItem(quota_json){ case "VM": str += 'VMs: ' + quota_json.VMS + (quota_json.VMS_USED ? ' (' + quota_json.VMS_USED + '). ' : ". ") + '
' + 'Memory: ' + quota_json.MEMORY + (quota_json.MEMORY_USED ? ' MB (' + quota_json.MEMORY_USED + ' MB). ' : " MB. ") + '
' + - 'CPU: ' + quota_json.CPU + (quota_json.CPU_USED ? ' (' + quota_json.CPU_USED + '). ' : ". "); + 'CPU: ' + quota_json.CPU + (quota_json.CPU_USED ? ' (' + quota_json.CPU_USED + '). ' : ". ") + '
' + + 'Volatile disks: ' + quota_json.VOLATILE_SIZE + (quota_json.VOLATILE_SIZE_USED ? ' MB (' + quota_json.VOLATILE_SIZE_USED + ' MB). ' : " MB. "); break; case "DATASTORE": str += 'ID/Name: ' + getDatastoreName(quota_json.ID) + '. ' + '
' + @@ -1850,7 +1868,14 @@ function insert_extended_template_table(template_json,resource_type,resource_id, if ( new_value != "" && new_key != "" ) { var template_json_bk = $.extend({}, template_json); - template_json[$.trim(new_key)] = $.trim(new_value); + if(template_json[$.trim(new_key)] && (template_json[$.trim(new_key)] instanceof Array)) + { + template_json[$.trim(new_key)].push($.trim(new_value)); + } + else + { + template_json[$.trim(new_key)]=$.trim(new_value); + } template_str = convert_template_to_string(template_json,unshown_values); Sunstone.runAction(resource_type+".update_template",resource_id,template_str); diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index 8901ce6e94..41972cffb1 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -86,7 +86,7 @@
diff --git a/src/sunstone/views/login.erb b/src/sunstone/views/login.erb index b17d3ac7ee..6a554260f2 100644 --- a/src/sunstone/views/login.erb +++ b/src/sunstone/views/login.erb @@ -26,7 +26,7 @@ diff --git a/src/tm/TransferManager.cc b/src/tm/TransferManager.cc index 20c627d1ab..618ba9cc6d 100644 --- a/src/tm/TransferManager.cc +++ b/src/tm/TransferManager.cc @@ -148,7 +148,11 @@ void TransferManager::trigger(Actions action, int _vid) void TransferManager::do_action(const string &action, void * arg) { - int vid; + int vid; + VirtualMachine * vm; + Host * host; + bool host_is_hybrid; + Nebula& nd = Nebula::instance(); if (arg == 0) { @@ -159,41 +163,118 @@ void TransferManager::do_action(const string &action, void * arg) delete static_cast(arg); + vm = vmpool->get(vid,true); + + if (vm == 0) + { + return; + } + + host = hpool->get(vm->get_hid(),true); + host_is_hybrid=host->isHybrid(); + + vm->unlock(); + host->unlock(); + if (action == "PROLOG") { - prolog_action(vid); + if (host_is_hybrid) + { + (nd.get_lcm())->trigger(LifeCycleManager::PROLOG_SUCCESS,vid); + } + else + { + prolog_action(vid); + } } else if (action == "PROLOG_MIGR") { - prolog_migr_action(vid); + if (host_is_hybrid) + { + (nd.get_lcm())->trigger(LifeCycleManager::PROLOG_SUCCESS,vid); + } + else + { + prolog_migr_action(vid); + } } else if (action == "PROLOG_RESUME") { - prolog_resume_action(vid); + if (host_is_hybrid) + { + (nd.get_lcm())->trigger(LifeCycleManager::PROLOG_SUCCESS,vid); + } + else + { + prolog_resume_action(vid); + } } else if (action == "EPILOG") { - epilog_action(vid); + if (host_is_hybrid) + { + (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_SUCCESS,vid); + } + else + { + epilog_action(vid); + } } else if (action == "EPILOG_STOP") { - epilog_stop_action(vid); + if (host_is_hybrid) + { + (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_SUCCESS,vid); + } + else + { + epilog_stop_action(vid); + } } else if (action == "EPILOG_DELETE") { - epilog_delete_action(vid); + if (host_is_hybrid) + { + (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_SUCCESS,vid); + } + else + { + epilog_delete_action(vid); + } } else if (action == "EPILOG_DELETE_STOP") { - epilog_delete_stop_action(vid); + if (host_is_hybrid) + { + (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_SUCCESS,vid); + } + else + { + epilog_delete_stop_action(vid); + } } else if (action == "EPILOG_DELETE_PREVIOUS") { - epilog_delete_previous_action(vid); + if (host_is_hybrid) + { + (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_SUCCESS,vid); + } + else + { + epilog_delete_previous_action(vid); + + } } else if (action == "EPILOG_DELETE_BOTH") { - epilog_delete_both_action(vid); + if (host_is_hybrid) + { + (nd.get_lcm())->trigger(LifeCycleManager::EPILOG_SUCCESS,vid); + } + else + { + epilog_delete_both_action(vid); + } } else if (action == "CHECKPOINT") { @@ -460,7 +541,6 @@ void TransferManager::prolog_action(int vid) } int uid = vm->get_uid(); - vm->unlock(); User * user = Nebula::instance().get_upool()->get(uid, true); @@ -653,19 +733,6 @@ error_common: /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -static bool isVolatile(const VectorAttribute * disk) -{ - string type; - - type = disk->vector_value("TYPE"); - transform(type.begin(),type.end(),type.begin(),(int(*)(int))toupper); - - return ( type == "SWAP" || type == "FS"); -} - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - void TransferManager::prolog_migr_action(int vid) { ofstream xfr; @@ -736,7 +803,7 @@ void TransferManager::prolog_migr_action(int vid) disk->vector_value_str("DISK_ID", disk_id); - if ( isVolatile(disk) == true ) + if ( VirtualMachine::isVolatile(disk) == true ) { tm_mad = vm_tm_mad; ds_id = vm_ds_id; @@ -875,7 +942,7 @@ void TransferManager::prolog_resume_action(int vid) disk->vector_value_str("DISK_ID", disk_id); - if ( isVolatile(disk) == true ) + if ( VirtualMachine::isVolatile(disk) == true ) { tm_mad = vm_tm_mad; ds_id = vm_ds_id; @@ -999,7 +1066,7 @@ void TransferManager::epilog_transfer_command( } else //No saving disk { - if ( isVolatile(disk) == true ) + if ( VirtualMachine::isVolatile(disk) == true ) { tm_mad = vm->get_tm_mad(); ds_id = vm->get_ds_id(); @@ -1205,7 +1272,7 @@ void TransferManager::epilog_stop_action(int vid) disk->vector_value_str("DISK_ID", disk_id); - if ( isVolatile(disk) == true ) + if ( VirtualMachine::isVolatile(disk) == true ) { tm_mad = vm_tm_mad; ds_id = vm_ds_id; @@ -1357,7 +1424,7 @@ int TransferManager::epilog_delete_commands(VirtualMachine *vm, disk->vector_value_str("DISK_ID", disk_id); - if ( isVolatile(disk) == true ) + if ( VirtualMachine::isVolatile(disk) == true ) { tm_mad = vm_tm_mad; ds_id = vm_ds_id; diff --git a/src/um/QuotaVirtualMachine.cc b/src/um/QuotaVirtualMachine.cc index a7cf49c240..7da8cb5101 100644 --- a/src/um/QuotaVirtualMachine.cc +++ b/src/um/QuotaVirtualMachine.cc @@ -16,13 +16,15 @@ #include "QuotaVirtualMachine.h" #include "Quotas.h" +#include "VirtualMachine.h" /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -const char * QuotaVirtualMachine::VM_METRICS[] = {"VMS", "CPU", "MEMORY"}; +const char * QuotaVirtualMachine::VM_METRICS[] = + {"VMS", "CPU", "MEMORY", "VOLATILE_SIZE"}; -const int QuotaVirtualMachine::NUM_VM_METRICS = 3; +const int QuotaVirtualMachine::NUM_VM_METRICS = 4; /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -56,7 +58,7 @@ bool QuotaVirtualMachine::check(Template * tmpl, map vm_request; int memory; - float cpu; + float cpu, size; if ( tmpl->get("MEMORY", memory) == false || memory <= 0 ) { @@ -70,9 +72,12 @@ bool QuotaVirtualMachine::check(Template * tmpl, return false; } + size = VirtualMachine::get_volatile_disk_size(tmpl); + vm_request.insert(make_pair("VMS",1)); vm_request.insert(make_pair("MEMORY", memory)); vm_request.insert(make_pair("CPU", cpu)); + vm_request.insert(make_pair("VOLATILE_SIZE", size)); return check_quota("", vm_request, default_quotas, error); } @@ -85,7 +90,7 @@ void QuotaVirtualMachine::del(Template * tmpl) map vm_request; int memory, vms; - float cpu; + float cpu, size; if ( tmpl->get("MEMORY", memory) == false ) { @@ -102,9 +107,12 @@ void QuotaVirtualMachine::del(Template * tmpl) vms = 1; } + size = VirtualMachine::get_volatile_disk_size(tmpl); + vm_request.insert(make_pair("VMS", vms)); vm_request.insert(make_pair("MEMORY", memory)); vm_request.insert(make_pair("CPU", cpu)); + vm_request.insert(make_pair("VOLATILE_SIZE", size)); del_quota("", vm_request); } @@ -130,7 +138,7 @@ bool QuotaVirtualMachine::update(Template * tmpl, map vm_request; int delta_memory; - float delta_cpu; + float delta_cpu, delta_size; if ( tmpl->get("MEMORY", delta_memory) == true ) { @@ -142,5 +150,12 @@ bool QuotaVirtualMachine::update(Template * tmpl, vm_request.insert(make_pair("CPU", delta_cpu)); } + delta_size = VirtualMachine::get_volatile_disk_size(tmpl); + + if ( delta_size != 0 ) + { + vm_request.insert(make_pair("VOLATILE_SIZE", delta_size)); + } + return check_quota("", vm_request, default_quotas, error); } diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 33395a6831..85b8bf1bb0 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -1103,6 +1103,7 @@ int VirtualMachine::automatic_requirements(string& error_str) ostringstream oss; string requirements; string cluster_id = ""; + string hypervisor; int incomp_id; int rc; @@ -1181,9 +1182,21 @@ int VirtualMachine::automatic_requirements(string& error_str) if ( !cluster_id.empty() ) { - oss.str(""); oss << "CLUSTER_ID = " << cluster_id; + } + if (static_cast(obj_template)->get_hybrid_hypervisor(hypervisor)) + { + if ( !cluster_id.empty() ) + { + oss << " || "; + } + + oss << "HYPERVISOR = " << hypervisor; + } + + if ( !cluster_id.empty() || !hypervisor.empty() ) + { obj_template->add("AUTOMATIC_REQUIREMENTS", oss.str()); } @@ -2009,6 +2022,83 @@ VectorAttribute * VirtualMachine::delete_attach_disk() /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ +bool VirtualMachine::isVolatile(const VectorAttribute * disk) +{ + string type = disk->vector_value("TYPE"); + + one_util::toupper(type); + + return ( type == "SWAP" || type == "FS"); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +bool VirtualMachine::isVolatile(const Template * tmpl) +{ + vector disks; + int num_disks = tmpl->get("DISK", disks); + + for (int i = 0 ; i < num_disks ; i++) + { + const VectorAttribute * disk = dynamic_cast(disks[i]); + + if (disk == 0) + { + continue; + } + + if (VirtualMachine::isVolatile(disk)) + { + return true; + } + } + + return false; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +float VirtualMachine::get_volatile_disk_size(Template * tmpl) +{ + float size = 0; + + vector disks; + int num_disks = tmpl->get("DISK", disks); + + if (num_disks == 0) + { + return size; + } + + for (int i = 0 ; i < num_disks ; i++) + { + float disk_size; + const VectorAttribute * disk = dynamic_cast(disks[i]); + + if (disk == 0) + { + continue; + } + + if (!VirtualMachine::isVolatile(disk)) + { + continue; + } + + if (disk->vector_value("SIZE", disk_size) == 0) + { + size += disk_size; + } + } + + return size; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + void VirtualMachine::get_nic_info(int& max_nic_id) { vector nics; diff --git a/src/vm/VirtualMachineTemplate.cc b/src/vm/VirtualMachineTemplate.cc index fd7ae6af9e..6504727a17 100644 --- a/src/vm/VirtualMachineTemplate.cc +++ b/src/vm/VirtualMachineTemplate.cc @@ -15,12 +15,21 @@ /* -------------------------------------------------------------------------- */ #include "VirtualMachineTemplate.h" +#include "Host.h" /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ vector VirtualMachineTemplate::restricted_attributes; +/* ************************************************************************ */ +/* Hybrid Attributes */ +/* ************************************************************************ */ + +const char * VirtualMachineTemplate::HYBRID_ATTRIBUTES[] = {"EC2"}; + +const int VirtualMachineTemplate::NUM_HYBRID_ATTRIBUTES = 1; + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -136,3 +145,21 @@ void VirtualMachineTemplate::remove_all_except_restricted() } /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ + +bool VirtualMachineTemplate::get_hybrid_hypervisor(string& hypervisor) const +{ + vector attrs; + bool found_it = false; + + for(int i=0; i < NUM_HYBRID_ATTRIBUTES; i++) + { + if(get(HYBRID_ATTRIBUTES[i],attrs)) + { + hypervisor = Host::get_hybrid_hypervisor_by_id(i); + found_it = true; + break; + } + } + + return found_it; +} diff --git a/src/vm_template/VMTemplate.cc b/src/vm_template/VMTemplate.cc index 63415969ec..28683784ff 100644 --- a/src/vm_template/VMTemplate.cc +++ b/src/vm_template/VMTemplate.cc @@ -18,7 +18,6 @@ #define TO_UPPER(S) transform(S.begin(),S.end(),S.begin(),(int(*)(int))toupper) - /* ************************************************************************ */ /* VMTemplate :: Constructor/Destructor */ /* ************************************************************************ */ @@ -241,3 +240,6 @@ int VMTemplate::from_xml(const string& xml) return 0; } + +/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------ */ diff --git a/src/vmm_mad/ec2/one_vmm_ec2.rb b/src/vmm_mad/ec2/one_vmm_ec2.rb deleted file mode 100755 index 0399177b42..0000000000 --- a/src/vmm_mad/ec2/one_vmm_ec2.rb +++ /dev/null @@ -1,408 +0,0 @@ -#!/usr/bin/env ruby -# ---------------------------------------------------------------------------- # -# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # -# # -# Licensed 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. # -# ---------------------------------------------------------------------------- # - -# Set up the environment for the driver - -EC2_LOCATION = ENV["EC2_HOME"] - -if !EC2_LOCATION - puts "EC2_HOME not set" - exit(-1) -end - -EC2_JVM_CONCURRENCY = ENV["EC2_JVM_CONCURRENCY"] - -ONE_LOCATION = ENV["ONE_LOCATION"] - -if !ONE_LOCATION - RUBY_LIB_LOCATION = "/usr/lib/one/ruby" - ETC_LOCATION = "/etc/one/" -else - RUBY_LIB_LOCATION = ONE_LOCATION + "/lib/ruby" - ETC_LOCATION = ONE_LOCATION + "/etc/" -end - -$: << RUBY_LIB_LOCATION - -require "VirtualMachineDriver" -require "CommandManager" -require 'scripts_common' -require "rexml/document" - -# The main class for the EC2 driver -class EC2Driver < VirtualMachineDriver - - # EC2 commands constants - EC2 = { - :run => { - :cmd => "#{EC2_LOCATION}/bin/ec2-run-instances", - :args => { - "AKI" => { - :opt => '--kernel' - }, - "AMI" => { - :opt => '' - }, - "BLOCKDEVICEMAPPING" => { - :opt => '-b' - }, - "CLIENTTOKEN" => { - :opt => '--client-token' - }, - "INSTANCETYPE" => { - :opt => '-t' - }, - "KEYPAIR" => { - :opt => '-k' - }, - "LICENSEPOOL" => { - :opt => '--license-pool' - }, - "PLACEMENTGROUP" => { - :opt => '--placement-group' - }, - "PRIVATEIP" => { - :opt => '--private-ip-address' - }, - "RAMDISK" => { - :opt => '--ramdisk' - }, - "SUBNETID" => { - :opt => '-s' - }, - "TENANCY" => { - :opt => '--tenancy' - }, - "USERDATA" => { - :opt => '-d' - }, - "USERDATAFILE" => { - :opt => '-f' - }, - "SECURITYGROUPS" => { - :opt => '-g', - :proc => lambda {|str| str.split(',').join(' -g ')} - }, - "AVAILABILITYZONE" => { - :opt => '--availability-zone' - } - } - }, - :terminate => { - :cmd => "#{EC2_LOCATION}/bin/ec2-terminate-instances" - }, - :describe => { - :cmd => "#{EC2_LOCATION}/bin/ec2-describe-instances" - }, - :associate => { - :cmd => "#{EC2_LOCATION}/bin/ec2-associate-address", - :args => { - "SUBNETID" => { - :opt => '-a', - :proc => lambda {|str| ''} - }, - "ELASTICIP" => { - :opt => '' - } - } - }, - :authorize => { - :cmd => "#{EC2_LOCATION}/bin/ec2-authorize", - :args => { - "AUTHORIZEDPORTS" => { - :opt => '-p', - :proc => lambda {|str| str.split(',').join(' -p ')} - } - } - }, - :reboot => { - :cmd => "#{EC2_LOCATION}/bin/ec2-reboot-instances" - }, - :stop => { - :cmd => "#{EC2_LOCATION}/bin/ec2-stop-instances" - }, - :start => { - :cmd => "#{EC2_LOCATION}/bin/ec2-start-instances" - }, - :tags => { - :cmd => "#{EC2_LOCATION}/bin/ec2-create-tags", - :args => { - "TAGS" => { - :opt => '-t', - :proc => lambda {|str| str.split(',').join(' -t ')} - } - } - } - } - - # EC2 constructor, loads defaults for the EC2Driver - def initialize(ec2_conf = nil) - if !EC2_JVM_CONCURRENCY - concurrency = 5 - else - concurrency = EC2_JVM_CONCURRENCY.to_i - end - - super('', :concurrency => concurrency, :threaded => true) - - @defaults = Hash.new - - if ec2_conf && File.exists?(ec2_conf) - fd = File.new(ec2_conf) - xml = REXML::Document.new fd - fd.close() - - return if !xml || !xml.root - - ec2 = xml.root.elements["EC2"] - - return if !ec2 - - EC2.each {|action, hash| - if hash[:args] - hash[:args].each { |key, value| - @defaults[key] = value_from_xml(ec2, key) - } - end - } - end - end - - # DEPLOY action, also sets ports and ip if needed - def deploy(id, drv_message) - ec2_info = get_deployment_info(drv_message) - return unless ec2_info - - if !ec2_value(ec2_info, 'AMI') - msg = "Cannot find AMI in deployment file" - send_message(ACTION[:deploy], RESULT[:failure], id, msg) - return - end - - deploy_exe = exec_and_log_ec2(:run, ec2_info, "", id) - if deploy_exe.code != 0 - msg = deploy_exe.stderr - send_message(ACTION[:deploy], RESULT[:failure], id, msg) - return - end - - if !deploy_exe.stdout.match(/^INSTANCE\s*(.+?)\s/) - msg = "Could not find instance id. Check ec2-describe-instances" - send_message(ACTION[:deploy], RESULT[:failure], id, msg) - return - end - - deploy_id = $1 - - if ec2_value(ec2_info, 'AUTHORIZEDPORTS') - exec_and_log_ec2(:authorize, ec2_info, 'default', id) - end - - if ec2_value(ec2_info, 'TAGS') - exec_and_log_ec2(:tags, ec2_info, deploy_id, id) - end - - if ec2_value(ec2_info, 'ELASTICIP') - exec_and_log_ec2(:associate, ec2_info, "-i #{deploy_id}", id) - end - - send_message(ACTION[:deploy], RESULT[:success], id, deploy_id) - end - - # Shutdown a EC2 instance - def shutdown(id, drv_message) - ec2_action(drv_message, :terminate, ACTION[:shutdown], id) - end - - # Reboot a EC2 instance - def reboot(id, drv_message) - ec2_action(drv_message, :reboot, ACTION[:reboot], id) - end - - # Cancel a EC2 instance - def cancel(id, drv_message) - ec2_action(drv_message, :terminate, ACTION[:cancel], id) - end - - # Stop a EC2 instance - def save(id, drv_message) - ec2_action(drv_message, :stop, ACTION[:save], id) - end - - # Cancel a EC2 instance - def restore(id, drv_message) - ec2_action(drv_message, :start, ACTION[:restor], id) - end - - # Get info (IP, and state) for a EC2 instance - def poll(id, drv_message) - msg = decode(drv_message) - - deploy_id = msg.elements["DEPLOY_ID"].text - - info = "#{POLL_ATTRIBUTE[:usedmemory]}=0 " \ - "#{POLL_ATTRIBUTE[:usedcpu]}=0 " \ - "#{POLL_ATTRIBUTE[:nettx]}=0 " \ - "#{POLL_ATTRIBUTE[:netrx]}=0" - - - exe = exec_and_log_ec2(:describe, nil, deploy_id, id) - if exe.code != 0 - send_message(ACTION[:poll], RESULT[:failure], id, exe.stderr) - return - end - - exe.stdout.match(Regexp.new("INSTANCE\\s+#{deploy_id}\\s+(.+)")) - - if !$1 - info << " #{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:deleted]}" - else - monitor_data = $1.split(/\s+/) - - case monitor_data[3] - when "pending" - info << " #{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:active]}" - when "running" - info<<" #{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:active]}"<< - " IP=#{monitor_data[1]}" - when "shutting-down","terminated" - info << " #{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:deleted]}" - end - end - - send_message(ACTION[:poll], RESULT[:success], id, info) - end - -private - - def get_deployment_info(drv_message) - msg = decode(drv_message) - - host = msg.elements["HOST"].text - local_dfile = msg.elements["LOCAL_DEPLOYMENT_FILE"].text - - if !local_dfile - send_message(ACTION[:deploy],RESULT[:failure],id, - "Cannot open deployment file #{local_dfile}") - return - end - - tmp = File.new(local_dfile) - xml = REXML::Document.new tmp - tmp.close() - - ec2 = nil - - all_ec2_elements = xml.root.get_elements("USER_TEMPLATE/EC2") - - # First, let's see if we have an EC2 site that matches - # our desired host name - all_ec2_elements.each { |element| - cloud=element.elements["CLOUD"] - if cloud and cloud.text.upcase == host.upcase - ec2 = element - end - } - - if !ec2 - # If we don't find the EC2 site, and ONE just - # knows about one EC2 site, let's use that - if all_ec2_elements.size == 1 - ec2 = all_ec2_elements[0] - else - send_message(ACTION[:deploy],RESULT[:failure],id, - "Cannot find EC2 element in deployment file "<< - "#{local_dfile} or couldn't find any EC2 site matching "<< - "one of the template.") - return - end - end - - ec2 - end - - # Execute an EC2 command and send the SUCCESS or FAILURE signal - # +drv_message+: String, base64 encoded info sent by ONE - # +ec2_action+: Symbol, one of the keys of the EC2 hash constant (i.e :run) - # +one_action+: String, OpenNebula action - # +id+: String, action id - def ec2_action(drv_message, ec2_action, one_action, id) - msg = decode(drv_message) - - deploy_id = msg.elements["DEPLOY_ID"].text - - exe = exec_and_log_ec2(ec2_action, nil, deploy_id, id) - if exe.code != 0 - send_message(one_action, RESULT[:failure], id, exe.stderr) - else - send_message(one_action, RESULT[:success], id) - end - end - - # Execute an EC2 command and log the message if error - # This function will build the command joining the :cmd value of the EC2 - # hash, the extra_params string and the options built from the :args schema - # of the EC2 hash and the xml - # +action+: Symbol, one of the keys of the EC2 hash constant (i.e :run) - # +xml+: REXML Document, containing EC2 information - # +extra_params+: String, extra information to be added to the command - def exec_and_log_ec2(action, xml, extra_params, id) - cmd = EC2[action][:cmd].clone - cmd << ' ' << extra_params << ' ' if extra_params - - if EC2[action][:args] - cmd << EC2[action][:args].map {|k,v| - str = ec2_value(xml, k, &v[:proc]) - v[:opt] + ' ' + str if str - }.join(' ') - end - - LocalCommand.run(cmd, log_method(id)) - end - - # Returns the value of the xml specified by the name or the default - # one if it does not exist - # +xml+: REXML Document, containing EC2 information - # +name+: String, xpath expression to retrieve the value - # +block+: Block, block to be applied to the value before returning it - def ec2_value(xml, name, &block) - value = value_from_xml(xml, name) || @defaults[name] - if block_given? && value - block.call(value) - else - value - end - end - - def value_from_xml(xml, name) - if xml - element = xml.elements[name] - element.text.strip if element && element.text - end - end -end - -# EC2Driver Main program - -ec2_conf = ARGV.last - -if ec2_conf - ec2_conf = ETC_LOCATION + ec2_conf if ec2_conf[0] != ?/ -end - -ec2_driver = EC2Driver.new(ec2_conf) -ec2_driver.start_driver diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index de58357368..dc73f45f2c 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -416,7 +416,7 @@ class ExecDriver < VirtualMachineDriver { :driver => :vmm, :action => :restore, - :parameters => [:checkpoint_file, :host] + :parameters => [:checkpoint_file, :host, :deploy_id] }, # Execute post-boot networking setup { diff --git a/src/im_mad/ec2/im_ec2rc b/src/vmm_mad/remotes/ec2/attach_disk similarity index 93% rename from src/im_mad/ec2/im_ec2rc rename to src/vmm_mad/remotes/ec2/attach_disk index 90c559ab5d..110243efc2 100644 --- a/src/im_mad/ec2/im_ec2rc +++ b/src/vmm_mad/remotes/ec2/attach_disk @@ -1,3 +1,5 @@ +#!/bin/bash + # -------------------------------------------------------------------------- # # Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # # # @@ -13,3 +15,6 @@ # See the License for the specific language governing permissions and # # limitations under the License. # #--------------------------------------------------------------------------- # + +SCRIPT_NAME=$(basename $0) +echo "Action $SCRIPT_NAME not supported" 1>&2 diff --git a/src/im_mad/ec2/one_im_ec2 b/src/vmm_mad/remotes/ec2/attach_nic similarity index 66% rename from src/im_mad/ec2/one_im_ec2 rename to src/vmm_mad/remotes/ec2/attach_nic index 7f8b1345f9..110243efc2 100755 --- a/src/im_mad/ec2/one_im_ec2 +++ b/src/vmm_mad/remotes/ec2/attach_nic @@ -16,28 +16,5 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -if [ -z "${ONE_LOCATION}" ]; then - EC2RC=/etc/one/im_ec2/im_ec2rc - EC2CONF=/etc/one/im_ec2/im_ec2.conf - MADCOMMON=/usr/lib/one/mads/madcommon.sh - VAR_LOCATION=/var/lib/one -else - EC2RC=$ONE_LOCATION/etc/im_ec2/im_ec2rc - EC2CONF=$ONE_LOCATION/etc/im_ec2/im_ec2.conf - MADCOMMON=$ONE_LOCATION/lib/mads/madcommon.sh - VAR_LOCATION=$ONE_LOCATION/var -fi - -. $MADCOMMON - -# Export the vmm_mad specific rc -export_rc_vars $EC2RC - -# Export max instance type usages -export_rc_vars $EC2CONF - -# Go to var directory ONE_LOCATION/var or /var/lib/one -cd $VAR_LOCATION - -# Execute the actual MAD -execute_mad $* +SCRIPT_NAME=$(basename $0) +echo "Action $SCRIPT_NAME not supported" 1>&2 diff --git a/src/vmm_mad/remotes/ec2/cancel b/src/vmm_mad/remotes/ec2/cancel new file mode 100755 index 0000000000..f8ca7af888 --- /dev/null +++ b/src/vmm_mad/remotes/ec2/cancel @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby + +# -------------------------------------------------------------------------- # +# 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 # +# 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. # +# -------------------------------------------------------------------------- # + +$: << File.dirname(__FILE__) + +require 'ec2_driver' + +deploy_id = ARGV[0] +host = ARGV[1] + +ec2_drv = EC2Driver.new(host) + +ec2_drv.cancel(deploy_id) + diff --git a/src/vmm_mad/remotes/ec2/deploy b/src/vmm_mad/remotes/ec2/deploy new file mode 100755 index 0000000000..1372e04315 --- /dev/null +++ b/src/vmm_mad/remotes/ec2/deploy @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby + +# ---------------------------------------------------------------------------- # +# 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 # +# 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. # +# ---------------------------------------------------------------------------- # + +$: << File.dirname(__FILE__) + +require 'ec2_driver' + +dfile = ARGV[0] +host = ARGV[1] +id = ARGV[2] + +ec2_drv = EC2Driver.new(host) + +text=File.read(dfile) + +puts ec2_drv.deploy(id, host, text) + +exit 0 + diff --git a/src/vmm_mad/ec2/one_vmm_ec2 b/src/vmm_mad/remotes/ec2/detach_disk similarity index 64% rename from src/vmm_mad/ec2/one_vmm_ec2 rename to src/vmm_mad/remotes/ec2/detach_disk index ae1c9896ab..110243efc2 100755 --- a/src/vmm_mad/ec2/one_vmm_ec2 +++ b/src/vmm_mad/remotes/ec2/detach_disk @@ -16,33 +16,5 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -if [ -z "${ONE_LOCATION}" ]; then - DRIVERRC=/etc/one/vmm_ec2/vmm_ec2rc - MADCOMMON=/usr/lib/one/mads/madcommon.sh - VAR_LOCATION=/var/lib/one -else - DRIVERRC=$ONE_LOCATION/etc/vmm_ec2/vmm_ec2rc - MADCOMMON=$ONE_LOCATION/lib/mads/madcommon.sh - VAR_LOCATION=$ONE_LOCATION/var -fi - -. $MADCOMMON - -# Export the vmm_mad specific rc -export_rc_vars $DRIVERRC - -# Go to ONE_LOCATION -cd $VAR_LOCATION - -while getopts u:h:k:c: option $@ -do - case $option in - u) export EC2_URL="$OPTARG";; - h) export EC2_HOME="$OPTARG";; - k) export EC2_PRIVATE_KEY="$OPTARG";; - c) export EC2_CERT="$OPTARG";; - esac -done - -# Execute the actual MAD -execute_mad $* +SCRIPT_NAME=$(basename $0) +echo "Action $SCRIPT_NAME not supported" 1>&2 diff --git a/src/vmm_mad/remotes/ec2/detach_nic b/src/vmm_mad/remotes/ec2/detach_nic new file mode 100755 index 0000000000..110243efc2 --- /dev/null +++ b/src/vmm_mad/remotes/ec2/detach_nic @@ -0,0 +1,20 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +SCRIPT_NAME=$(basename $0) +echo "Action $SCRIPT_NAME not supported" 1>&2 diff --git a/src/vmm_mad/remotes/ec2/ec2_driver.conf b/src/vmm_mad/remotes/ec2/ec2_driver.conf new file mode 100644 index 0000000000..3b11de4df7 --- /dev/null +++ b/src/vmm_mad/remotes/ec2/ec2_driver.conf @@ -0,0 +1,125 @@ +regions: + default: + region_name: us-east-1 + access_key_id: + secret_access_key: + capacity: + m1.small: 5 + m1.large: 0 + m1.xlarge: 0 + us-east-1: + region_name: us-east-1 + access_key_id: + secret_access_key: + capacity: + m1.small: + m1.large: + m1.xlarge: + us-west-2: + region_name: us-west-2 + access_key_id: + secret_access_key: + capacity: + m1.small: + m1.large: + m1.xlarge: + us-west-1: + region_name: us-west-1 + access_key_id: + secret_access_key: + capacity: + m1.small: + m1.large: + m1.xlarge: + eu-west-1: + region_name: eu-west-1 + access_key_id: + secret_access_key: + capacity: + m1.small: + m1.large: + m1.xlarge: + ap-southeast-1: + region_name: ap-southeast-1 + access_key_id: + secret_access_key: + capacity: + m1.small: + m1.large: + m1.xlarge: + ap-southeast-2: + region_name: ap-southeast-2 + access_key_id: + secret_access_key: + capacity: + m1.small: + m1.large: + m1.xlarge: + ap-northeast-1: + region_name: ap-northeast-1 + access_key_id: + secret_access_key: + capacity: + m1.small: + m1.large: + m1.xlarge: + sa-east-1: + region_name: sa-east-1 + access_key_id: + secret_access_key: + capacity: + m1.small: + m1.large: + m1.xlarge: +instance_types: + m1.small: + cpu: 1 + memory: 1.7 + m1.medium: + cpu: 1 + memory: 3.75 + m1.large: + cpu: 2 + memory: 7.5 + m1.xlarge: + cpu: 4 + memory: 15 + m3.xlarge: + cpu: 4 + memory: 15 + m3.2xlarge8: + cpu: 26 + memory: 30 + c1.medium: + cpu: 2 + memory: 1.7 + c1.xlarge: + cpu: 8 + memory: 7 + cc2.8xlarge: + cpu: 32 + memory: 60.5 + m2.xlarge: + cpu: 2 + memory: 17.1 + m2.2xlarge4: + cpu: 13 + memory: 34.2 + m2.4xlarge8: + cpu: 26 + memory: 68.4 + cr1.8xlarge: + cpu: 32 + memory: 244 + hi1.4xlarge: + cpu: 16 + memory: 60.5 + hs1.8xlarge: + cpu: 16 + memory: 117 + t1.micro: + cpu: 1 + memory: 0.615 + cg1.4xlarge: + cpu: 16 + memory: 22.5 diff --git a/src/vmm_mad/ec2/vmm_ec2.conf b/src/vmm_mad/remotes/ec2/ec2_driver.default similarity index 87% rename from src/vmm_mad/ec2/vmm_ec2.conf rename to src/vmm_mad/remotes/ec2/ec2_driver.default index e80cd87b98..95673cffbe 100644 --- a/src/vmm_mad/ec2/vmm_ec2.conf +++ b/src/vmm_mad/remotes/ec2/ec2_driver.default @@ -1,4 +1,3 @@ - -