12 Commits

Author SHA1 Message Date
Radoslav Gerganov
02192f7c30 Add function for getting recommended datastore
Add utility function which returns the most recommended datastore from a
datastore cluster where a VM can be cloned to.

Change-Id: Ic532bb9c52270ba34f70d2b7977de49f8753d1d1
2018-07-17 11:30:19 +03:00
Radoslav Gerganov
c6456c6407 Add traversal spec for datastoreFolder
StoragePods (a.k.a datastore clusters) are located under
Datacenter.datastoreFolder, so we need a new traversal spec in order to
retrieve them.

Change-Id: I899f8f6ef05a94d21d13a55ca0a0f8fbd042a448
2018-06-19 10:13:57 +03:00
wangqi
95ca244690 fix a typo:s/extention/extension
Change-Id: I2b720a942484d7c1ce67fc7c25c6bd5c00ea6099
2018-04-24 03:58:18 +00:00
Vipin Balachandran
ad8274cb8f Use request_handler() for ExtensionManager APIs
Modifying find_extension() and register_extension() in vim_util
to use request_handler() in service module. Currently these
methods call vSphere APIs directly and hence suds web faults
are not translated.

Change-Id: Ic0ef099a3c94962bb6895473dcdf69e66112e482
Closes-bug: 1703478
2017-07-10 17:32:04 -07:00
Zhongcheng Lao
37f72b0db6 Make sure host in maintenance mode excluded from image upload
Currently when selecting host for image upload, hosts in maintenance
mode will also be included.

This commit adds a check for available hosts to make sure these
hosts excluded from the list.

Change-Id: I46e4a879245e4f9258178738da9920b34b65a187
2017-05-24 04:21:46 -07:00
loooosy
89b4a8a1b9 Remove log translations
Log messages are no longer being translated. This removes all use of the
_LE, _LI, and _LW translation markers to simplify logging and to avoid
confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: Ib7bb69eac558fa157331f9cf0fb452e6053714a7
2017-03-24 07:24:50 +00:00
Radoslav Gerganov
6a63362919 Add operation ID for remote calls
The operation ID is a random string which can be added in the SOAP
headers of the remote request. vCenter and ESX will append this opID to
every log message associated with the remote request. This allows
administrators to correlate log messages for particular operation across
different systems (OpenStack -> vCenter -> ESX).

There is also addition keyword argument 'skip_op_id' which allows
callers to disable logging the opID if set to True.

Example for correlating logs for CreateVM_Task on devstack, vCenter and
ESX: http://paste.openstack.org/show/592614/

Change-Id: I75cb71c7c58b4ee9cd36fc977eb2a18a911f161f
2016-12-20 17:46:49 +02:00
Javeme
b370ee5894 isoformat instead of deprecated timeutils.strtime
use isoformat() instead of deprecated oslo.timeutils.strtime()

ref:
https://github.com/openstack/oslo.utils/blob/master/oslo_utils/timeutils.py#L81

Change-Id: I3f0c7fe421add6880c2a000e2b052f0aeda1c4dc
2015-12-17 16:58:24 +08:00
Cedric Brandily
a5c6ed65d2 Define WithRetrieval context
WithRetrieval[1] is a context that handles and hides object retrieval
and retrieval cancel (when needed):

 with WithRetrieval(vim, retrieve_result) as objects:
   for obj in objects:
     do_something_including_breaking_for_loop(obj)

instead of:

 while retrieve_result:
   for obj in retrieve_result.objects:
      do_something_including_breaking_while_loop(obj)
   retrieve_result = continue_retrieval(vim, retrieve_result)
 if retrieve_result:
   cancel_retrieval(vim, retrieve_result)

[1] oslo_vmware.vim_util

Closes-Bug: #1284658
Change-Id: If29d45a25a81340e138eb9068a551fc1b172cf87
2015-09-29 11:38:24 +02:00
Davanum Srinivas
5de2c31e9d Switch to non-namespaced module imports
Looks like we missed a few

Change-Id: I803c09170c9dbc9439d71259f6b632c4cbb6037f
2015-03-12 11:38:50 -04:00
Sabari Kumar Murugesan
a95c0ae05f Add get_datastore_by_ref method to oslo.vmware
Two methods are added as part of this patch:-

1. get_datastore_by_ref - returns a Datastore object given a
datastore reference.

2. get_object_properties_dict - a vim utility method to retrieve
properties of an object as a dictionary.

Currently, Glance needs these methods to find datastore
objects from datastore references.

Change-Id: I516536ea4098357540531105b4f97e6668fb3f08
2015-02-26 12:18:58 -08:00
Doug Hellmann
48771e6bfd Move files out of the namespace package
Move the public API out of oslo.vmware to oslo_vmware. Retain the ability
to import from the old namespace package for backwards compatibility
for this release cycle.

bp/drop-namespace-packages

Change-Id: I11cf038c3832a7357ed53363d8ccf143daddd2a2
2015-01-12 13:22:13 -05:00