Revision 30b12688 lib/hypervisor/hv_base.py
b/lib/hypervisor/hv_base.py | ||
---|---|---|
381 | 381 |
""" |
382 | 382 |
raise NotImplementedError |
383 | 383 |
|
384 |
def _InstanceStartupMemory(self, instance, hvparams=None):
|
|
384 |
def _InstanceStartupMemory(self, instance): |
|
385 | 385 |
"""Get the correct startup memory for an instance |
386 | 386 |
|
387 | 387 |
This function calculates how much memory an instance should be started |
... | ... | |
394 | 394 |
@return: memory the instance should be started with |
395 | 395 |
|
396 | 396 |
""" |
397 |
free_memory = self.GetNodeInfo(hvparams=hvparams)["memory_free"] |
|
397 |
free_memory = self.GetNodeInfo(hvparams=instance.hvparams)["memory_free"]
|
|
398 | 398 |
max_start_mem = min(instance.beparams[constants.BE_MAXMEM], free_memory) |
399 | 399 |
start_mem = max(instance.beparams[constants.BE_MINMEM], max_start_mem) |
400 | 400 |
return start_mem |
Also available in: Unified diff