The cinder.volume.drivers.vmware.api Module

Session and API call management for VMware ESX/VC server. Provides abstraction over cinder.volume.drivers.vmware.vim.Vim SOAP calls.

class Retry(max_retry_count=-1, inc_sleep_time=10, max_sleep_time=60, exceptions=())

Bases: object

Decorator for retrying a function upon suggested exceptions.

The method retries for given number of times and the sleep time increments till the max sleep time is reached. If max retries is set to -1, then the decorated function is invoked indefinitely till no exception is thrown or if the caught exception is not in the list of suggested exceptions.

class VMwareAPISession(*args, **kwargs)

Bases: object

Sets up a session with the server and handles all calls made to it.

create_session()

Establish session with the server.

invoke_api(module, method, *args, **kwargs)

Wrapper method for invoking APIs.

Here we retry the API calls for exceptions which may come because of session overload.

Make sure if a Vim instance is being passed here, this session’s Vim (self.vim) instance is used, as we retry establishing session in case of session timedout.

Parameters:
  • module – Module invoking the VI SDK calls
  • method – Method in the module that invokes the VI SDK call
  • args – Arguments to the method
  • kwargs – Keyword arguments to the method
Returns:

Response of the API call

vim
wait_for_task(task)

Return a deferred that will give the result of the given task.

The task is polled until it completes. The method returns the task information upon successful completion.

Parameters:task – Managed object reference of the task
Returns:Task info upon successful completion of the task

Previous topic

The cinder.volume.drivers.storwize_svc Module

Next topic

The cinder.volume.drivers.vmware.error_util Module

This Page