Skip to content
Alberto Gonzalez edited this page Oct 29, 2015 · 1 revision

(POST)/storage

Description

Adds the specified storage for the appliance. For stateless storage creation, the user can specify a disks to attach and internally, a logical volume is created that extends across these devices (currently these disks must be supplied one at a time). If any other storage than "stateless" is specified and the user is specifying internal disks, only one disk may be supplied, as an LVM is only created on stateless storage.

A single stateless storage device is created at imaging time, but is not initializes until the user calls POST /storage. To see if initialized the (GET)/storage API should be used, with a check of the respose for usage of "stateless" with a null "stateless_type". Users must also specify whether or not they want a filesystem to be created on the storage, or to re-use a prior filesystem. This is used when re-attaching to storage that may have been previously attached to another appliance.

For NAS, iSCSI, etc, where credentials are required,, the user must specify the proper credentials to connect to this storage.

For NAS that has usage = source, a client will be created in order for the user to create and manage jobs using the NAS as a client.

Request

Syntax

POST /api/storage/?sid={sid}
Host: <server host name>
Accept: application/json
AuthToken: <authentication token returned from authenticate>

Parameters

Index Value Type Required
name storage name string always
  • | the name for stateless storage will always be "_Stateless", no user input is required | sid | system id | int | always type | storage type | int | always
  • | internal = 0, never used on storage creation |
  • | iscsi = 1 |
  • | fc = 2 |
  • | nas = 4 |
  • | added_internal = 5 | usage | storage usage | string | always
  • | stateless - special case of internal/primary backups/replicated backups storage |
  • | backup - additional backups/replicated backups storage pool |
  • | archive - storage for archive targets |
  • | source - storage that is a source of data (NAS only) | build_filesystem | an indicator if a filesystem is to be created on the storage | int | optional
  • | required for stateless storage |
  • | 0 = re-init, attach to an existing stateless storage device |
  • | 1 = create a filesystem, but if a filesystem already exists on the device, fail |
  • | 2 = force creation of a filesystem, whether or not on already exist on the device | properties | array of storage properties | array | always is_default| the default storage for backup jobs | boolean | always

iSCSI properties (if type = "iscsi")

Index Value Type Required
hostname IP address or hostname string always
port port on which listening long always
target fully-qualified iSCSI target name string always
lun LUN (logical unit number) long always
username Name of the SAN user string always

NAS Properties (if type = "nas")

Index Value Type Required
hostname IP address or hostname string yes
share_name port on which listening long yes
protocol mounting protocol, "nfs", "cifs", or "cloud" string yes
username NAS username string optional
password Password to the NAS string optional
max_size Size in GB which user wants to use for backup string (required only for usage = "backup") NOT required for other usages

FC Properties (if type = "fc")

Index Value Type Required
wwpn World-wide port number string always
model target card model/vendor string always
lun LUN (logical unit number) long always
vendor appliance vendor name string always
username Name of the SAN user string always

Attached Disk specification (if type is "added internal", 5)

Index Value Type Required
internal_disk disks used by this storage string required
  • | if "stateless" storage, the LVM is expanded across this comma-separated list of devices. |
  • | in release 1, only 1 device may be added at a time and the user |
  • | must use PUT storage to add other disks |

Response

201 success

Examples

Sample Request

POST /api/storage/?sid=1
Host: <server host name>
Accept: application/json
AuthToken: 8a00sjerhterqerjlqkjlk443l4j56869h4f_)(fjdkasHHHHHkdal324
{
     "name": "_Stateless",
     "type": 5,
     "usage": "stateless",
     "build_filesystem": 0,
     "properties": [
               "internal_name": "/dev/sdc"
      ]
}

Sample Response

Successful creation of storage, returns true.

HTTP Status: 201 (Created)

Result Object:

{
   "result": [
       {
           "created": true
       }
   ]
}

Failed storage creation will return HTTP Status 500 with a result object with an error message and KB link.

For cloud storage used for backup copies, the return will be:

HTTP Status: 201 (Created)

Result Object:

{
    "storage": { 
        "created": true, 
        "sets_existing": 3,
        "sets_needing_import": 3,
        "sets_imported": 3 
        }
}

Clone this wiki locally