'Get the virtual device corresponding to disk.'

def _get_disk_device(self, backing):

    hardware_devices = self._session.invoke_api(vim_util, 'get_object_property', self._session.vim, backing, 'config.hardware.device')
    if (hardware_devices.__class__.__name__ == 'ArrayOfVirtualDevice'):
        hardware_devices = hardware_devices.VirtualDevice
    for device in hardware_devices:
        if (device.__class__.__name__ == 'VirtualDisk'):
            return device
    LOG.error('Virtual    disk    device    of    backing:    %s    not    found.', backing)
    raise vmdk_exceptions.VirtualDiskNotFoundException()
