vsphere/virtual_machine_config_structure.go
func flattenVirtualMachineConfigInfo(d *schema.ResourceData, obj *types.VirtualMachineConfigInfo) error {
	d.Set("name", obj.Name)
	d.Set("guest_id", obj.GuestId)
	d.Set("alternate_guest_name", obj.AlternateGuestName)
	d.Set("annotation", obj.Annotation)
	d.Set("num_cpus", obj.Hardware.NumCPU)
	d.Set("num_cores_per_socket", obj.Hardware.NumCoresPerSocket)
	d.Set("memory", obj.Hardware.MemoryMB)
	d.Set("memory_hot_add_enabled", obj.MemoryHotAddEnabled)
	d.Set("cpu_hot_add_enabled", obj.CpuHotAddEnabled)
	d.Set("cpu_hot_remove_enabled", obj.CpuHotRemoveEnabled)
	d.Set("swap_placement_policy", obj.SwapPlacement)
	d.Set("firmware", obj.Firmware)
	d.Set("nested_hv_enabled", obj.NestedHVEnabled)
	d.Set("cpu_performance_counters_enabled", obj.VPMCEnabled)
	d.Set("change_version", obj.ChangeVersion)
	d.Set("uuid", obj.Uuid)

	if err := flattenToolsConfigInfo(d, obj.Tools); err != nil {
		return err
	}
	if err := flattenVirtualMachineFlagInfo(d, &obj.Flags); err != nil {
		return err
	}
	if err := flattenVirtualMachineResourceAllocation(d, obj.CpuAllocation, "cpu"); err != nil {
		return err
	}
	if err := flattenVirtualMachineResourceAllocation(d, obj.MemoryAllocation, "memory"); err != nil {
		return err
	}
	if err := flattenExtraConfig(d, obj.ExtraConfig); err != nil {
		return err
	}
	if err := flattenVAppConfig(d, obj.VAppConfig); err != nil {
		return err
	}
	if err := flattenLatencySensitivity(d, obj.LatencySensitivity); err != nil {
		return err
	}

	// This method does not operate any different than the above method but we
	// return its error result directly to ensure there are no warnings in the
	// linter. It's awkward, but golint does not allow setting exceptions.
	return flattenVirtualMachineBootOptions(d, obj.BootOptions)
}
func flattenVirtualMachineConfigInfo(d *schema.ResourceData, obj *types.VirtualMachineConfigInfo) error {
	d.Set("name", obj.Name)
	d.Set("guest_id", obj.GuestId)
	d.Set("alternate_guest_name", obj.AlternateGuestName)
	d.Set("annotation", obj.Annotation)
	d.Set("num_cpus", obj.Hardware.NumCPU)
	d.Set("num_cores_per_socket", obj.Hardware.NumCoresPerSocket)
	d.Set("memory", obj.Hardware.MemoryMB)
	d.Set("memory_hot_add_enabled", obj.MemoryHotAddEnabled)
	d.Set("cpu_hot_add_enabled", obj.CpuHotAddEnabled)
	d.Set("cpu_hot_remove_enabled", obj.CpuHotRemoveEnabled)
	d.Set("swap_placement_policy", obj.SwapPlacement)
	d.Set("firmware", obj.Firmware)
	d.Set("nested_hv_enabled", obj.NestedHVEnabled)
	d.Set("cpu_performance_counters_enabled", obj.VPMCEnabled)
	d.Set("change_version", obj.ChangeVersion)
	d.Set("uuid", obj.Uuid)

	if err := flattenToolsConfigInfo(d, obj.Tools); err != nil {
		return err
	}
	if err := flattenVirtualMachineFlagInfo(d, &obj.Flags); err != nil {
		return err
	}
	if err := flattenVirtualMachineResourceAllocation(d, obj.CpuAllocation, "cpu"); err != nil {
		return err
	}
	if err := flattenVirtualMachineResourceAllocation(d, obj.MemoryAllocation, "memory"); err != nil {
		return err
	}
	if err := flattenExtraConfig(d, obj.ExtraConfig); err != nil {
		return err
	}
	if err := flattenVAppConfig(d, obj.VAppConfig); err != nil {
		return err
	}
	if err := flattenLatencySensitivity(d, obj.LatencySensitivity); err != nil {
		return err
	}

	// This method does not operate any different than the above method but we
	// return its error result directly to ensure there are no warnings in the
	// linter. It's awkward, but golint does not allow setting exceptions.
	return flattenVirtualMachineBootOptions(d, obj.BootOptions)
}
// flattenVirtualMachineConfigInfo reads various fields from a
// VirtualMachineConfigInfo into the passed in ResourceData.
//
// This is the flatten counterpart to expandVirtualMachineConfigSpec.