apache / apache/cloudstack

Incorrect Disk usage is reported when using Ceph erasure code pool

Ouverte
#13,718 6 commentaires 0 réactions 1 personne assignée Réclamée par @wido Voir sur GitHub
component:ceph component:managed-storage component:storage status:needs-functional-definition
Langage dominant
Java
Étoiles
3.1k
Forks
1.4k
Merge moyen
6 j 19 h
PR mergées (30 j)
32

Description

### problem

Incorrect Disk usage is reported when a Ceph storage

### versions

ACS 4.22.1
ceph version
ceph version 20.2.2 (0fcffee29411e3a38036764817b6e1afc59741cc) tentacle (stable - RelWithDebInfo)
Ubuntu 24.0.4 kvm host

### The steps to reproduce the bug

CloudStack added support for ceph erasure code pool in the 4.21 release

[github.com/apache/cloudstack/pull/9808](https://github.com/apache/cloudstack/pull/9808)

Steps to reproduce the issue

1. Create a ceph-storage with Erasure code setting

```
ceph osd erasure-code-profile set cloudstack-ec k=2 m=1 crush-failure-domain=host
ceph osd pool create cloudstack-ec 64 erasure cloudstack-ec
ceph osd pool set cloudstack-ec allow_ec_overwrites true
ceph osd pool application enable cloudstack-ec rbd

ceph osd pool create cloudstack-ec-metadata 32 replicated
ceph osd pool set cloudstack-ec-metadata size 3
rbd pool init cloudstack-ec-metadata

```

2. Add the storage pool in cloudstack

```
createStoragePool scope=zone zoneid= hypervisor=KVM \
name=MyCephECCluster provider=DefaultPrimary \
url=rbd://cloudstack:@192.168.55.11/cloudstack-ec-metadata \
details[0].key=dataPool details[0].value=cloudstack-ec \
tags=RBD-EC

```

3. Check the disk usage from ceph side

```

root@ceph1:/home/ubuntu# ceph df
--- RAW STORAGE ---
CLASS SIZE AVAIL USED RAW USED %RAW USED
hdd 150 GiB 150 GiB 200 MiB 200 MiB 0.13
TOTAL 150 GiB 150 GiB 200 MiB 200 MiB 0.13

--- POOLS ---
POOL ID PGS STORED OBJECTS USED %USED MAX AVAIL

cloudstack-ec 3 64 8 KiB 1 12 KiB 0 95 GiB
cloudstack-ec-metadata 4 32 7.9 KiB 3 36 KiB 0 47 GiB

```
4. Check the Disk used size from Cloudstack

Image

5. Deploy a data disk of size lets say 5gb on the ceph storage pool

6. Attach it to a running vm

7. Populate some data on the data disk

dd if=/dev/urandom of=/dev/vdb bs=1M count=2048 status=progress oflag=direct

8. Check the ceph disk usage

```
root@ceph1:/home/ubuntu# ceph df
--- RAW STORAGE ---
CLASS SIZE AVAIL USED RAW USED %RAW USED
hdd 150 GiB 147 GiB 3.2 GiB 3.2 GiB 2.13
TOTAL 150 GiB 147 GiB 3.2 GiB 3.2 GiB 2.13

--- POOLS ---
POOL ID PGS STORED OBJECTS USED %USED MAX AVAIL
.mgr 1 1 577 KiB 2 1.7 MiB 0 46 GiB
cloudstack 2 64 6.8 KiB 3 32 KiB 0 46 GiB
cloudstack-ec 3 64 2.0 GiB 513 3.0 GiB 2.11 93 GiB
cloudstack-ec-metadata 4 32 9.1 KiB 6 62 KiB 0 46 GiB

```

9. Check the cloudstack storage used

Image

Cloudstack is reporting the used size from the replicated metadata pool and not the actual erasure code pool

### What to do about it?

CloudStack should report the correct disk size used from the erasure -code pool and not the replicated metadata stats

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.