diff --git a/include/RankScheduler.h b/include/RankScheduler.h
new file mode 100644
index 0000000000..9bc864720f
--- /dev/null
+++ b/include/RankScheduler.h
@@ -0,0 +1,72 @@
+/* -------------------------------------------------------------------------- */
+/* Copyright 2002-2018, OpenNebula Project, OpenNebula Systems                */
+/*                                                                            */
+/* Licensed 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 "Scheduler.h"
+#include "SchedulerTemplate.h"
+#include "RankPolicy.h"
+#include "UserPriorityPolicy.h"
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <iostream>
+#include <sstream>
+
+
+using namespace std;
+
+class RankScheduler : public Scheduler
+{
+public:
+
+    RankScheduler():Scheduler(),rp_host(0),rp_ds(0),rp_vm(0){};
+
+    ~RankScheduler()
+    {
+        delete rp_host;
+        delete rp_ds;
+
+        delete rp_vm;
+    };
+
+    static RankScheduler& getInstance()
+    {
+        static RankScheduler r_sched;
+        return r_sched;
+    }
+
+    void register_policies(const SchedulerTemplate& conf)
+    {
+        rp_host = new RankHostPolicy(hpool, conf.get_policy(), 1.0);
+
+        add_host_policy(rp_host);
+
+        rp_ds = new RankDatastorePolicy(dspool, conf.get_ds_policy(), 1.0);
+
+        add_ds_policy(rp_ds);
+
+        rp_vm = new UserPriorityPolicy(vmpool, 1.0);
+
+        add_vm_policy(rp_vm);
+    };
+
+private:
+    RankPolicy * rp_host;
+    RankPolicy * rp_ds;
+
+    UserPriorityPolicy * rp_vm;
+};
\ No newline at end of file
diff --git a/src/scheduler/include/Scheduler.h b/src/scheduler/include/Scheduler.h
index ff1eea4452..49ac62863f 100644
--- a/src/scheduler/include/Scheduler.h
+++ b/src/scheduler/include/Scheduler.h
@@ -47,6 +47,17 @@ public:
 
     virtual void register_policies(const SchedulerTemplate& conf) = 0;
 
+    template <class T>
+    static T& getInstance(){
+        static T obj;
+        return obj;
+    };
+
+    float get_mem_factor()
+    {
+        return factor;
+    };
+
 protected:
 
     Scheduler():
@@ -64,7 +75,8 @@ protected:
         one_xmlrpc(""),
         machines_limit(0),
         dispatch_limit(0),
-        host_dispatch_limit(0)
+        host_dispatch_limit(0),
+        factor(0)
     {
         am.addListener(this);
     };
@@ -194,6 +206,11 @@ private:
      */
     int zone_id;
 
+    /**
+     *  multiplication factor to calculate datastore usage. memory * factor
+     */
+    float factor;
+
     /**
      * oned runtime configuration values
      */
diff --git a/src/scheduler/src/sched/mm_sched.cc b/src/scheduler/src/sched/mm_sched.cc
index 65288bff8d..ca3322c560 100644
--- a/src/scheduler/src/sched/mm_sched.cc
+++ b/src/scheduler/src/sched/mm_sched.cc
@@ -14,10 +14,7 @@
 /* limitations under the License.                                             */
 /* -------------------------------------------------------------------------- */
 
-#include "Scheduler.h"
-#include "SchedulerTemplate.h"
-#include "RankPolicy.h"
-#include "UserPriorityPolicy.h"
+#include "RankScheduler.h"
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -26,52 +23,13 @@
 #include <iostream>
 #include <sstream>
 
-
-using namespace std;
-
-class RankScheduler : public Scheduler
-{
-public:
-
-    RankScheduler():Scheduler(),rp_host(0),rp_ds(0),rp_vm(0){};
-
-    ~RankScheduler()
-    {
-        delete rp_host;
-        delete rp_ds;
-
-        delete rp_vm;
-    };
-
-    void register_policies(const SchedulerTemplate& conf)
-    {
-        rp_host = new RankHostPolicy(hpool, conf.get_policy(), 1.0);
-
-        add_host_policy(rp_host);
-
-        rp_ds = new RankDatastorePolicy(dspool, conf.get_ds_policy(), 1.0);
-
-        add_ds_policy(rp_ds);
-
-        rp_vm = new UserPriorityPolicy(vmpool, 1.0);
-
-        add_vm_policy(rp_vm);
-    };
-
-private:
-    RankPolicy * rp_host;
-    RankPolicy * rp_ds;
-
-    UserPriorityPolicy * rp_vm;
-};
-
 int main(int argc, char **argv)
 {
-    RankScheduler ss;
+    Scheduler& sched = Scheduler::getInstance<RankScheduler>();
 
     try
     {
-        ss.start();
+        sched.start();
     }
     catch (exception &e)
     {