Beispiel #1
0
/**
 * delete a virtual volume
 *
 * @param   int $volume_id volume id
 *
 * @return  bool                TRUE on success | FALSE on error
 */
function ace_virt_volume_delete($volume_id)
{
    $volume_info = ace_volume_get_info($volume_id);
    $volume_lab_id = $volume_info['lab_id'];
    $volume_virt_id = $volume_info['virt_id'];
    $volume_host_id = ace_lab_get_host_id($volume_lab_id);
    return ace_virt('delete_volume', $volume_host_id, $volume_virt_id);
}
Beispiel #2
0
 $html_str = NULL;
 $html_lab_volume_radios = NULL;
 $num_user_volumes = 0;
 $sum_all_volume_sizes = 0;
 $volume_quota = $quota_array['volumes'];
 $storage_quota = $quota_array['storage'];
 foreach ($lab_volume_table as $volume) {
     if ($volume['user_visible'] == 1) {
         $table_part_2 .= '<tr class="' . ($volume['state'] == 1 ? 'active' : 'inactive') . '">';
         $table_part_2 .= '<td>';
         $table_part_2 .= '<input name="volume_id" value="' . $volume['id'] . '" type="radio" />';
         $table_part_2 .= $volume['display_name'];
         $table_part_2 .= '</td>';
         if ($volume['base_id'] !== NULL) {
             $base_volume_display_name = ace_volume_get_display_name_by_id($volume['base_id']);
             $base_volume = ace_volume_get_info($volume['base_id']);
             $base_volume_size = $base_volume['unit'] == 'M' ? round($base_volume['size'] / 1024, 2) : $base_volume['size'];
             $base_volume_used = $base_volume['unit'] == 'M' ? round($base_volume['size_on_disk'] / 1024, 2) : $base_volume['size_on_disk'];
             $base_volume_free = $base_volume_size - $base_volume_used;
             $lab_volume_cost = $base_volume_free;
         } else {
             $base_volume_display_name = '';
             $volume_size = $volume['unit'] == 'M' ? round($volume['size'] / 1024, 2) : $volume['size'];
             $lab_volume_cost = $volume_size;
         }
         $table_part_2 .= '<td>' . $base_volume_display_name . '</td>';
         $table_part_2 .= '<td style="text-align:center;">' . $lab_volume_cost . '</td>';
         //$sum_all_volume_sizes += ($volume['base_id'] === NULL) ? $lab_volume_cost : 0;
         $sum_all_volume_sizes += $lab_volume_cost;
         // if ($vm_assignment_array = ace_volume_get_vm_assignments($volume['id'])) {
         // foreach ($vm_assignment_array as $element) {