diff options
author | Claudiu Belu <cbelu@cloudbasesolutions.com> | 2015-10-13 18:03:41 +0300 |
---|---|---|
committer | Claudiu Belu <cbelu@cloudbasesolutions.com> | 2016-05-18 10:34:11 +0000 |
commit | f3ad794bf75ac4b4251bcbbcbdb5ec7791fbea2e (patch) | |
tree | 587597ed09f5ea18d05c3b355706f4fc7ca0e393 /nova/virt/hyperv/vmops.py | |
parent | 5c2f95ac539a514bbaed58fbd76ade9b6e761c6d (diff) | |
download | nova-f3ad794bf75ac4b4251bcbbcbdb5ec7791fbea2e.tar.gz |
Hyper-V: Fixes disk overhead claim issue
For each started VM, Hyper-V creates a VM memory file on the local
disk. The size of the file is the same as the size of the VM's
memory amount.
Implements the mentioned method in HyperVDriver.
Change-Id: Id40219dae96c0f7e60a86c0ed76fa08cea608aec
Closes-Bug: #1505681
Diffstat (limited to 'nova/virt/hyperv/vmops.py')
-rw-r--r-- | nova/virt/hyperv/vmops.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nova/virt/hyperv/vmops.py b/nova/virt/hyperv/vmops.py index 49f39b1723..4187a0a4fc 100644 --- a/nova/virt/hyperv/vmops.py +++ b/nova/virt/hyperv/vmops.py @@ -131,6 +131,14 @@ class VMOps(object): def list_instances(self): return self._vmutils.list_instances() + def estimate_instance_overhead(self, instance_info): + # NOTE(claudiub): When an instance starts, Hyper-V creates a VM memory + # file on the local disk. The file size is the same as the VM's amount + # of memory. Since disk_gb must be an integer, and memory is MB, round + # up from X512 MB. + return {'memory_mb': 0, + 'disk_gb': (instance_info['memory_mb'] + 512) // units.Ki} + def get_info(self, instance): """Get information about the VM.""" LOG.debug("get_info called for instance", instance=instance) |