cddvd.go
func (v *VM) RemoveAllCDDVDDrives() error {
	drives, err := v.CDDVDs()
	if err != nil {
		return &Error{
			Operation: "vm.RemoveAllCDDVDDrives",
			Code:      200004,
			Text:      fmt.Sprintf("Error listing CD/DVD Drives: %s\n", err),
		}
	}

	for _, d := range drives {
		err := v.DetachCDDVD(d)
		if err != nil {
			return &Error{
				Operation: "vm.RemoveAllCDDVDDrives",
				Code:      200004,
				Text:      fmt.Sprintf("Error removing CD/DVD Drive %v, error: %s\n", d, err),
			}
		}
	}

	return nil
}
func (v *VM) RemoveAllCDDVDDrives() error {
	drives, err := v.CDDVDs()
	if err != nil {
		return &Error{
			Operation: "vm.RemoveAllCDDVDDrives",
			Code:      200004,
			Text:      fmt.Sprintf("Error listing CD/DVD Drives: %s\n", err),
		}
	}

	for _, d := range drives {
		err := v.DetachCDDVD(d)
		if err != nil {
			return &Error{
				Operation: "vm.RemoveAllCDDVDDrives",
				Code:      200004,
				Text:      fmt.Sprintf("Error removing CD/DVD Drive %v, error: %s\n", d, err),
			}
		}
	}

	return nil
}
// RemoveAllCDDVDDrives deletes all the CD/DVD drives from the VM's VMX file.