vsphere/resource_vsphere_compute_cluster_vm_host_rule.go
func expandClusterVMHostRuleInfo(d *schema.ResourceData) (*types.ClusterVmHostRuleInfo, error) {
	obj := &types.ClusterVmHostRuleInfo{
		ClusterRuleInfo: types.ClusterRuleInfo{
			Enabled:     structure.GetBool(d, "enabled"),
			Mandatory:   structure.GetBool(d, "mandatory"),
			Name:        d.Get("name").(string),
			UserCreated: structure.BoolPtr(true),
		},
		AffineHostGroupName:     d.Get("affinity_host_group_name").(string),
		AntiAffineHostGroupName: d.Get("anti_affinity_host_group_name").(string),
		VmGroupName:             d.Get("vm_group_name").(string),
	}
	return obj, nil
}
func expandClusterVMHostRuleInfo(d *schema.ResourceData) (*types.ClusterVmHostRuleInfo, error) {
	obj := &types.ClusterVmHostRuleInfo{
		ClusterRuleInfo: types.ClusterRuleInfo{
			Enabled:     structure.GetBool(d, "enabled"),
			Mandatory:   structure.GetBool(d, "mandatory"),
			Name:        d.Get("name").(string),
			UserCreated: structure.BoolPtr(true),
		},
		AffineHostGroupName:     d.Get("affinity_host_group_name").(string),
		AntiAffineHostGroupName: d.Get("anti_affinity_host_group_name").(string),
		VmGroupName:             d.Get("vm_group_name").(string),
	}
	return obj, nil
}
// expandClusterVMHostRuleInfo reads certain ResourceData keys and returns a
// ClusterVmHostRuleInfo.