Storage Pools

Atlas storage pools form the backbone of storage on the Atlas System, and are highly tuned for high throughput and low latency.

Basic Operations

Storage Pools may be created, read, updated, and destroyed from the API.

List the Storage Pools

Send this request to get back a list of all the storage pools.

Request Object

+ URL
  /api/v2/pool

+ Method
  GET

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

Sending this should get you back a valid response, if you’ve sent correct credentials.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
      "name": "B01",
      "size": "128024385159168",
      "alloc": "2662812672",
      "free": "128021722346496",
      "expandsz": "",
      "cap": "0",
      "dedup": "1.00",
      "health": "ONLINE",
      "altroot": "",
      "autoexpand": "off",
      "multihost": "off"
    },
    {
      "name": "rpool",
      "size": "119185342464",
      "alloc": "11923906560",
      "free": "107261435904",
      "expandsz": "",
      "cap": "10",
      "dedup": "1.00",
      "health": "ONLINE",
      "altroot": "",
      "autoexpand": "off",
      "multihost": "off"
    }
  ]

See one pool in particular

Send this request to get back information for a specific pool.

Request Object

+ URL
  /api/v2/pool/find

+ Method
  POST

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Parameters
  name (string, required, Body) - The name of the pool you are searching for.

+ Body
  {
    "name": "P02"
  }

Response Object

Sending this should get you back a valid response.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
        "name": "P02",
        "size": "3985729650688",
        "alloc": "4880896",
        "free": "3985724769792",
        "expandsz": "",
        "cap": "0",
        "dedup": "1.00",
        "health": "ONLINE",
        "altroot": "",
        "autoexpand": "off",
        "multihost": "off"
    }
  ]

Retrieve pool details

Send this request to get more in depth information about the pool you’re looking for. This will include fs properties and pool properties.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/details

+ Method
  GET

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

Sending this should get you back valid response all of the pool details, pool properties and zfs properties for the pool you specified (Note: This response returns every pool/zfs property which is well over 400+ lines of json. We have removed major portions of the output for brevity’s sake)

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "name": "P02",
    "size": "3985729650688",
    "alloc": "4880896",
    "free": "3985724769792",
    "expandsz": "",
    "cap": "0",
    "dedup": "1.00",
    "health": "ONLINE",
    "altroot": "",
    "autoexpand": "off",
    "multihost": "off",
    "properties": {
        "pool_properties": {
          "capacity": {
              "pool": "P02",
              "property": "capacity",
              "value": "0",
              "source": "-"
          },
          "altroot": {
              "pool": "P02",
              "property": "altroot",
              "value": "-",
              "source": "default"
          },
          "health": {
              "pool": "P02",
              "property": "health",
              "value": "ONLINE",
              "source": "-"
          },
          "guid": {
              "pool": "P02",
              "property": "guid",
              "value": "10419657224024291802",
              "source": "-"
          },
          "feature@async_destroy": {
              "pool": "P02",
              "property": "feature@async_destroy",
              "value": "enabled",
              "source": "local"
          },
          "feature@empty_bpobj": {
              "pool": "P02",
              "property": "feature@empty_bpobj",
              "value": "active",
              "source": "local"
          },
          "feature@lz4_compress": {
              "pool": "P02",
              "property": "feature@lz4_compress",
              "value": "active",
              "source": "local"
          },
          "feature@multi_vdev_crash_dump": {
              "pool": "P02",
              "property": "feature@multi_vdev_crash_dump",
              "value": "enabled",
              "source": "local"
          },
        },
        "fs_properties": {
            "type": {
                "name": "P02",
                "property": "type",
                "value": "filesystem",
                "source": "-"
            },
            "creation": {
                "name": "P02",
                "property": "creation",
                "value": "Fri",
                "source": "Dec"
            },
            "used": {
                "name": "P02",
                "property": "used",
                "value": "4.62M",
                "source": "-"
            },
            "available": {
                "name": "P02",
                "property": "available",
                "value": "3.51T",
                "source": "-"
            },
            "referenced": {
                "name": "P02",
                "property": "referenced",
                "value": "24K",
                "source": "-"
            },
        }
    }
  }

Get Pool Info

You can call for information about a particular pool.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/info

+ Method
  GET

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

Sending this should get you back a valid response, if you’ve sent correct credentials.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "name": "B01",
    "replication_level": "raidz1",
    "disks_per_device": 8,
    "device_disk_size": 4000787030016
  }

