Merge "update vm_workload_consolidation strategy"

This commit is contained in:
Zuul
2019-08-12 02:10:16 +00:00
committed by Gerrit Code Review
4 changed files with 10 additions and 9 deletions

View File

@@ -318,7 +318,8 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy):
:param node: node object
:return: dict(cpu(cores), ram(MB), disk(B))
"""
return dict(cpu=node.vcpus, ram=node.memory, disk=node.disk)
return dict(cpu=node.vcpu_capacity, ram=node.memory_mb_capacity,
disk=node.disk_gb_capacity)
def get_relative_node_utilization(self, node):
"""Return relative node utilization.

View File

@@ -1,8 +1,8 @@
<ModelRoot>
<ComputeNode hostname="hostname_0" uuid="Node_0" id="0" state="up" status="enabled" vcpus="40" disk="250" disk_capacity="250" memory="64">
<ComputeNode hostname="hostname_0" uuid="Node_0" id="0" state="up" status="enabled" vcpus="40" vcpu_reserved="0" vcpu_ratio="1" disk="250" disk_gb_reserved="0" disk_ratio="1" disk_capacity="250" memory="64" memory_mb_reserved="0" memory_ratio="1">
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_0" vcpus="10" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
</ComputeNode>
<ComputeNode hostname="hostname_1" uuid="Node_1" id="1" state="up" status="enabled" vcpus="40" disk="250" disk_capacity="250" memory="64">
<ComputeNode hostname="hostname_1" uuid="Node_1" id="1" state="up" status="enabled" vcpus="40" vcpu_reserved="0" vcpu_ratio="1" disk="250" disk_gb_reserved="0" disk_ratio="1" disk_capacity="250" memory="64" memory_mb_reserved="0" memory_ratio="1">
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_1" vcpus="10" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
</ComputeNode>
</ModelRoot>

View File

@@ -1,5 +1,5 @@
<ModelRoot>
<ComputeNode hostname="hostname_0" uuid="Node_0" id="0" state="up" status="enabled" vcpus="16" disk="250" disk_capacity="250" memory="64">
<ComputeNode hostname="hostname_0" uuid="Node_0" id="0" state="up" status="enabled" vcpus="16" vcpu_reserved="0" vcpu_ratio="1" disk="250" disk_gb_reserved="0" disk_ratio="1" disk_capacity="250" memory="64" memory_mb_reserved="0" memory_ratio="1">
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_0" vcpus="10" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_1" vcpus="10" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_2" vcpus="10" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
@@ -7,7 +7,7 @@
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_4" vcpus="10" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_5" vcpus="10" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
</ComputeNode>
<ComputeNode hostname="hostname_1" uuid="Node_1" id="1" state="up" status="enabled" vcpus="16" disk="250" disk_capacity="250" memory="64"/>
<ComputeNode hostname="hostname_2" uuid="Node_2" id="2" state="up" status="enabled" vcpus="16" disk="250" disk_capacity="250" memory="64"/>
<ComputeNode hostname="hostname_3" uuid="Node_3" id="3" state="up" status="enabled" vcpus="16" disk="250" disk_capacity="250" memory="64"/>
<ComputeNode hostname="hostname_1" uuid="Node_1" id="1" state="up" status="enabled" vcpus="16" vcpu_reserved="0" vcpu_ratio="1" disk="250" disk_gb_reserved="0" disk_ratio="1" disk_capacity="250" memory="64" memory_mb_reserved="0" memory_ratio="1"/>
<ComputeNode hostname="hostname_2" uuid="Node_2" id="2" state="up" status="enabled" vcpus="16" vcpu_reserved="0" vcpu_ratio="1" disk="250" disk_gb_reserved="0" disk_ratio="1" disk_capacity="250" memory="64" memory_mb_reserved="0" memory_ratio="1"/>
<ComputeNode hostname="hostname_3" uuid="Node_3" id="3" state="up" status="enabled" vcpus="16" vcpu_reserved="0" vcpu_ratio="1" disk="250" disk_gb_reserved="0" disk_ratio="1" disk_capacity="250" memory="64" memory_mb_reserved="0" memory_ratio="1"/>
</ModelRoot>

View File

@@ -1,9 +1,9 @@
<ModelRoot>
<ComputeNode hostname="hostname_0" uuid="Node_0" id="0" state="up" status="enabled" vcpus="10" disk="250" disk_capacity="250" memory="64">
<ComputeNode hostname="hostname_0" uuid="Node_0" id="0" state="up" status="enabled" vcpus="10" vcpu_reserved="0" vcpu_ratio="1" disk="250" disk_gb_reserved="0" disk_ratio="1" disk_capacity="250" memory="64" memory_mb_reserved="0" memory_ratio="1">
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_6" vcpus="1" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_7" vcpus="2" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_8" vcpus="4" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
<Instance watcher_exclude="False" name="" state="active" uuid="INSTANCE_9" vcpus="8" disk="20" disk_capacity="20" memory="2" metadata='{"optimize": true,"top": "floor", "nested": {"x": "y"}}' project_id="91FFFE30-78A0-4152-ACD2-8310FF274DC9"/>
</ComputeNode>
<ComputeNode hostname="hostname_1" uuid="Node_1" id="1" state="up" status="enabled" vcpus="10" disk="250" disk_capacity="250" memory="64"/>
<ComputeNode hostname="hostname_1" uuid="Node_1" id="1" state="up" status="enabled" vcpus="10" vcpu_reserved="0" vcpu_ratio="1" disk="250" disk_gb_reserved="0" disk_ratio="1" disk_capacity="250" memory="64" memory_mb_reserved="0" memory_ratio="1"/>
</ModelRoot>