diff options
author | Gary Kotton <gkotton@vmware.com> | 2014-09-14 07:43:04 -0700 |
---|---|---|
committer | Gary Kotton <gkotton@vmware.com> | 2015-02-14 09:46:40 -0800 |
commit | cb0f64af75f818a9453250a4b84c6152d1a76ec5 (patch) | |
tree | 140d681b8800cd15d8b73b5004cc83254a8dcadd /nova/virt/vmwareapi/ds_util.py | |
parent | 36a133e11852a52fecd9a12255ca4b4f46a989d8 (diff) | |
download | nova-cb0f64af75f818a9453250a4b84c6152d1a76ec5.tar.gz |
VMware: fix resize of ephemeral disks
Ensure that a resize operation will work on ephemeral disks. If the
flavor or block device mapping require ephemerals then these will be
updated or created. The user is able to go from a flavor with or without
ephemerals to a flavor with or without ephemerals.
The resize will honor the configuration.
DocImpact - Resize of ephemeral disks no works for VMware driver.
Change-Id: I4b45299fdce59f4c52458d7515d0092b9f3b8db5
Diffstat (limited to 'nova/virt/vmwareapi/ds_util.py')
-rw-r--r-- | nova/virt/vmwareapi/ds_util.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/virt/vmwareapi/ds_util.py b/nova/virt/vmwareapi/ds_util.py index 10af368a36..c0ff57670c 100644 --- a/nova/virt/vmwareapi/ds_util.py +++ b/nova/virt/vmwareapi/ds_util.py @@ -310,6 +310,17 @@ def get_datastore(session, cluster, datastore_regex=None, raise exception.DatastoreNotFound() +def get_datastore_by_ref(session, ds_ref): + lst_properties = ["summary.type", "summary.name", + "summary.capacity", "summary.freeSpace"] + props = session._call_method(vim_util, "get_object_properties", + None, ds_ref, "Datastore", lst_properties) + query = vm_util.get_values_from_object_properties(session, props) + return Datastore(ds_ref, query["summary.name"], + capacity=query["summary.capacity"], + freespace=query["summary.freeSpace"]) + + def _get_allowed_datastores(data_stores, datastore_regex): allowed = [] for obj_content in data_stores.objects: |