KVM and XEN Disk Management Parity

Implements blueprint disk-configuration-parity

This change splits local_gb into root_gb and ephemeral_gb. libvirt
interpreted local_gb as what ephemeral_gb is now, whereas XenAPI
interpreted local_gb as what root_gb is now.

Change-Id: I496600991bac1e990326d4ded1607fee08209d68
This commit is contained in:
Johannes Erdfelt 2012-01-06 12:57:37 -08:00
parent bc8d005609
commit dd65c7d7b8
2 changed files with 3 additions and 3 deletions
nova
db/sqlalchemy
utils.py

@ -3380,9 +3380,9 @@ def instance_type_get_all(context, inactive=False, filters=None):
if 'min_memory_mb' in filters:
query = query.filter(
models.InstanceTypes.memory_mb >= filters['min_memory_mb'])
if 'min_local_gb' in filters:
if 'min_root_gb' in filters:
query = query.filter(
models.InstanceTypes.local_gb >= filters['min_local_gb'])
models.InstanceTypes.root_gb >= filters['min_root_gb'])
inst_types = query.order_by("name").all()

@ -409,7 +409,7 @@ def usage_from_instance(instance_ref, network_info=None, **kw):
instance_type=instance_ref['instance_type']['name'],
instance_type_id=instance_ref['instance_type_id'],
memory_mb=instance_ref['memory_mb'],
disk_gb=instance_ref['local_gb'],
disk_gb=instance_ref['root_gb'] + instance_ref['ephemeral_gb'],
display_name=instance_ref['display_name'],
created_at=str(instance_ref['created_at']),
launched_at=str(instance_ref['launched_at']) \