List Orphaned Disks

Orphaned disks are logical volume groups not utilised by Virtualizor. Use the List Orphaned Disks API to list all the orphaned disk present on the server. The list contains all information about the orphaned disks, listed according to their filepaths on the server. To filter the list you can pass in one or more query parameters.

HTTP Request

https://hostname:4085/index.php?act=orphaneddisks

Parameters

NameMethodValueDescriptionRequired
actGETorphaneddisksThe action specified to list the orphaned disksYes
st_idPOSTIntFilter list using storage IDNo
st_typePOSTtextFilter list using storage type (file, block, openvz, thin block, zfs block, zfs thin block, zfs block compressed, zfs thin block compressed, ceph block)No
disk_pathPOSTtextFilter list using the disk pathNo

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['st_id'] = '';
    $post['st_type'] = '';
    $post['disk_path'] = '';
    $output = $admin->orphaneddisks($post);

    print_r(json_encode($output));

?>

Output

{
    "title": "Orphaned Disks",
    "orphaned_disks": {
        "/dev/vg/orphan": {
            "path": "/dev/vg/orphan",
            "size": 1073741824,
            "st_id": 3
        },
        "/dev/vg/orphan10": {
            "path": "/dev/vg/orphan10",
            "size": 4194304,
            "st_id": 3
        }
    },
    "timenow": 1535625702,
    "time_taken": "0.453"
}
Was this helpful to you?