Get Pool Status

You can call for system status of a particular pool.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/status

+ Method
  GET

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

Sending this should get you back a valid response, if you’ve sent correct credentials.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "name": "B01",
    "guid": "62605216",
    "state": "ONLINE",
    "status": 27,
    "scan": {
      "state": 2,
      "start": 1596957842,
      "end": 1596957843,
      "function": 1,
      "examined": 2662523904,
      "examined_hr": "2.48G",
      "to_examine": 2662745088,
      "to_examine_hr": "2.48G",
      "total": 2662745088,
      "total_hr": "2.48G",
      "fraction_done": 0.9999169338435749,
      "state_name": "FINISHED",
      "func_name": "SCRUB"
    },
    "config": {
      "name": "B01",
      "type": "root",
      "state": "ONLINE",
      "read_errors": "0",
      "write_errors": "0",
      "checksum_errors": "0",
      "spares": [
        {
          "physpath": "pci-0000:05:00.0-sas-exp0x5003048017c5afbf-phy16-lun-0",
          "path": "/dev/disk/by-id/wwn-0x5000c5008387f873-part1",
          "name": "wwn-0x5000c5008387f873",
          "type": "disk",
          "state": "ONLINE",
          "read_errors": "0",
          "write_errors": "0",
          "checksum_errors": "0",
          "children": []
        }
      ],
      "devices": [
        {
          "name": "raidz1-0",
          "type": "raidz",
          "state": "ONLINE",
          "read_errors": "0",
          "write_errors": "0",
          "checksum_errors": "0",
          "children": [
            {
              "physpath": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy24-lun-0",
              "path": "/dev/disk/by-id/wwn-0x5000c5008387fb77-part1",
              "name": "wwn-0x5000c5008387fb77",
              "type": "disk",
              "state": "ONLINE",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "children": []
            },
            {
              "physpath": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy23-lun-0",
              "path": "/dev/disk/by-id/wwn-0x5000c500427df9b7-part1",
              "name": "wwn-0x5000c500427df9b7",
              "type": "disk",
              "state": "ONLINE",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "children": []
            },
            {
              "physpath": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy22-lun-0",
              "path": "/dev/disk/by-id/wwn-0x5000c50083886cbf-part1",
              "name": "wwn-0x5000c50083886cbf",
              "type": "disk",
              "state": "ONLINE",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "children": []
            },
            {
              "physpath": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy21-lun-0",
              "path": "/dev/disk/by-id/wwn-0x5000c5008387c04f-part1",
              "name": "wwn-0x5000c5008387c04f",
              "type": "disk",
              "state": "ONLINE",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "children": []
            },
            {
              "physpath": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy19-lun-0",
              "path": "/dev/disk/by-id/wwn-0x5000c50083884263-part1",
              "name": "wwn-0x5000c50083884263",
              "type": "disk",
              "state": "ONLINE",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "children": []
            },
            {
              "physpath": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy18-lun-0",
              "path": "/dev/disk/by-id/wwn-0x5000c5008388118f-part1",
              "name": "wwn-0x5000c5008388118f",
              "type": "disk",
              "state": "ONLINE",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "children": []
            },
            {
              "physpath": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy17-lun-0",
              "path": "/dev/disk/by-id/wwn-0x5000c5008387e62f-part1",
              "name": "wwn-0x5000c5008387e62f",
              "type": "disk",
              "state": "ONLINE",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "children": []
            },
            {
              "physpath": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy16-lun-0",
              "path": "/dev/disk/by-id/wwn-0x5000c50056825db7-part1",
              "name": "wwn-0x5000c50056825db7",
              "type": "disk",
              "state": "ONLINE",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "children": []
            }
          ]
        }
      ]
    },
    "free": "128021722346496",
    "alloc": "2662812672",
    "size": "128024385159168"
  }

Create a new Storage Pool

Creating a new storage pool is fairly simple

Request Object

+ URL
  /api/v2/pool/create

+ Method
  POST

+ Parameters
  name (string, required, Body) - the name to be given to the storage pool
  devices (string, required, Body) - a comma separated list of storage devices to put into the pool
  devicespv (number, optional, Body) - a number of devices to put into each logical divider (vdev), defaults to 5
  raid (string, optional, Body) - a string noting the device redundancy level, one of 'none,mirror,raidz1,raidz2,raidz3', defaults to raidz1
  force (boolean, optional, Body) - a boolean noting if we should force this operation. Useful for previously used disks, but be careful

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "name": "V01",
    "devices": "/dev/disk/by-id/scsi-35000c5008387e583,/dev/disk/by-id/scsi-35000c50083882fdf,/dev/disk/by-id/scsi-35000c50083882d23",
    "devicepv": 3,
    "zraid": "raidz1"
  }

Response Object

You’ll get back and object containing the options we used to create your pool.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "V01",
    "raidlevel": "raidz1",
    "devices": [
      "/dev/disk/by-id/scsi-35000c5008387e583",
      "/dev/disk/by-id/scsi-35000c50083882fdf",
      "/dev/disk/by-id/scsi-35000c50083882d23"
    ],
    "disks_per_vdev": 5,
    "spares": [],
    "options": {
      "autoreplace": "on",
      "failmode": "continue"
    }
  }

Update a Storage Pool

Update your storage pool with new settings when you need to

Request Object

+ URL
  /api/v2/pool/$POOLNAME/update

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to update
  property (string, required, Body) - the pool property you wish to update
  value (string, required, Body) - the value you wish to set on that pool

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "pool": "B01",
    "property": "multihost",
    "value": "on"
  }

Response Object

The response will send you back the name of the pool it just updated.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "B01"
  }

Destroy a Storage Pool

Please be very careful when destroying a storage pool. This is not a recoverable operation.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/destroy

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to destroy

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

The response will send you back the name of the pool it just destroyed.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "B01"
  }

Storage Pool LED Control

Use this route to turn the LEDs for the disks in a Storage Pool on or off.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/led

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool on which to turn LEDs on or off
  state (string, required, Body) - valid states are `on` or `off`

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "state": "on"
  }

Response Object

The response will send you back the names of the devices whose LED states should have changed.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    "/dev/sdc",
    "/dev/sdd"
  ]

Importing and Exporting Pools

Storage pools may be imported and exported. Exporting a pool makes it unavailable for use, and you may physically disconnect the storage devices from the system, transfer them to another system, and re-import the storage pool within the devices

Export a Storage Pool

Exporting a storage pool makes it unavailable for use.

Request Object

+ URL
  /api/v2/pool/export/$POOLNAME

+ Method
  GET

+ Parameters
  pool (string, required, URL Param) - the name of the pool to export

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

The response will send you back a message about the export.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  "Exported a pool: V01"

View Importable pools

You can call to the import route without a pool specified to see which pools are available to import

Request Object

+ URL
  /api/v2/pool/import

+ Method
  GET

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

You will get back an array with pool names available to import

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    "V01"
  ]

Import a pool

Call the import route with a pool specified to import it

Request Object

+ URL
  /api/v2/pool/import/$POOLNAME

+ Method
  GET

+ Parameters
  pool (string, required, URL Param) - the name of the pool to export

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

You will get back an empty array

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  []

View Usage Statistics for a pool

Call this route to view the usage statistics for a pool.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/stats/usage

+ Method
  GET

+ Parameters
  pool (string, required, URL Param) - the name of the pool to retrieve statistics for
  sample (string, required, Body) - The timeframe you would like to retrieve statistics for. This can be one of [`hourly`, `daily`, `monthly`, `yearly`]

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "sample": "hourly"
  }

Response Object

You will get back an empty array

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  []

Scrub a Pool

Scrubbing a pool will go through and make sure there are no data errors on the storage devices.

Start a Scrub

Starting a scrub requires only a poolname

Request Object

+ URL
  /api/v2/pool/$POOLNAME/scrub/start

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

You will get back an object with the pool you started scrubbing

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "V01"
  }

Stop a Scrub

Starting a scrub requires only a poolname

Request Object

+ URL
  /api/v2/pool/$POOLNAME/scrub/stop

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

You will get back an object with the pool you stopped scrubbing

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "V01"
  }

Device Operations

Each storage pool is made up of multiple storage devices. Here’s how you can manipulate them.

List Storage Devices

Listing the storage devices is very easy when you know the name of the pool

Request Object

+ URL
  /api/v2/pool/$POOLNAME/device

+ Method
  GET

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

