From 5f41e9c764d2d064590e61018e655b9da8b17e9c Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Thu, 5 Aug 2010 12:52:55 -0500 Subject: compute nodes should store total memory and disk space available for VMs --- nova/compute/model.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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() } -- cgit