Fix overflow problem when connecting to multiple PowerVC hypervisors

The value of the property 'free_disk_gb' in the hypervisor info is
invalid in the Powervc. And the PowerVC will set it as a big value.
It will lead the overflow of the database.

Change-Id: I0eae9f393cd1c191230c71687450318539d58e02
Closes-Bug: 1370895
This commit is contained in:
jizilian@cn.ibm.com 2014-10-09 02:51:46 -04:00 committed by jizilian
parent 29047a3d2e
commit e165253c6f
1 changed files with 3 additions and 1 deletions

View File

@ -1310,6 +1310,8 @@ class PowerVCDriver(driver.ComputeDriver):
vcpus = int(float(info["vcpus"]) - float(info["proc_units_reserved"]))
memory_mb = int(info["memory_mb"]) - int(info["memory_mb_reserved"])
# The value of the property 'free_disk_gb' is invalid,
# set is as '21474835'
data = {'vcpus': vcpus,
'vcpus_used': info["vcpus_used"],
@ -1317,7 +1319,7 @@ class PowerVCDriver(driver.ComputeDriver):
'host_memory_free': info["free_ram_mb"],
'disk_total': local_gb,
'disk_used': info["local_gb_used"],
'disk_available': info["free_disk_gb"],
'disk_available': 21474835,
'disk_available_least': info["disk_available_least"],
'hypervisor_hostname': info["hypervisor_hostname"],
'hypervisor_type': info["hypervisor_type"],