docstr: This function is used to deploy vm from OVF
docstr_tok: ["This","function","is","used","to","deploy","vm","from","OVF"]
code: def deploy_ovf(
      self,
      lib_item,
      vm_name_target,
      resource_pool_id,
      host_id,
      datastore_id,
  ):
      """
      This function is used to deploy vm from OVF
      """
      find_spec = Item.FindSpec(name=lib_item)
      item_ids = self.vsphere_sdk_client.content.library.Item.find(
          find_spec
      )
  
      if len(item_ids) < 1:
          raise ValueError(
              "Content library items with name '{}' not found".format(
                  lib_item
              ),
          )
      if len(item_ids) > 1:
          logger.warning(
              "Unexpected: found multiple content library items with name \
                  '{}'".format(
                  lib_item
              )
          )
  
      lib_item_id = item_ids[0]
      deployment_target = LibraryItem.DeploymentTarget(
          resource_pool_id=resource_pool_id,
          host_id=host_id,
      )
      ovf_summary = (
          self.vsphere_sdk_client.vcenter.ovf.LibraryItem.filter(
              ovf_library_item_id=lib_item_id, target=deployment_target
          )
      )
      logger.info(
          "Found an OVF template: {} to deploy.".format(
              ovf_summary.name
          )
      )
  
      # Build the deployment spec
      deployment_spec = LibraryItem.ResourcePoolDeploymentSpec(
          name=vm_name_target,
          annotation=ovf_summary.annotation,
          accept_all_eula=True,
          network_mappings=None,
          storage_mappings=None,
          storage_provisioning=DiskProvisioningType.thin,
          storage_profile_id=None,
          locale=None,
          flags=None,
          additional_parameters=None,
          default_datastore_id=datastore_id,
      )
  
      # Deploy the ovf template
      result = self.vsphere_sdk_client.vcenter.ovf.LibraryItem.deploy(
          lib_item_id,
          deployment_target,
          deployment_spec,
          client_token=str(uuid.uuid4()),
      )
  
      logger.debug("result: {}".format(result))
      # The type and ID of the target deployment is available in the
      # deployment result.
      if len(result.error.errors) > 0:
          for error in result.error.errors:
              logger.error("OVF error: {}".format(error))
  
          raise ValueError(
              "OVF deployment failed for VM {}, reason: {}".format(
                  vm_name_target, result
              )
          )
  
      logger.info(
          'Deployment successful. VM Name: "{}", ID: "{}"'.format(
              vm_name_target, result.resource_id.id
          )
      )
      error = result.error
      if error is not None:
          for warning in error.warnings:
              logger.warning("OVF warning: {}".format(warning.message))
  
      vm_id = result.resource_id.id
      vm = self.get_vsphere_sdk_vm_obj(vm_id)
      return vm.name
  
imports: import logging
  import time
  import uuid
  from threading import RLock
  import com.vmware.vapi.std.errors_client
  import requests
  from com.vmware.cis.tagging_client import CategoryModel
  from com.vmware.content.library_client import Item
  from com.vmware.vapi.std.errors_client import Unauthenticated
  from com.vmware.vapi.std_client import DynamicID
  from com.vmware.vcenter.ovf_client import DiskProvisioningType, LibraryItem
  from com.vmware.vcenter.vm.hardware_client import Cpu, Memory
  from com.vmware.vcenter.vm_client import Power
  from com.vmware.vcenter_client import VM, Host, ResourcePool
  from vmware.vapi.vsphere.client import create_vsphere_client
  from ray.autoscaler._private.vsphere.utils import Constants, singleton_client
  from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME
label_desc: Use image node_id 23 for calling the VsphereSdkProvider obj's underlying member method code with example usage: obj.deploy_ovf(lib_item, vm_name_target, resource_pool_id, host_id, datastore_id) and returns: vm