Is it possible to update a running volume's size?
Not for now. And it's not on the plan yet.
Update on Nov 2019: It's a high priority feature in the list now.
So can I create a new volume (larger than previous) based on a snapshot?
No, currently you cannot do that as well.
How is it planned to increase a volume size then ? That seems a big limitation
Increase volume size should not be hard to implement with Longhorn. But it will need cooperation from filesystem right now.
It's not high in priority at the moment.
Article about this topic with CSI: https://kubernetes.io/blog/2018/08/02/dynamically-expand-volume-with-csi-and-kubernetes/
this is a big blocker for using longhorn atm, as well as for using rancher2. is it gonna be postponed indefinitely like other rancher features ?
@mariusstaicu We're not pushing back the feature indefinitely. As you see there is a milestone assigned to the feature, that means we're tracking and planning to work on it.
More and more users are asking for this feature, so we've prioritized it from "no milestone" to v0.6.0 this year. But later we've decided to introduce an architecture refactor in v0.6.0, so we have to push some features to v0.7.0 instead.
Hope you can understand. If you have questions regarding other features/issues planning, please let me know as well in the issue.
If we want to expand Longhorn volume by modifying the related PVC, the following requirements should be satisfied:
CSI Volume expansion is beta in this version: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#csi-volume-expansionControllerExpandVolume and NodeExpandVolume should be implemented. And they are introduced in CSI v1.1.0: https://kubernetes-csi.github.io/docs/volume-expansion.htmlCSI external-resizer should be deployed: https://kubernetes-csi.github.io/docs/external-resizer.htmlFor now, A new option can be provided on the Longhorn UI page to directly resize Longhorn volumes.
+1 that this is needed, cant understand how this is not a high priority feature
Due to the short cycle of v0.7.0 release (about a month after v0.6.2), we have no choice but to move this feature along with some other features originally planned for v0.7.0 like #46 to v0.8.0 release instead.
At this moment, the volume expansion feature is at the top of our list, and we will get to it as soon as we can.
Will this improvement help with https://serverfault.com/questions/955293/how-to-increase-disk-size-in-a-stateful-set ? I tried the commands there with longhorn and got "is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize"
Will this improvement help with https://serverfault.com/questions/955293/how-to-increase-disk-size-in-a-stateful-set ? I tried the commands there with longhorn and got "is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize"
As the error mentions, you need to satisfy some conditions if you want to expand the volume by modifying the PVC capacity. Here are the details:
allowVolumeExpansion: true is set in the StorageClassWe should be able to support ext2/3/4 with resize2fs and xfs with xfs_growfs natively.
Validation: PASS
Longhorn UI version: wangsiye/longhorn-ui:2d9d3d9
Steps to test: (1/3)
df -h command (PASS)Expand Volume, set size to 10 GB, and click OK df -h command (PASS)df -h command (PASS)Volume & Volume Details pagesSteps to test: (2/3)
kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn/master/examples/pvc.yamlExpand Volume, A message indicate that The capacity of related PV and PVC will not be updated is found10 GB, and click OKdf -h commandSteps to test: (3/3)
kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn/master/examples/pvc.yamlstorage of the PVC specdf -h inside the pod, and verify volume size changed accordingly.@meldafrawi
Add 2 more steps for the test1 and test3:
Test offline expansion:
Test expansion with revert and backup:
Validation: Partially Failed
Test expansion with revert and backup:
- After reverting to 1st snapshot using
df -hindicates that volume size =Volume size before expansion= 4 GB &Used Percentage = 100%- Can't add more data to volume
@meldafrawi Can you follow this doc to modify the step 9 and re-test it?
Validation: PASSED
Most helpful comment
How is it planned to increase a volume size then ? That seems a big limitation