Beispiel #1
0
            $success = ace_vm_create_snapshot($_POST['vm_id']);
            $message = create_message($success, "creating snapshot of {$vm_display_name}");
        } else {
            $message = create_message(FALSE, "creating snapshot, no vm_id specified");
        }
        break;
    case 'vm_media_change':
        if (isset($_POST['vm_id'])) {
            $vm_id = $_POST['vm_id'];
            $vm_cdrom_instance = $_POST['cdrom_instance'];
            $volume_id = $_POST['volume_id'];
            $vm_display_name = ace_vm_get_display_name_by_id($vm_id);
            if ($volume_id == 'none') {
                $success = ace_vm_cdrom_eject_media($vm_id, $vm_cdrom_instance);
            } else {
                $success = ace_vm_cdrom_insert_media($vm_id, $vm_cdrom_instance, $volume_id);
            }
            $message = create_message($success, "changing media in cd{$vm_cdrom_instance} of {$vm_display_name}");
        } else {
            $message = create_message(FALSE, "changing media, no vm_id specified");
        }
        break;
}
if (isset($message)) {
    $messages[] = $message;
}
unset($message);
# END COMMAND PROCESSING
# BEGIN PAGE DATA
if (isset($lab_id) && $lab_id != 'null' && $lab_id != NULL) {
    $valid_lab_selected = TRUE;
Beispiel #2
0
     if (isset($_POST['vm_id'], $_POST['vm_cdrom_instance'])) {
         $vm_display_name = ace_vm_get_display_name_by_id($_POST['vm_id']);
         $success = ace_vm_detach_cdrom($_POST['vm_id'], $_POST['vm_cdrom_instance']);
         $message = create_message($success, "detaching CD" . $_POST['vm_cdrom_instance'] . " from {$vm_display_name}");
     } else {
         $message = create_message(FALSE, "detaching cdrom from vm, no vm_id and/or cdrom specified");
     }
     break;
 case 'vm_cdrom_insert_media':
     if (isset($_POST['vm_cdrom_combo'], $_POST['volume_id'])) {
         $combo_split = explode('_', $_POST['vm_cdrom_combo'], 2);
         $vm_id = $combo_split[0];
         $vm_cdrom_instance = $combo_split[1];
         $vm_display_name = ace_vm_get_display_name_by_id($vm_id);
         $volume_display_name = ace_volume_get_display_name_by_id($_POST['volume_id']);
         $success = ace_vm_cdrom_insert_media($vm_id, $vm_cdrom_instance, $_POST['volume_id']);
         $message = create_message($success, "inserting {$volume_display_name} into CD{$vm_cdrom_instance} in {$vm_display_name}");
     } else {
         $message = create_message(FALSE, "inserting media in cdrom, no vm_id, cdrom, and/or volume specified");
     }
     break;
 case 'vm_cdrom_eject_media':
     if (isset($_POST['vm_id'], $_POST['vm_cdrom_instance'])) {
         $vm_display_name = ace_vm_get_display_name_by_id($_POST['vm_id']);
         $success = ace_vm_cdrom_eject_media($_POST['vm_id'], $_POST['vm_cdrom_instance']);
         $message = create_message($success, "ejecting CD" . $_POST['vm_cdrom_instance'] . " in {$vm_display_name}");
     } else {
         $message = create_message(FALSE, "ejecting media from cdrom, no vm_id and/or cdrom specified");
     }
     break;
 case 'vm_attach_disk':