You will get back an array with a ton of information on the storage devices

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
      "devlinks": [
        "/dev/disk/by-id/scsi-35000c5008387e583",
        "/dev/disk/by-id/scsi-SSEAGATE_ST4000NM0023_Z1Z8LQAZ0000C5415MGF",
        "/dev/disk/by-id/wwn-0x5000c5008387e583",
        "/dev/disk/by-path/pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy25-lun-0"
      ],
      "devname": "/dev/sdaa",
      "devpath": "/devices/pci0000:80/0000:80:02.0/0000:82:00.0/host7/port-7:0/expander-7:0/port-7:0:13/end_device-7:0:13/target7:0:13/7:0:13:0/block/sdaa",
      "devtype": "disk",
      "dm_multipath_device_path": "0",
      "id_bus": "scsi",
      "id_model": "ST4000NM0023",
      "id_model_enc": "ST4000NM0023\\x20\\x20\\x20\\x20",
      "id_part_table_type": "gpt",
      "id_part_table_uuid": "59f9b712-23ba-6649-8de3-8ba8340276e2",
      "id_path": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy25-lun-0",
      "id_path_tag": "pci-0000_82_00_0-sas-exp0x5003048001ecb4bf-phy25-lun-0",
      "id_revision": "0002",
      "id_scsi": "1",
      "id_scsi_inquiry": "1",
      "id_serial": "35000c5008387e583",
      "id_serial_short": "5000c5008387e583",
      "id_type": "disk",
      "id_vendor": "SEAGATE",
      "id_vendor_enc": "SEAGATE\\x20",
      "id_wwn": "0x5000c5008387e583",
      "id_wwn_with_extension": "0x5000c5008387e583",
      "major": "65",
      "minor": "160",
      "mpath_sbin_path": "/sbin",
      "scsi_ident_lun_naa_reg": "5000c5008387e583",
      "scsi_ident_port_naa_reg": "5000c5008387e581",
      "scsi_ident_port_relative": "1",
      "scsi_ident_serial": "Z1Z8LQAZ0000C5415MGF",
      "scsi_ident_target_naa_reg": "5000c5008387e580",
      "scsi_ident_target_name": "naa.5000C5008387E580",
      "scsi_model": "ST4000NM0023",
      "scsi_model_enc": "ST4000NM0023\\x20\\x20\\x20\\x20",
      "scsi_revision": "0002",
      "scsi_tpgs": "0",
      "scsi_type": "disk",
      "scsi_vendor": "SEAGATE",
      "scsi_vendor_enc": "SEAGATE\\x20",
      "subsystem": "block",
      "tags": ":systemd:",
      "usec_initialized": "17388214",
      "syspath": "/sys/devices/pci0000:80/0000:80:02.0/0000:82:00.0/host7/port-7:0/expander-7:0/port-7:0:13/end_device-7:0:13/target7:0:13/7:0:13:0/block/sdaa",
      "size_in_bytes": 4000787030016,
      "partitions": [
        {
          "name": "sdaa1",
          "size": 4000776716288,
          "model": null,
          "vendor": null
        },
        {
          "name": "sdaa9",
          "size": 8388608,
          "model": null,
          "vendor": null
        }
      ],
      "model": "ST4000NM0023",
      "vendor": "SEAGATE",
      "zfs_label_name": "V01",
      "zfs_label_pool_guid": "15085674811059609064",
      "zfs_label_conf_guid": "8176543228162992078",
      "zfs_label_state": 0,
      "zfs_label_state_name": "ACTIVE"
    },
    {
      "devlinks": [
        "/dev/disk/by-id/scsi-35000c50083882fdf",
        "/dev/disk/by-id/scsi-SSEAGATE_ST4000NM0023_Z1Z8LNBV0000R540VS87",
        "/dev/disk/by-id/wwn-0x5000c50083882fdf",
        "/dev/disk/by-path/pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy26-lun-0"
      ],
      "devname": "/dev/sdab",
      "devpath": "/devices/pci0000:80/0000:80:02.0/0000:82:00.0/host7/port-7:0/expander-7:0/port-7:0:14/end_device-7:0:14/target7:0:14/7:0:14:0/block/sdab",
      "devtype": "disk",
      "dm_multipath_device_path": "0",
      "id_bus": "scsi",
      "id_model": "ST4000NM0023",
      "id_model_enc": "ST4000NM0023\\x20\\x20\\x20\\x20",
      "id_part_table_type": "gpt",
      "id_part_table_uuid": "b00df56d-b24f-d54f-a49d-103870a34789",
      "id_path": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy26-lun-0",
      "id_path_tag": "pci-0000_82_00_0-sas-exp0x5003048001ecb4bf-phy26-lun-0",
      "id_revision": "0002",
      "id_scsi": "1",
      "id_scsi_inquiry": "1",
      "id_serial": "35000c50083882fdf",
      "id_serial_short": "5000c50083882fdf",
      "id_type": "disk",
      "id_vendor": "SEAGATE",
      "id_vendor_enc": "SEAGATE\\x20",
      "id_wwn": "0x5000c50083882fdf",
      "id_wwn_with_extension": "0x5000c50083882fdf",
      "major": "65",
      "minor": "176",
      "mpath_sbin_path": "/sbin",
      "scsi_ident_lun_naa_reg": "5000c50083882fdf",
      "scsi_ident_port_naa_reg": "5000c50083882fdd",
      "scsi_ident_port_relative": "1",
      "scsi_ident_serial": "Z1Z8LNBV0000R540VS87",
      "scsi_ident_target_naa_reg": "5000c50083882fdc",
      "scsi_ident_target_name": "naa.5000C50083882FDC",
      "scsi_model": "ST4000NM0023",
      "scsi_model_enc": "ST4000NM0023\\x20\\x20\\x20\\x20",
      "scsi_revision": "0002",
      "scsi_tpgs": "0",
      "scsi_type": "disk",
      "scsi_vendor": "SEAGATE",
      "scsi_vendor_enc": "SEAGATE\\x20",
      "subsystem": "block",
      "tags": ":systemd:",
      "usec_initialized": "17352907",
      "syspath": "/sys/devices/pci0000:80/0000:80:02.0/0000:82:00.0/host7/port-7:0/expander-7:0/port-7:0:14/end_device-7:0:14/target7:0:14/7:0:14:0/block/sdab",
      "size_in_bytes": 4000787030016,
      "partitions": [
        {
          "name": "sdab1",
          "size": 4000776716288,
          "model": null,
          "vendor": null
        },
        {
          "name": "sdab9",
          "size": 8388608,
          "model": null,
          "vendor": null
        }
      ],
      "model": "ST4000NM0023",
      "vendor": "SEAGATE",
      "zfs_label_name": "V01",
      "zfs_label_pool_guid": "15085674811059609064",
      "zfs_label_conf_guid": "16729704502249661951",
      "zfs_label_state": 0,
      "zfs_label_state_name": "ACTIVE"
    },
    {
      "devlinks": [
        "/dev/disk/by-id/scsi-35000c50083882d23",
        "/dev/disk/by-id/scsi-SSEAGATE_ST4000NM0023_Z1Z8LNDS0000R540VRPL",
        "/dev/disk/by-id/wwn-0x5000c50083882d23",
        "/dev/disk/by-path/pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy27-lun-0"
      ],
      "devname": "/dev/sdac",
      "devpath": "/devices/pci0000:80/0000:80:02.0/0000:82:00.0/host7/port-7:0/expander-7:0/port-7:0:15/end_device-7:0:15/target7:0:15/7:0:15:0/block/sdac",
      "devtype": "disk",
      "dm_multipath_device_path": "0",
      "id_bus": "scsi",
      "id_model": "ST4000NM0023",
      "id_model_enc": "ST4000NM0023\\x20\\x20\\x20\\x20",
      "id_part_table_type": "gpt",
      "id_part_table_uuid": "506b0327-2b0d-1b41-ad8f-edbd1b82ff57",
      "id_path": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy27-lun-0",
      "id_path_tag": "pci-0000_82_00_0-sas-exp0x5003048001ecb4bf-phy27-lun-0",
      "id_revision": "0002",
      "id_scsi": "1",
      "id_scsi_inquiry": "1",
      "id_serial": "35000c50083882d23",
      "id_serial_short": "5000c50083882d23",
      "id_type": "disk",
      "id_vendor": "SEAGATE",
      "id_vendor_enc": "SEAGATE\\x20",
      "id_wwn": "0x5000c50083882d23",
      "id_wwn_with_extension": "0x5000c50083882d23",
      "major": "65",
      "minor": "192",
      "mpath_sbin_path": "/sbin",
      "scsi_ident_lun_naa_reg": "5000c50083882d23",
      "scsi_ident_port_naa_reg": "5000c50083882d21",
      "scsi_ident_port_relative": "1",
      "scsi_ident_serial": "Z1Z8LNDS0000R540VRPL",
      "scsi_ident_target_naa_reg": "5000c50083882d20",
      "scsi_ident_target_name": "naa.5000C50083882D20",
      "scsi_model": "ST4000NM0023",
      "scsi_model_enc": "ST4000NM0023\\x20\\x20\\x20\\x20",
      "scsi_revision": "0002",
      "scsi_tpgs": "0",
      "scsi_type": "disk",
      "scsi_vendor": "SEAGATE",
      "scsi_vendor_enc": "SEAGATE\\x20",
      "subsystem": "block",
      "tags": ":systemd:",
      "usec_initialized": "17336754",
      "syspath": "/sys/devices/pci0000:80/0000:80:02.0/0000:82:00.0/host7/port-7:0/expander-7:0/port-7:0:15/end_device-7:0:15/target7:0:15/7:0:15:0/block/sdac",
      "size_in_bytes": 4000787030016,
      "partitions": [
        {
          "name": "sdac1",
          "size": 4000776716288,
          "model": null,
          "vendor": null
        },
        {
          "name": "sdac9",
          "size": 8388608,
          "model": null,
          "vendor": null
        }
      ],
      "model": "ST4000NM0023",
      "vendor": "SEAGATE",
      "zfs_label_name": "V01",
      "zfs_label_pool_guid": "15085674811059609064",
      "zfs_label_conf_guid": "10888171914902028883",
      "zfs_label_state": 0,
      "zfs_label_state_name": "ACTIVE"
    }
  ]

