How to Enable 'Discard/TRIM' in Openstack Instance ?

Problem

  • How do I enable TRIM (Discard) in a OpenStack KVM instance?

Environment

  • Platform9 Managed OpenStack - v5.4 and Higher

Cause

  • The default disk driver for KVM images is virtio. This driver does not supports / implements the fitrim IOCTL. Thus, it is needed to use virtio-scsi, which supports FITRIM.

Resolution

  • Create or modify a glance image adding the virtio-scsi disk bus property:
Javascript
Copy

Or

Javascript
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard