Shrink a cinder volume

Registered by yangbo

Add support for shrinking a cinder volume. Shrinking a LUN is already supported in many storage vendors (NetApp, EMC, etc).
For example, if a volume was created on a thin LUN in backend, and hasn't consumed all the subscribed space yet, in this case, it should be reasonable and feasible to shrink to a smaller size.

The call would be something like "cinder shrink <volume-id> <new-size>"

Blueprint information

Status:
Complete
Approver:
Sean McGinnis
Priority:
Undefined
Drafter:
yangbo
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Sean McGinnis

Related branches

Sprints

Whiteboard

Will this function may bring the data destroy risk to users ? Like LVM reducing lv size that may destroy data. Or only can shrink the volume size to current actual space ?
PS: You can add Sean McGinnis as the Approver.----------------------wanghao

Aactually no. Shrink only work on those volumes with provisioning type thin . The shrink implementation of storage vendors only reduce the space that not consumed in storage yet.
--------- yangbo

smcginnis - I don't think this makes sense. If it is thin provisioned, than any unconsumed space is already not being consumed on the array. If it was data written to but then deleted, that is all at the SCSI level with TRIM support. Not something that we would want external control pane access to perform. The name is also a little misleading as I originally thought you were looking to do the opposite of extend, which is a very risky operation and would require work across Nova and elsewhere to ensure there is no data at risk of being lost before reducing the size of the volume.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.