Get one storage device

Much like pools themselves, you can get back information about one particular storage device if you’d like. Requests for devices are keyed off the id_serial_short.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/device/details

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub
  device (string, required, BODY) - the identifier of the device, id_serial_short

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "device": "5000c5008387e583"
  }

Response Object

You will get back an array with a ton of information on the storage device

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
      "devlinks": [
        "/dev/disk/by-id/scsi-35000c5008387e583",
        "/dev/disk/by-id/scsi-SSEAGATE_ST4000NM0023_Z1Z8LQAZ0000C5415MGF",
        "/dev/disk/by-id/wwn-0x5000c5008387e583",
        "/dev/disk/by-path/pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy25-lun-0"
      ],
      "devname": "/dev/sdaa",
      "devpath": "/devices/pci0000:80/0000:80:02.0/0000:82:00.0/host7/port-7:0/expander-7:0/port-7:0:13/end_device-7:0:13/target7:0:13/7:0:13:0/block/sdaa",
      "devtype": "disk",
      "dm_multipath_device_path": "0",
      "id_bus": "scsi",
      "id_model": "ST4000NM0023",
      "id_model_enc": "ST4000NM0023\\x20\\x20\\x20\\x20",
      "id_part_table_type": "gpt",
      "id_part_table_uuid": "59f9b712-23ba-6649-8de3-8ba8340276e2",
      "id_path": "pci-0000:82:00.0-sas-exp0x5003048001ecb4bf-phy25-lun-0",
      "id_path_tag": "pci-0000_82_00_0-sas-exp0x5003048001ecb4bf-phy25-lun-0",
      "id_revision": "0002",
      "id_scsi": "1",
      "id_scsi_inquiry": "1",
      "id_serial": "35000c5008387e583",
      "id_serial_short": "5000c5008387e583",
      "id_type": "disk",
      "id_vendor": "SEAGATE",
      "id_vendor_enc": "SEAGATE\\x20",
      "id_wwn": "0x5000c5008387e583",
      "id_wwn_with_extension": "0x5000c5008387e583",
      "major": "65",
      "minor": "160",
      "mpath_sbin_path": "/sbin",
      "scsi_ident_lun_naa_reg": "5000c5008387e583",
      "scsi_ident_port_naa_reg": "5000c5008387e581",
      "scsi_ident_port_relative": "1",
      "scsi_ident_serial": "Z1Z8LQAZ0000C5415MGF",
      "scsi_ident_target_naa_reg": "5000c5008387e580",
      "scsi_ident_target_name": "naa.5000C5008387E580",
      "scsi_model": "ST4000NM0023",
      "scsi_model_enc": "ST4000NM0023\\x20\\x20\\x20\\x20",
      "scsi_revision": "0002",
      "scsi_tpgs": "0",
      "scsi_type": "disk",
      "scsi_vendor": "SEAGATE",
      "scsi_vendor_enc": "SEAGATE\\x20",
      "subsystem": "block",
      "tags": ":systemd:",
      "usec_initialized": "17388214",
      "syspath": "/sys/devices/pci0000:80/0000:80:02.0/0000:82:00.0/host7/port-7:0/expander-7:0/port-7:0:13/end_device-7:0:13/target7:0:13/7:0:13:0/block/sdaa",
      "size_in_bytes": 4000787030016,
      "partitions": [
        {
          "name": "sdaa1",
          "size": 4000776716288,
          "model": null,
          "vendor": null
        },
        {
          "name": "sdaa9",
          "size": 8388608,
          "model": null,
          "vendor": null
        }
      ],
      "model": "ST4000NM0023",
      "vendor": "SEAGATE",
      "zfs_label_name": "V01",
      "zfs_label_pool_guid": "15085674811059609064",
      "zfs_label_conf_guid": "8176543228162992078",
      "zfs_label_state": 0,
      "zfs_label_state_name": "ACTIVE"
    }
  ]

