code: def update_vsphere_configs(config):
      available_node_types = config["available_node_types"]
  
      # Fetch the head node field name from head_node_type field.
      head_node_type = config["head_node_type"]
  
      # Use head_node_type field's value to fetch the head node field
      head_node = available_node_types[head_node_type]
      head_node_config = head_node["node_config"]
  
      # Fetch worker: field from the YAML file
      worker_nodes = [
          v
          for k, v in available_node_types.items()
          if k != head_node_type
      ]
      worker_node_configs = [
          worker_node["node_config"] for worker_node in worker_nodes
      ]
  
      # A mandatory constraint enforced by the Ray's YAML validator
      # is to add resources field for both head and worker nodes.
      # For example, to specify resources for the worker the
      # user will specify it in
      #       worker:
      #           resources
      # We copy that resources field into
      #       worker:
      #           node_config:
      #               resources
      # This enables us to access the field during node creation.
      # The same happens for head node too.
      head_node_config["resources"] = head_node["resources"]
      head_resource_pool = None
      if "resource_pool" in head_node_config:
          head_resource_pool = head_node_config["resource_pool"]
  
      for worker_node in worker_nodes:
          worker_node["node_config"]["resources"] = worker_node[
              "resources"
          ]
  
      for worker_node_config in worker_node_configs:
          # if the resource pool for the worker node is unspecified then let it be the
          # head node's resource pool
  
          if not worker_node_config.get("resource_pool"):
              worker_node_config["resource_pool"] = head_resource_pool
  
      check_and_update_frozen_vm_configs_in_provider_section(
          config, head_node_config, worker_node_configs
      )
  
      update_gpu_config_in_provider_section(
          config, head_node_config, worker_node_configs
      )
  
file_path: ray/python/ray/autoscaler/_private/vsphere/config.py
imports: import copy
  import logging
  import os
  from ray.autoscaler._private.event_system import CreateClusterEvent, global_event_system
  from ray.autoscaler._private.util import check_legacy_fields
label_desc: Use image node_id 6 for calling a global function with example usage: update_vsphere_configs(config) without return types