Skip to content

Commit

Permalink
Explain the Native Disk Update
Browse files Browse the repository at this point in the history
  • Loading branch information
s4heid committed Sep 10, 2024
1 parent cf5e5ec commit b2a5caf
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 2 deletions.
1 change: 1 addition & 0 deletions content/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ using the new key and migrate data onto the new disk.
| --------------------------------- | ------------------------------ |
| Multi-CPI | Supported, [v61][aws_cpi_v61]+ |
| Native Disk Resize | Supported, [v89][aws_cpi_v89]+ |
| Native Disk Update | Not Supported |
| Generic VM Resource Configuration | Supported, [v56][aws_cpi_v56]+ |

[aws_cpi_v61]: https://github.com/cloudfoundry/bosh-aws-cpi-release/releases/tag/v61
Expand Down
11 changes: 9 additions & 2 deletions content/azure-cpi.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,21 +326,28 @@ instance_groups:
---
## Disk Types {: #disk-pools }

* **name** [String, required]: Name of the disk type.
* **disk_size** [Integer, required]: Size of the disk in MiB. On Azure the disk size must be greater than 1 * 1024 and less than the max disk size for [unmanaged](https://azure.microsoft.com/en-us/pricing/details/storage/unmanaged-disks/) or [managed](https://azure.microsoft.com/en-us/pricing/details/managed-disks/) disk. Please always use `N * 1024` as the size because Azure always uses GiB not MiB.

Schema for `cloud_properties` section:

* **caching** [String, optional]: Type of the disk caching. It can be either `None`, `ReadOnly` or `ReadWrite`. Default is `None`.
* **storage\_account\_type** [String, optional]: Storage account type. Valid only when `use_managed_disks` is `true`. It can be either `Standard_LRS`, `Premium_LRS` or `PremiumV2_LRS`. You can click [**HERE**](http://azure.microsoft.com/en-us/pricing/details/storage/) to learn more about the type of Azure storage account. For `PremiumV2_LRS`, you have to set caching to `None` since `PremiumV2_LRS` does currently not support caching.
* **disk_size** [Integer, required]: Size of the disk in MiB. On Azure the disk size must be greater than 1 * 1024 and less than the max disk size for [unmanaged](https://azure.microsoft.com/en-us/pricing/details/storage/unmanaged-disks/) or [managed](https://azure.microsoft.com/en-us/pricing/details/managed-disks/) disk. Please always use `N * 1024` as the size because Azure always uses GiB not MiB.
* **iops** [Integer, optional]: IOPS of the disk. If you need more IOPS than the baseline offers, you can increase the IOPS of the disks. For more details, see [Premium SSD v2 performance](https://learn.microsoft.com/azure/virtual-machines/disks-types#premium-ssd-v2-performance). Only supported for `PremiumV2_LRS`
* **mbps** [Integer, optional]: Throughput in MB/s of the disk. If you need more throughput than the baseline offers, you can increase the throughput of the disks. For more details, see [Premium SSD v2 performance](https://learn.microsoft.com/azure/virtual-machines/disks-types#premium-ssd-v2-performance). Only supported for `PremiumV2_LRS`

Example of 10GB disk:
Example of a 10GB Standard LRS disk:

```yaml
disk_types:
- name: default
disk_size: 10_240
cloud_properties:
storage_account_type: Standard_LRS
```

To modify the `cloud_properties` such as `storage_account_type`, `iops`, and `mbps` of a disk without the necessity to create a new one and transfer the data, you can utilize the [Native Disk Update Feature](./cpi-api-v2-method/update-disk.md).

---
## Global Configuration {: #global }

Expand Down
2 changes: 2 additions & 0 deletions content/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ transparently handles re-encryption of data.
| --------------------------------- | -------------------------------- |
| Multi-CPI | Not Supported |
| Native Disk Resize | Supported, [v39][azure_cpi_v39]+ |
| Native Disk Update | Supported, [v50][azure_cpi_v50]+ |
| Generic VM Resource Configuration | Supported, [v33][azure_cpi_v33]+ |

[azure_cpi_v33]: https://github.com/cloudfoundry/bosh-azure-cpi-release/releases/tag/v33
[azure_cpi_v39]: https://github.com/cloudfoundry/bosh-azure-cpi-release/releases/tag/v39.0.0
[azure_cpi_v50]: https://github.com/cloudfoundry/bosh-azure-cpi-release/releases/tag/v50.0.0
1 change: 1 addition & 0 deletions content/cpi-api-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ An example error response to [`create_vm`](cpi-api-v2-method/create-vm.md) might
* [create_disk](cpi-api-v2-method/create-disk.md)
* [delete_disk](cpi-api-v2-method/delete-disk.md)
* [resize_disk](cpi-api-v2-method/resize-disk.md)
* [update_disk](cpi-api-v2-method/update-disk.md)
* [has_disk](cpi-api-v2-method/has-disk.md)
* [attach_disk](cpi-api-v2-method/attach-disk.md)
* [detach_disk](cpi-api-v2-method/detach-disk.md)
Expand Down
36 changes: 36 additions & 0 deletions content/cpi-api-v2-method/update-disk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# update_disk

Update the disk using IaaS-native methods, ensuring it's detached from all VMs first. Activate this feature with the following director configuration:

```yaml
director:
enable_cpi_update_disk: true
```
Updating disk properties directly via the IaaS, such as changing the disk type or specific disk settings without needing to create a completely new disk, offers significant benefits in minimizing downtime. This approach is very effective for deployments with multiple large disks, as it bypasses the time-consuming task of disk creation and data transfer.
Should the native disk update operation encounter limitations, indicated by a `Bosh::Clouds::NotSupported` error, due to either the infrastructure's inability to process the request or if the method is not implemented, the Director will default to generating a new disk and migrating the data.

!!! note
Before enabling this feature, ensure that the `director.enable_cpi_resize_disk` property is disabled, as the Director gives priority to the `resize_disk` method due to its broader implementation across CPIs. However, it's worth noting that the `update_disk` method not only matches the capabilities of `resize_disk` but also offers the additional functionality of updating cloud properties.

## Arguments

* `disk_cid` [String]: Cloud ID of the disk to update; returned from `create_disk`.
* `new_size` [Integer]: New disk size in MiB.
* `cloud_properties` [Hash]: New cloud properties for the disk. The properties are specific to the IaaS and are opaque to the Director. The Director does not validate the properties and passes them to the CPI as-is.

## Result

No return value

## Examples

### Implementations

* [cloudfoundry/bosh-azure-cpi-release](https://github.com/cloudfoundry/bosh-azure-cpi-release/blob/fc16e6f65b0533f83052812dc0d6c1edefc9ac28/src/bosh_azure_cpi/lib/cloud/azure/cloud.rb#L482)

## Related

* [resize_disk](resize-disk.md)
* [create_disk](create-disk.md)
1 change: 1 addition & 0 deletions content/google.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ The CPI does not support multiple NICs being attached to a VM.
| --------------------------------- | ------------------------------------- |
| Multi-CPI | Not Supported |
| Native Disk Resize | Not Supported |
| Native Disk Update | Not Supported |
| Generic VM Resource Configuration | Supported, [v27.0.0][google_cpi_v27]+ |

[google_cpi_v27]: https://github.com/cloudfoundry/bosh-google-cpi-release/releases/tag/v27.0.0
1 change: 1 addition & 0 deletions content/openstack.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ The CPI supports multiple NICs being attached to a single VM.
| --------------------------------- | ------------------------------------ |
| Multi-CPI | Supported, [v31][openstack_cpi_v31]+ |
| Native Disk Resize | Supported, [v33][openstack_cpi_v33]+ |
| Native Disk Update | Not Supported |
| Generic VM Resource Configuration | Supported, [v31][openstack_cpi_v31]+ |

[openstack_cpi_v31]: https://github.com/cloudfoundry/bosh-openstack-cpi-release/releases/tag/v31
Expand Down
1 change: 1 addition & 0 deletions content/vsphere.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ vCenter, no additional configuration is required for the CPI.
| ------------------ | ---------------------------------- |
| Multi-CPI | Supported, [v34][vsphere_cpi_v34]+ |
| Native Disk Resize | Not Supported |
| Native Disk Update | Not Supported |

[vsphere_cpi_v34]: https://github.com/cloudfoundry/bosh-vsphere-cpi-release/releases/tag/v34
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ pages:
- info: cpi-api-v2-method/info.md
- reboot_vm: cpi-api-v2-method/reboot-vm.md
- resize_disk: cpi-api-v2-method/resize-disk.md
- update_disk: cpi-api-v2-method/update-disk.md
- set_disk_metadata: cpi-api-v2-method/set-disk-metadata.md
- set_vm_metadata: cpi-api-v2-method/set-vm-metadata.md
- snapshot_disk: cpi-api-v2-method/snapshot-disk.md
Expand Down

0 comments on commit b2a5caf

Please sign in to comment.