Add a storage device

Once you have a pool created, you can go back and add additional devices in many different capacities.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/device/add

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub
  role (string, required, BODY) - the role the device should play, one of (spare,log,cache,vdev)
  devices (string, required, BODY) - a comma separated list of storage devices
  force (boolean, optional, BODY) -  a boolean noting if we should force this operation. Useful for previously used disks, but be careful

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "role": "spare",
    "devices": "/dev/disk/by-id/scsi-35000c5008387fb77"
  }

Response Object

The API will echo back to you the options used to extend the pool

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "role": "spare",
    "devices": "/dev/disk/by-id/scsi-35000c5008387fb77"
  }

Offline a storage device

Now that we’ve added a spare to a pool, if we offline one of the main storage devices, the spare should step in to fill that gap.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/device/offline

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub
  device (string, required, BODY) - an identifier of a storage device

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "device": "/dev/disk/by-id/scsi-35000c5008387e583"
  }

Response Object

The API will echo back to you the options used to offline a device

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "V01",
    "device": "/dev/disk/by-id/scsi-35000c5008387e583"
  }

Online a storage device

The storage device we offlined before can now be brought back online if we wish.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/device/online

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub
  device (string, required, BODY) - an identifier of a storage device

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "device": "/dev/disk/by-id/scsi-35000c5008387e583"
  }

