Apologies for the empty reply to this I seem to have sent.  I blame my phone :o

This process can be somewhat automated with crushtool’s reclassification 
directives, which can help avoid omissions or typos (/me whistles innocently):

https://docs.ceph.com/en/latest/rados/operations/crush-map-edits/#migrating-from-a-legacy-ssd-rule-to-device-classes




> On Nov 28, 2024, at 2:53 AM, Eugen Block <ebl...@nde.ag> wrote:
> 
> Of course it's possible. You can either change this rule by extracting the 
> crushmap, decompiling it, editing the "take" section, compile it and inject 
> it back into the cluster. Or you simply create a new rule with the class hdd 
> specified and set this new rule for your pools. So the first approach would 
> be:
> 
> 1. ceph osd getcrushmap -o crushmap.bin
> 2. crushtool -d crushmap.bin -o crushmap.txt
> 3. open crushmap.txt with the editor of your choice, replace
> 
>        step take default
> with:
>        step take default class hdd
> 
> and save the file.
> 
> 4. crushtool -c crushmap.txt -o crushmap.new
> 5. test it with crushtool:
> 
> crushtool -i crushmap.new --test --rule 1 --num-rep 5 --show-mappings | less
> crushtool -i crushmap.new --test --rule 1 --num-rep 5 --show-bad-mappings | 
> less
> 
> You shouldn't have bad mappings if everything is okay. Inspect the result of 
> --show-mappings to see if the OSDs match your HDD OSDs.
> 
> 6. ceph osd setcrushmap -i crushmap.new
> 
> ####
> 
> Alternatively, create a new rule if your EC profile(s) already have the 
> correct crush-device-class set. If not, you can create a new one, but keep in 
> mind that you can't change the k and m values for a given pool, so you need 
> to ensure that you use the same k and m values:
> 
> ceph osd erasure-code-profile set ec-profile-k3m2 k=3 m=2 
> crush-failure-domain=host crush-device-class=hdd
> 
> ceph osd crush rule create-erasure rule-ec-k3m2 ec-profile-k3m2
> 
> And here's the result:
> 
> ceph osd crush rule dump rule-ec-k3m2 | grep -A2 take
>            "op": "take",
>            "item": -2,
>            "item_name": "default~hdd"
> 
> Regards,
> Eugen
> 
> Zitat von Rok Jaklič <rjak...@gmail.com>:
> 
>> Hi,
>> 
>> is it possible to set/change following already used rule to only use hdd?
>> {
>>    "rule_id": 1,
>>    "rule_name": "ec32",
>>    "type": 3,
>>    "steps": [
>>        {
>>            "op": "set_chooseleaf_tries",
>>            "num": 5
>>        },
>>        {
>>            "op": "set_choose_tries",
>>            "num": 100
>>        },
>>        {
>>            "op": "take",
>>            "item": -1,
>>            "item_name": "default"
>>        },
>>        {
>>            "op": "chooseleaf_indep",
>>            "num": 0,
>>            "type": "host"
>>        },
>>        {
>>            "op": "emit"
>>        }
>>    ]
>> }
>> 
>> Kind regards,
>> Rok
>> _______________________________________________
>> ceph-users mailing list -- ceph-users@ceph.io
>> To unsubscribe send an email to ceph-users-le...@ceph.io
> 
> 
> _______________________________________________
> ceph-users mailing list -- ceph-users@ceph.io
> To unsubscribe send an email to ceph-users-le...@ceph.io

_______________________________________________
ceph-users mailing list -- ceph-users@ceph.io
To unsubscribe send an email to ceph-users-le...@ceph.io

Reply via email to