Revision 30b12688
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 |
b/lib/hypervisor/hv_xen.py | ||
---|---|---|
585 | 585 |
"""Start an instance. |
586 | 586 |
|
587 | 587 |
""" |
588 |
startup_memory = self._InstanceStartupMemory(instance, |
|
589 |
hvparams=instance.hvparams) |
|
588 |
startup_memory = self._InstanceStartupMemory(instance) |
|
590 | 589 |
|
591 | 590 |
self._MakeConfigFile(instance, startup_memory, block_devices) |
592 | 591 |
|
Also available in: Unified diff