To create a volume

You can create a volume that you can then attach to any Virtual Machine whithin the same account, compute zone and availability zone. For create a volume the [json] is required then you have to use the command below:

$  beehive provider volumes add <json file>


  Create volume

    volume:
        container: ResourceProvider01
        name: demo-volume01
        desc: demo-volume01
        compute_zone: ComputeService-44ff4cf3
        availability_zone: SiteVercelli01
        size: 5
        type: openstack
        flavor: vol.default



  optional arguments:
      -h, --help            show this help message and exit
      --debug               toggle debug output
      --quiet               suppress all output
      -o {json}             output handler
      -v, --version         show program's version number and exit
      -k KEY, --key KEY     Secret key file to use for encryption/decryption
      --vault VAULT         Ansible vault password to use for inventory decryption
      -e ENV, --env ENV     Execution environment
      -E ENVS, --envs ENVS  Comma separated execution environments
      -f FRMT, --frmt FRMT  response format
      --color COLOR         response colered. Can be true or false. [default=true]
      --verbose VERBOSITY   ansible verbosity
      --cmds                list available commands
      --notruncate          disable long string truncation
      --truncate TRUNCATE   set max length of long string
      --curl                log curl request
      --fields FIELDS       response fields
      --afields AFIELDS     response additional fields
      -y, --assumeyes       Assume that the answer to any question which would be
                            asked is yes.
      -rt, --runtime        Enable command duration log.

The last step is to create volume using

json

​To create json

The requirements that you need for json are [flavors], [computezones] and [others]. You can generate a json file using this CLI’s command:

[login@cmpto1-cons02 ~]$ more add-volume.json
{
"volume":{
"container": "ResourceProvider01",
"name":"dbs-tst-001-aefd07ad-volume-1",
"desc":"Disco-dati",
"compute_zone": "ComputeService-366929f1",
"availability_zone": "SiteTorino02",
"type":"vsphere",
"flavor": "vol.oracle.default",
"size": 200
}
}
flavors

​To know flavors

The command to know a flavour is:

$  beehive provider volumeflavors list


  List provider items

  optional arguments:
      -h, --help            show this help message and exit
      --debug               toggle debug output
      --quiet               suppress all output
      -o {json}             output handler
      -v, --version         show program's version number and exit
      -k KEY, --key KEY     Secret key file to use for encryption/decryption
      --vault VAULT         Ansible vault password to use for inventory decryption
      -e ENV, --env ENV     Execution environment
      -E ENVS, --envs ENVS  Comma separated execution environments
      -f FRMT, --frmt FRMT  response format
      --color COLOR         response colered. Can be true or false. [default=true]
      --verbose VERBOSITY   ansible verbosity
      --cmds                list available commands
      --notruncate          disable long string truncation
      --truncate TRUNCATE   set max length of long string
      --curl                log curl request
      --fields FIELDS       response fields
      --afields AFIELDS     response additional fields
      -y, --assumeyes       Assume that the answer to any question which would be
                            asked is yes.
      -rt, --runtime        Enable command duration log.
computezones

​To know compute zones

CLI is going to show you the compute zone using the command

$  beehive provider compute-zones list


  List compute-zones

  optional arguments:
      -h, --help            show this help message and exit
      --debug               toggle debug output
      --quiet               suppress all output
      -o {json}             output handler
      -v, --version         show program's version number and exit
      -k KEY, --key KEY     Secret key file to use for encryption/decryption
      --vault VAULT         Ansible vault password to use for inventory decryption
      -e ENV, --env ENV     Execution environment
      -E ENVS, --envs ENVS  Comma separated execution environments
      -f FRMT, --frmt FRMT  response format
      --color COLOR         response colered. Can be true or false. [default=true]
      --verbose VERBOSITY   ansible verbosity
      --cmds                list available commands
      --notruncate          disable long string truncation
      --truncate TRUNCATE   set max length of long string
      --curl                log curl request
      --fields FIELDS       response fields
      --afields AFIELDS     response additional fields
      -y, --assumeyes       Assume that the answer to any question which would be
                            asked is yes.
      -rt, --runtime        Enable command duration log.
others

​To know other information

The las info that you need for create a json are get using the command:

$  beehive provider volumes list


  List volumes

  optional arguments:
      -h, --help            show this help message and exit
      --debug               toggle debug output
      --quiet               suppress all output
      -o {json}             output handler
      -v, --version         show program's version number and exit
      -k KEY, --key KEY     Secret key file to use for encryption/decryption
      --vault VAULT         Ansible vault password to use for inventory decryption
      -e ENV, --env ENV     Execution environment
      -E ENVS, --envs ENVS  Comma separated execution environments
      -f FRMT, --frmt FRMT  response format
      --color COLOR         response colered. Can be true or false. [default=true]
      --verbose VERBOSITY   ansible verbosity
      --cmds                list available commands
      --notruncate          disable long string truncation
      --truncate TRUNCATE   set max length of long string
      --curl                log curl request
      --fields FIELDS       response fields
      --afields AFIELDS     response additional fields
      -y, --assumeyes       Assume that the answer to any question which would be
                            asked is yes.
      -rt, --runtime        Enable command duration log.