Custom disk sizes
Custom disk sizes will be available in version two of the module.
Version 2 of this module adds a configurable option for custom disk size.
If you are upgrading from v1 and wish to add this option to your existing installation, check "Re-sync configurable options on save" in the 'Other' tab of Edit Product.
The custom disk sizes configurable option provides the means for a customer to order a VM with a system disk that is greater than the default provided in the chosen disk template.
Use the default disk size
If left as zero, the module provisions the default disk space specified by the disk template.
Use the custom disk size
When a customer provides a non-zero amount for the configurable option, the system disk for the VM will have its size set to this amount.
Note that its minimum size is that of the corresponding disk template. Its maximum size is that of the smallest value of the global maximum disk size and the organization's maximum disk size.
Validation
The size will be validated for a minimum size compatible with the chosen disk template.
For example, if you're using a Rocky Linux template which has a minimum system disk size of 50GB, the user will need to select a minimum of 50.
A customer has not configured sufficient storage for the chosen disk template in this example.
Setting pricing
You can set the price per GB in the Configurable Options for "Custom Disk Size (GB)".
Opt out of using custom disk sizes
If you do not wish to use this option, mark it as hidden and leave the pricing as 0.
UX options
To display the UX as a slider instead of numeric input, set a maximum value for the configurable option.
If you're only using disk templates which all have a minimum of 50GB, you can set the minimum value for the configurable option to 50, and the user will avoid running into any validation errors.
price-per-gb
cannot be changed. Price per GB
after the |
is the friendly display name shown to your customers, and may be customised.
For a Quantity option type, configure the "one time" pricing. Here we show an example of £0.15 per GB.
Using predefined options instead of a quantity selector
You can opt to give customers a predefined selection of disk sizes, as shown.
Here, the default of 50GB carries a £0 value and is the default for the product's base price of £15.
Here, the customer has chosen not to change the default 50 GB disk and so will be charged £15.
Here, the customer has chosen to increase the disk to 250 GB and so will be charged £20.