kvm/ceph: When create a new RBD image use modern flags/features for the image (#2985)

These additional RBD features allow for faster lookups of how much space a RBD
image is using, but with the exclusive locking we prevent two VMs from writing
to the same RBD image at the same time.

These are the default features used by Ceph for any new RBD image.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
This commit is contained in:
Wido den Hollander 2018-11-12 13:08:54 +01:00 committed by Gabriel Beims Bräscher
parent 375264aaa4
commit 4809fe7cb4

View File

@ -72,7 +72,12 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
private String _manageSnapshotPath;
private String rbdTemplateSnapName = "cloudstack-base-snap";
private int rbdFeatures = (1 << 0); /* Feature 1<<0 means layering in RBD format 2 */
private static final int RBD_FEATURE_LAYERING = 1;
private static final int RBD_FEATURE_EXCLUSIVE_LOCK = 4;
private static final int RBD_FEATURE_OBJECT_MAP = 8;
private static final int RBD_FEATURE_FAST_DIFF = 16;
private static final int RBD_FEATURE_DEEP_FLATTEN = 32;
private int rbdFeatures = RBD_FEATURE_LAYERING + RBD_FEATURE_EXCLUSIVE_LOCK + RBD_FEATURE_OBJECT_MAP + RBD_FEATURE_FAST_DIFF + RBD_FEATURE_DEEP_FLATTEN;
private int rbdOrder = 0; /* Order 0 means 4MB blocks (the default) */
public LibvirtStorageAdaptor(StorageLayer storage) {