summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2010-08-05 12:52:55 -0500
committerChris Behrens <cbehrens@codestud.com>2010-08-05 12:52:55 -0500
commit5f41e9c764d2d064590e61018e655b9da8b17e9c (patch)
tree4f7c1a0863ee29337ca7a67fd6632c5afaac4ded
parentc373066601a746d91de989ca4de775db9542012e (diff)
compute nodes should store total memory and disk space available for VMs
-rw-r--r--nova/compute/model.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/nova/compute/model.py b/nova/compute/model.py
index 212830d3c..3913d8738 100644
--- a/nova/compute/model.py
+++ b/nova/compute/model.py
@@ -53,10 +53,14 @@ from nova import utils
FLAGS = flags.FLAGS
-
+flags.DEFINE_integer('total_memory_mb', 1000,
+ 'amount of memory a node has for VMs in MB')
+flags.DEFINE_integer('total_disk_gb', 1000,
+ 'amount of disk space a node has for VMs in GB')
# TODO(todd): Implement this at the class level for Instance
class InstanceDirectory(object):
+
"""an api for interacting with the global state of instances"""
def get(self, instance_id):
@@ -200,6 +204,8 @@ class Daemon(datastore.BasicModel):
def default_state(self):
return {"hostname": self.hostname,
"binary": self.binary,
+ "total_memory_mb": FLAGS.total_memory_mb,
+ "total_disk_gb": FLAGS.total_disk_gb,
"updated_at": utils.isotime()
}