From 4809fe7cb434010adc776a0da40cdf37848cc26e Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Mon, 12 Nov 2018 13:08:54 +0100 Subject: [PATCH] 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 --- .../hypervisor/kvm/storage/LibvirtStorageAdaptor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java index 75005406acb..dc8083f0eea 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java @@ -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) {