|  | 
|  | 1 | +--- | 
|  | 2 | +id: diskpool-expansion | 
|  | 3 | +title: DiskPool Expansion | 
|  | 4 | +keywords: | 
|  | 5 | + - DiskPool Expansion | 
|  | 6 | + - Mayastor DiskPool | 
|  | 7 | +description: This guide explains how to configure, monitor, and perform DiskPool expansion. | 
|  | 8 | +--- | 
|  | 9 | + | 
|  | 10 | +# DiskPool Expansion | 
|  | 11 | + | 
|  | 12 | +## Overview | 
|  | 13 | + | 
|  | 14 | +The DiskPool Expansion feature in Replicated PV Mayastor helps prevent storage outages when a pool allocation approaches capacity. By allowing controlled growth of an existing DiskPool, you can avoid replica failures caused by “no space” (ENOSPC) conditions and maintain uninterrupted application operations. | 
|  | 15 | + | 
|  | 16 | +This document describes how to configure, and perform a DiskPool expansion, including the required CR settings, status fields, and supported expansion methods. | 
|  | 17 | + | 
|  | 18 | +:::note | 
|  | 19 | +DiskPools cannot be expanded indefinitely. Each pool has a maximum expansion limit that is defined during creation. Pools created before this feature was introduced may have limited ability to grow. | 
|  | 20 | +::: | 
|  | 21 | + | 
|  | 22 | +## Configuring Maximum Expansion | 
|  | 23 | + | 
|  | 24 | +You can configure the maximum pool size using the `maxExpansion` field in the DiskPool CR. | 
|  | 25 | + | 
|  | 26 | +- **Absolute Size:** Specify a fixed value in MiB, GiB, or TiB (for example: `800GiB`, `3.5TiB`, or `1073741824B`). Binary units must be used to avoid ambiguity. | 
|  | 27 | + | 
|  | 28 | +- **Factor:** Specify a multiplier of the initial capacity (for example: `1x`, `5x`, `20x`). A value of `5x` allows the pool to grow up to five times its initial size. If not specified, the default is `1x`. | 
|  | 29 | + | 
|  | 30 | +**Example: Factor-Based Expansion** | 
|  | 31 | + | 
|  | 32 | +``` | 
|  | 33 | +apiVersion: "openebs.io/v1beta3" | 
|  | 34 | +kind: DiskPool | 
|  | 35 | +metadata: | 
|  | 36 | +  name: <pool-name> | 
|  | 37 | +  namespace: <namespace> | 
|  | 38 | +spec: | 
|  | 39 | +  node: <node-name> | 
|  | 40 | +  disks: ["/dev/disk/by-id/<id>"] | 
|  | 41 | +  maxExpansion: "20x" | 
|  | 42 | +``` | 
|  | 43 | + | 
|  | 44 | +**Example: Absolute Size Expansion** | 
|  | 45 | + | 
|  | 46 | +``` | 
|  | 47 | +apiVersion: "openebs.io/v1beta3" | 
|  | 48 | +kind: DiskPool | 
|  | 49 | +metadata: | 
|  | 50 | +  name: <pool-name> | 
|  | 51 | +  namespace: <namespace> | 
|  | 52 | +spec: | 
|  | 53 | +  node: <node-name> | 
|  | 54 | +  disks: ["/dev/disk/by-id/<id>"] | 
|  | 55 | +  maxExpansion: "6TiB" | 
|  | 56 | +``` | 
|  | 57 | + | 
|  | 58 | +Two new fields are available in the DiskPool CR state to track pool expansion: | 
|  | 59 | + | 
|  | 60 | +- `maxExpandableSize` - The absolute maximum size to which the pool can grow. Expansion beyond this limit fails. This does not affect existing volumes or data but makes any extra capacity unusable. | 
|  | 61 | + | 
|  | 62 | +- `diskCapacity` – The size of the underlying disk. Note that `capacity` represents usable space after metadata reservation. | 
|  | 63 | + | 
|  | 64 | +:::important | 
|  | 65 | +For any pool, the underlying disk can only be expanded up to (`maxExpandableSize - diskCapacity`). If the disk is grown beyond this value, the expansion request fails. | 
|  | 66 | +::: | 
|  | 67 | + | 
|  | 68 | +## Expanding the DiskPool | 
|  | 69 | + | 
|  | 70 | +To expand a pool: | 
|  | 71 | + | 
|  | 72 | +1. Expand the backing disk (must not exceed `maxExpandableSize`). | 
|  | 73 | + | 
|  | 74 | +2. Trigger the Replicated PV Mayastor pool expansion using one of the following methods: | 
|  | 75 | + | 
|  | 76 | +    - Annotate the DSP CR | 
|  | 77 | + | 
|  | 78 | +    Add the annotation `openebs.io/expand: true` to the CR to trigger reconciliation. | 
|  | 79 | + | 
|  | 80 | +    ``` | 
|  | 81 | +    kubectl annotate dsp <name> openebs.io/expand=true -n <ns> | 
|  | 82 | +    ``` | 
|  | 83 | +     | 
|  | 84 | +    The Operator removes the annotation once expansion succeeds or when it encounters an unrecoverable error. | 
|  | 85 | +
 | 
|  | 86 | +    - Use the OpenEBS plugin | 
|  | 87 | +
 | 
|  | 88 | +    Run the command `kubectl openebs mayastor expand pool <pool-id> -n openebs` to invoke the pool expansion API. | 
|  | 89 | +
 | 
|  | 90 | +3. Once successful, both `capacity` and `diskCapacity` values in the CR will reflect the updated size. | 
|  | 91 | +
 | 
|  | 92 | +:::Important | 
|  | 93 | +We recommend using multiple DiskPools instead of over-expanding a single DiskPool (for example, setting `maxExpansion` of 100 GiB to grow up to 50-60 TiB). Increasing the `maxExpansion` value reserves more metadata pages in the pool, which can lengthen pool creation and import times. However, larger pools may be appropriate if the volumes are relatively large. | 
|  | 94 | +::: | 
0 commit comments