'Attach vmdk volume storage to VM instance.'

def _attach_volume_vmdk(self, connection_info, instance, adapter_type=None):

    vm_ref = vm_util.get_vm_ref(self._session, instance)
    LOG.debug('_attach_volume_vmdk:    %s', connection_info, instance=instance)
    data = connection_info['data']
    volume_ref = self._get_volume_ref(data['volume'])
    vmdk = vm_util.get_vmdk_info(self._session, volume_ref)
    adapter_type = (adapter_type or vmdk.adapter_type)
    if (adapter_type == constants.ADAPTER_TYPE_IDE):
        state = vm_util.get_vm_state(self._session, instance)
        if (state.lower() != 'poweredoff'):
            raise exception.Invalid((_('%s    does    not    support    disk    hotplug.') % adapter_type))
    self.attach_disk_to_vm(vm_ref, instance, adapter_type, vmdk.disk_type, vmdk_path=vmdk.path)
    self._update_volume_details(vm_ref, data['volume_id'], vmdk.device.backing.uuid)
    LOG.debug('Attached    VMDK:    %s', connection_info, instance=instance)
