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
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | orphaneddisks | The action specified to list the orphaned disks | Yes |
st_id | POST | Int | Filter list using storage ID | No |
st_type | POST | text | Filter 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_path | POST | text | Filter list using the disk path | No |
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"
}