Response Object

The API will echo back to you the options used to online a device

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "V01",
    "device": "/dev/disk/by-id/scsi-35000c5008387e583"
  }

Remove a storage device

Let’s now remove the spare we added to this pool

Request Object

+ URL
  /api/v2/pool/$POOLNAME/device/remove

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub
  device (string, required, BODY) - an identifier of a storage device

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "device": "/dev/disk/by-id/scsi-35000c5008387fb77"
  }

Response Object

The API will echo back to you the options used to remove the device

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "V01",
    "device": "/dev/disk/by-id/scsi-35000c5008387fb77"
  }

Replace a storage device

Let’s use the spare we just removed to replace one of the devices in the pool.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/device/replace

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub
  device (string, required, BODY) - an identifier of a storage device to be replaced
  replacement (string, required, BODY) - an identifier of a storage device to replace the above device

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "device": "/dev/disk/by-id/scsi-35000c5008387e583",
    "replacement": "/dev/disk/by-id/scsi-35000c5008387fb77"
  }

Response Object

The API will echo back to you the options used to replace a device

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "V01",
    "device": "/dev/disk/by-id/scsi-35000c5008387e583",
    "replacement": "/dev/disk/by-id/scsi-35000c5008387fb77",
    "force": false
  }

Detach a storage device

When you have a device being used as spare, or a mirrored pool, you may detach one of the disks.

Request Object

+ URL
  /api/v2/pool/$POOLNAME/device/detach

+ Method
  POST

+ Parameters
  pool (string, required, URL Param) - the name of the pool to scrub
  device (string, required, BODY) - an identifier of a storage device to be detached

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "device": "wwn-0x5000c5008387fb77"
  }

Response Object

The API will echo back to you the options used to detach a device

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "pool": "C01",
    "device": "wwn-0x5000c5008387fb77"
  }