code: func CreateStandaloneHost(f *Folder, spec types.HostConnectSpec) (*HostSystem, types.BaseMethodFault) {
  	if spec.HostName == "" {
  		return nil, &types.NoHost{}
  	}
  
  	pool := NewResourcePool()
  	host := NewHostSystem(esx.HostSystem)
  
  	host.Summary.Config.Name = spec.HostName
  	host.Name = host.Summary.Config.Name
  	host.Runtime.ConnectionState = types.HostSystemConnectionStateDisconnected
  
  	summary := new(types.ComputeResourceSummary)
  	addComputeResource(summary, host)
  
  	cr := &mo.ComputeResource{
  		ConfigurationEx: &types.ComputeResourceConfigInfo{
  			VmSwapPlacement: string(types.VirtualMachineConfigInfoSwapPlacementTypeVmDirectory),
  		},
  		Summary:            summary,
  		EnvironmentBrowser: newEnvironmentBrowser(),
  	}
  
  	Map.PutEntity(cr, Map.NewEntity(host))
  	host.Summary.Host = &host.Self
  
  	Map.PutEntity(cr, Map.NewEntity(pool))
  
  	cr.Name = host.Name
  	cr.Network = Map.getEntityDatacenter(f).defaultNetwork()
  	cr.Host = append(cr.Host, host.Reference())
  	cr.ResourcePool = &pool.Self
  
  	f.putChild(cr)
  	pool.Owner = cr.Self
  	host.Network = cr.Network
  
  	return host, nil
  }
docs: // CreateStandaloneHost uses esx.HostSystem as a template, applying the given spec
  // and creating the ComputeResource parent and ResourcePool sibling.