Remove unused disk_capacity field

The fields disk and disk_capacity have the same value,
we just need one, so remove disk_capacity field.
Partially Implements: blueprint improve-compute-data-model

Change-Id: If3d385c5e61713bbdc85e22f10cd75e161ff79f0
This commit is contained in:
licanwei
2019-08-12 15:02:43 +08:00
parent d55bb1fa95
commit 99cd009805
7 changed files with 5 additions and 27 deletions

View File

@@ -349,13 +349,7 @@ class NovaModelBuilder(base.BaseModelBuilder):
"memory": memory_mb,
"memory_ratio": memory_ratio,
"memory_mb_reserved": memory_mb_reserved,
# The node.free_disk_gb does not take allocation ratios used
# for overcommit into account so this value may be negative.
# We do not need this field and plan to set disk to total disk
# capacity and then remove disk_capacity.
"disk": disk_capacity,
# TODO(licanwei): remove and replace by disk field
"disk_capacity": disk_capacity,
"disk_gb_reserved": disk_gb_reserved,
"disk_ratio": disk_ratio,
"vcpus": vcpus,
@@ -408,7 +402,6 @@ class NovaModelBuilder(base.BaseModelBuilder):
"name": instance.name,
"memory": flavor["ram"],
"disk": flavor["disk"],
"disk_capacity": flavor["disk"],
"vcpus": flavor["vcpus"],
"state": getattr(instance, "OS-EXT-STS:vm_state"),
"metadata": instance.metadata,

View File

@@ -49,8 +49,7 @@ class Instance(compute_resource.ComputeResource):
"name": wfields.StringField(),
"state": wfields.StringField(default=InstanceState.ACTIVE.value),
"memory": wfields.NonNegativeIntegerField(),
"disk": wfields.IntegerField(),
"disk_capacity": wfields.NonNegativeIntegerField(),
"disk": wfields.NonNegativeIntegerField(),
"vcpus": wfields.NonNegativeIntegerField(),
"metadata": wfields.JsonField(),
"project_id": wfields.UUIDField(),

View File

@@ -40,8 +40,7 @@ class ComputeNode(compute_resource.ComputeResource):
"state": wfields.StringField(default=ServiceState.ONLINE.value),
"memory": wfields.NonNegativeIntegerField(),
"memory_mb_reserved": wfields.NonNegativeIntegerField(),
"disk": wfields.IntegerField(),
"disk_capacity": wfields.NonNegativeIntegerField(),
"disk": wfields.NonNegativeIntegerField(),
"disk_gb_reserved": wfields.NonNegativeIntegerField(),
"vcpus": wfields.NonNegativeIntegerField(),
"vcpu_reserved": wfields.NonNegativeIntegerField(),

View File

@@ -90,7 +90,6 @@ class NovaNotification(base.NotificationEndpoint):
'memory': memory_mb,
'vcpus': num_cores,
'disk': disk_gb,
'disk_capacity': disk_gb,
'metadata': instance_metadata,
'project_id': instance_data['tenant_id']
})
@@ -173,13 +172,7 @@ class NovaNotification(base.NotificationEndpoint):
"memory": memory_mb,
"memory_ratio": memory_ratio,
"memory_mb_reserved": memory_mb_reserved,
# The node.free_disk_gb does not take allocation ratios used
# for overcommit into account so this value may be negative.
# We do not need this field and plan to set disk to total disk
# capacity and then remove disk_capacity.
"disk": disk_capacity,
# TODO(licanwei): remove and replace by disk field
"disk_capacity": disk_capacity,
"disk_gb_reserved": disk_gb_reserved,
"disk_ratio": disk_ratio,
"vcpus": vcpus,