shellibm-cloud-infrastructureautomated-deploy

Set specific billing period when ordering Endurance iSCSI storage


I'm currently writing some blue/green deployment scripts to provision VSIs on SoftLayer (aka IBM Bluemix aka IBMCloud), and I need to provision and attach a new iSCSI storage to every green machine, the blue VSI and iSCSI storage being canceled after a successful deploy. I use the ibmcloud command to provision the iSCSI disks, however it doesn't let me choose which billing method to use (Monthly or Hourly) and it uses the monthly billing by default.

Is there a way to specify to use the hourly billing method using the ibmcloud cli? If it's not possible, is it a feature that will be added to the cli? It seems like a critical feature in order to use the ibmcloud cli in automated deployment scripts.


Solution

  • It seems there is no option to change the value of the billing attribute per hour or month with the ibmcloud cli command.

    See with this ibmcloud command the options that you can set.

    ibmcloud sl block volume-options
    

    I suggest you to use slcli instead of ibmcloud cli, you can order block storage endurance hourly with the following slcli command.

    slcli block volume-order --storage-type endurance --size 20 --iops 4 --tier 2 --os-type LINUX --location tor01 --snapshot-size 10 --service-offering storage_as_a_service --billing hourly
    

    To login in, use this slcli command:

    slcli setup
    

    Refence:

    https://softlayer-python.readthedocs.io/en/latest/cli.html