Skip to content

Commit 4809fe7

Browse files
widoGabrielBrascher
authored andcommitted
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>
1 parent 375264a commit 4809fe7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
7272
private String _manageSnapshotPath;
7373

7474
private String rbdTemplateSnapName = "cloudstack-base-snap";
75-
private int rbdFeatures = (1 << 0); /* Feature 1<<0 means layering in RBD format 2 */
75+
private static final int RBD_FEATURE_LAYERING = 1;
76+
private static final int RBD_FEATURE_EXCLUSIVE_LOCK = 4;
77+
private static final int RBD_FEATURE_OBJECT_MAP = 8;
78+
private static final int RBD_FEATURE_FAST_DIFF = 16;
79+
private static final int RBD_FEATURE_DEEP_FLATTEN = 32;
80+
private int rbdFeatures = RBD_FEATURE_LAYERING + RBD_FEATURE_EXCLUSIVE_LOCK + RBD_FEATURE_OBJECT_MAP + RBD_FEATURE_FAST_DIFF + RBD_FEATURE_DEEP_FLATTEN;
7681
private int rbdOrder = 0; /* Order 0 means 4MB blocks (the default) */
7782

7883
public LibvirtStorageAdaptor(StorageLayer storage) {

0 commit comments

Comments
 (0)