How to manage storage pools

See also: Storage pool

This document shows how to work with storage pools.

Contents:

Create a storage pool

First, check if your provider supports any storage configuration attributes. For example, in the case of AWS, the ebs storage provider supports several configuration attributes, and among these are volume-type, which configures the volume type (i.e. magnetic, ssd, or provisioned-iops), and iops, which indicates the IOPS per GiB.

See more: Storage provider > ebs, Wikipedia | IOPS

Second, use the create-storage-pool command, passing as parameters the desired name of the pool and the name of the provider and then all the key-value pairs that you want to specify. For example, the code below creates a storage pool with the name iops which is a version of ebs with 30 IOPS.

juju create-storage-pool iops ebs volume-type=provisioned-iops iops=30

See more: juju create-storage-pool

To create a storage pool, on a connected Model object, use the create_storage_pool() method, passing the name of the pool and the provider type. For example:

await my_model.create_storage_pool("test-pool", "lxd")

See more: create_storage_pool(), Model (module)

View the available storage pools

To view the available storage pools, use the storage-pools command:

juju storage-pools

This will list all the predefined storage pools as well as any custom ones that may have been created with the juju create-storage-pool command.

The name given to a default storage pool will often be the same as the name of the storage provider upon which it is based.


Expand to view a sample output for a newly-added `aws` model
Name     Provider  Attributes
ebs      ebs
ebs-ssd  ebs       volume-type=ssd
loop     loop
rootfs   rootfs
tmpfs    tmpfs

See more: juju storage-pools

To view the available storage pools, on a connected Model object, use the list_storage_pools() method. For example:

await my_model.list_storage_pools()

See more: list_storage_pools(), Model (module)

View the default storage pool

To find out the default storage pool for your block-type / filesystem-type, run the model-config command followed by the storage-default-block-source / storage-default-filesystem-source key. For example:

juju model-config storage-default-block-source

See more: juju model-config, List of model configuration keys > storage-default-block-source, List of model configuration keys > storage-default-filesystem-source

The python-libjuju client does not currently support this. Please use the juju client.

Update a storage pool

(TO BE ADDED)

To update storage pool attributes, use the update-storage-pool command:

juju update-storage-pool test-pool

Expand to view a sample usage
# Update the storage-pool named iops with new configuration details:
juju update-storage-pool operator-storage volume-type=provisioned-iops iops=40

# Update which provider the pool is for:
juju update-storage-pool lxd-storage type=lxd-zfs

See more: `juju update-storage-pool

To update an existing storage pool attributes, on a connected Model object, use the update_storage_pool() method, passing the name of the storage and the attribute values to update. For example:

await my_model.update_storage_pool(
    "operator-storage", 
    attributes={"volume-type":"provisioned-iops", "iops"="40"})

See more: update_storage_pool(), Model (module)

Remove a storage pool

(TO BE ADDED)

To remove an existing storage pool, use the remove-storage-pool command:

juju remove-storage-pool test-pool

See more: juju remove-storage-pool

To remove a storage pool, on a connected Model object, use the remove_storage_pool() method, passing the name of the storage. For example:

await my_model.remove_storage_pool("test-pool")

See more: remove_storage_pool(), Model (module)


Contributors: @cderici, @tmihoc

Last updated 15 days ago. Help improve this document in the forum.