]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/erasure-code-profile.service.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / erasure-code-profile.service.ts
1 import { HttpClient } from '@angular/common/http';
2 import { Injectable } from '@angular/core';
3
4 import { Observable } from 'rxjs';
5
6 import { ErasureCodeProfile } from '../models/erasure-code-profile';
7
8 @Injectable({
9 providedIn: 'root'
10 })
11 export class ErasureCodeProfileService {
12 apiPath = 'api/erasure_code_profile';
13
14 formTooltips = {
15 // Copied from /doc/rados/operations/erasure-code.*.rst
16 k: $localize`Each object is split in data-chunks parts, each stored on a different OSD.`,
17
18 m: $localize`Compute coding chunks for each object and store them on different OSDs.
19 The number of coding chunks is also the number of OSDs that can be down without losing data.`,
20
21 plugins: {
22 jerasure: {
23 description: $localize`The jerasure plugin is the most generic and flexible plugin,
24 it is also the default for Ceph erasure coded pools.`,
25 technique: $localize`The more flexible technique is reed_sol_van : it is enough to set k
26 and m. The cauchy_good technique can be faster but you need to chose the packetsize
27 carefully. All of reed_sol_r6_op, liberation, blaum_roth, liber8tion are RAID6 equivalents
28 in the sense that they can only be configured with m=2.`,
29 packetSize: $localize`The encoding will be done on packets of bytes size at a time.
30 Choosing the right packet size is difficult.
31 The jerasure documentation contains extensive information on this topic.`
32 },
33 lrc: {
34 description: $localize`With the jerasure plugin, when an erasure coded object is stored on
35 multiple OSDs, recovering from the loss of one OSD requires reading from all the others.
36 For instance if jerasure is configured with k=8 and m=4, losing one OSD requires reading
37 from the eleven others to repair.
38
39 The lrc erasure code plugin creates local parity chunks to be able to recover using
40 less OSDs. For instance if lrc is configured with k=8, m=4 and l=4, it will create
41 an additional parity chunk for every four OSDs. When a single OSD is lost, it can be
42 recovered with only four OSDs instead of eleven.`,
43 l: $localize`Group the coding and data chunks into sets of size locality. For instance,
44 for k=4 and m=2, when locality=3 two groups of three are created. Each set can
45 be recovered without reading chunks from another set.`,
46 crushLocality: $localize`The type of the crush bucket in which each set of chunks defined
47 by l will be stored. For instance, if it is set to rack, each group of l chunks will be
48 placed in a different rack. It is used to create a CRUSH rule step such as step choose
49 rack. If it is not set, no such grouping is done.`
50 },
51 isa: {
52 description: $localize`The isa plugin encapsulates the ISA library. It only runs on Intel processors.`,
53 technique: $localize`The ISA plugin comes in two Reed Solomon forms.
54 If reed_sol_van is set, it is Vandermonde, if cauchy is set, it is Cauchy.`
55 },
56 shec: {
57 description: $localize`The shec plugin encapsulates the multiple SHEC library.
58 It allows ceph to recover data more efficiently than Reed Solomon codes.`,
59 c: $localize`The number of parity chunks each of which includes each data chunk in its
60 calculation range. The number is used as a durability estimator. For instance, if c=2,
61 2 OSDs can be down without losing data.`
62 },
63 clay: {
64 description: $localize`CLAY (short for coupled-layer) codes are erasure codes designed to
65 bring about significant savings in terms of network bandwidth and disk IO when a failed
66 node/OSD/rack is being repaired.`,
67 d: $localize`Number of OSDs requested to send data during recovery of a single chunk.
68 d needs to be chosen such that k+1 <= d <= k+m-1. The larger the d, the better
69 the savings.`,
70 scalar_mds: $localize`scalar_mds specifies the plugin that is used as a building block
71 in the layered construction. It can be one of jerasure, isa, shec.`,
72 technique: $localize`technique specifies the technique that will be picked
73 within the 'scalar_mds' plugin specified. Supported techniques
74 are 'reed_sol_van', 'reed_sol_r6_op', 'cauchy_orig',
75 'cauchy_good', 'liber8tion' for jerasure, 'reed_sol_van',
76 'cauchy' for isa and 'single', 'multiple' for shec.`
77 }
78 },
79
80 crushRoot: $localize`The name of the crush bucket used for the first step of the CRUSH rule.
81 For instance step take default.`,
82
83 crushFailureDomain: $localize`Ensure that no two chunks are in a bucket with the same failure
84 domain. For instance, if the failure domain is host no two chunks will be stored on the same
85 host. It is used to create a CRUSH rule step such as step chooseleaf host.`,
86
87 crushDeviceClass: $localize`Restrict placement to devices of a specific class
88 (e.g., ssd or hdd), using the crush device class names in the CRUSH map.`,
89
90 directory: $localize`Set the directory name from which the erasure code plugin is loaded.`
91 };
92
93 constructor(private http: HttpClient) {}
94
95 list(): Observable<ErasureCodeProfile[]> {
96 return this.http.get<ErasureCodeProfile[]>(this.apiPath);
97 }
98
99 create(ecp: ErasureCodeProfile) {
100 return this.http.post(this.apiPath, ecp, { observe: 'response' });
101 }
102
103 delete(name: string) {
104 return this.http.delete(`${this.apiPath}/${name}`, { observe: 'response' });
105 }
106
107 getInfo() {
108 return this.http.get(`ui-${this.apiPath}/info`);
109 }
110 }