vsphere/internal/virtualdevice/virtual_machine_cdrom_subresource.go
func (r *CdromSubresource) ValidateDiff() error {
	log.Printf("[DEBUG] %s: Beginning CDROM configuration validation", r)
	dsID := r.Get("datastore_id").(string)
	path := r.Get("path").(string)
	clientDevice := r.Get("client_device").(bool)
	switch {
	case clientDevice && (dsID != "" || path != ""):
		return fmt.Errorf("Cannot have both client_device parameter and ISO file parameters (datastore_id, path) set")
	case !clientDevice && (dsID == "" || path == ""):
		return fmt.Errorf("Either client_device or datastore_id and path must be set")
	}
	log.Printf("[DEBUG] %s: Config validation complete", r)
	return nil
}
func (r *CdromSubresource) ValidateDiff() error {
	log.Printf("[DEBUG] %s: Beginning CDROM configuration validation", r)
	dsID := r.Get("datastore_id").(string)
	path := r.Get("path").(string)
	clientDevice := r.Get("client_device").(bool)
	switch {
	case clientDevice && (dsID != "" || path != ""):
		return fmt.Errorf("Cannot have both client_device parameter and ISO file parameters (datastore_id, path) set")
	case !clientDevice && (dsID == "" || path == ""):
		return fmt.Errorf("Either client_device or datastore_id and path must be set")
	}
	log.Printf("[DEBUG] %s: Config validation complete", r)
	return nil
}
// ValidateDiff performs any complex validation of an individual
// cdrom sub-resource that can't be done in schema alone.