The cinder.volume.drivers.vmware.vmdk Module

Driver for virtual machines running on VMware supported datastores.

class VMwareEsxVmdkDriver(*args, **kwargs)

Bases: cinder.volume.driver.VolumeDriver

Manage volumes on VMware ESX server.

VERSION = '1.0'
check_for_setup_error()
copy_image_to_volume(context, volume, image_service, image_id)

Creates volume from image.

Creates a backing for the volume under the ESX/VC server and copies the VMDK flat file from the glance image content. The method supports only image with VMDK disk format.

Parameters:
  • context – context
  • volume – Volume object
  • image_service – Glance image service
  • image_id – Glance image id
copy_volume_to_image(context, volume, image_service, image_meta)

Creates glance image from volume.

Upload of only available volume is supported. Steps followed are:

  1. Get the name of the vmdk file which the volume points to right now. Can be a chain of snapshots, so we need to know the last in the chain.
  2. Call CopyVirtualDisk which coalesces the disk chain to form a single vmdk, rather a .vmdk metadata file and a -flat.vmdk disk data file.
  3. Now upload the -flat.vmdk file to the image store.
  4. Delete the coalesced .vmdk and -flat.vmdk created.
create_cloned_volume(volume, src_vref)

Creates volume clone.

Parameters:
  • volume – New Volume object
  • src_vref – Volume object that must be cloned
create_export(context, volume)
create_snapshot(snapshot)

Creates a snapshot.

Parameters:snapshot – Snapshot object
create_volume(volume)

Creates a volume.

We do not create any backing. We do it only for the first time it is being attached to a virtual machine.

Parameters:volume – Volume object
create_volume_from_snapshot(volume, snapshot)

Creates a volume from a snapshot.

Parameters:
  • volume – Volume object
  • snapshot – Snapshot object
delete_snapshot(snapshot)

Delete snapshot.

Parameters:snapshot – Snapshot object
delete_volume(volume)

Deletes volume backing.

Parameters:volume – Volume object
do_setup(context)

Perform validations and establish connection to server.

Parameters:context – Context information
ensure_export(context, volume)
get_volume_stats(refresh=False)

Obtain status of the volume service.

Parameters:refresh – Whether to get refreshed information
initialize_connection(volume, connector)

Allow connection to connector and return connection info.

The implementation returns the following information: {‘driver_volume_type’: ‘vmdk’

‘data’: {‘volume’: $VOLUME_MOREF_VALUE
‘volume_id’: $VOLUME_ID

}

}

Parameters:
  • volume – Volume object
  • connector – Connector information
Returns:

Return connection information

remove_export(context, volume)
session
terminate_connection(volume, connector, force=False, **kwargs)
volumeops
class VMwareVcVmdkDriver(*args, **kwargs)

Bases: cinder.volume.drivers.vmware.vmdk.VMwareEsxVmdkDriver

Manage volumes on VMware VC server.

create_cloned_volume(volume, src_vref)

Creates volume clone.

Parameters:
  • volume – New Volume object
  • src_vref – Source Volume object
create_volume_from_snapshot(volume, snapshot)

Creates a volume from a snapshot.

Parameters:
  • volume – New Volume object
  • snapshot – Reference to snapshot entity

Previous topic

The cinder.volume.drivers.vmware.vim_util Module

Next topic

The cinder.volume.drivers.vmware.vmware_images Module

This Page