]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/blob
63f9522a6bb4557dcd48cdbe56ac62fd11ea5e69
[ceph-ci.git] /
1
2 <cds-modal size="lg"
3            [open]="open"
4            [hasScrollingContent]="true"
5            (overlaySelected)="closeModal()">
6   <cds-modal-header (closeSelect)="closeModal()">
7     <h3 cdsModalHeaderHeading
8         i18n>Set up Multi-site Replication</h3>
9   </cds-modal-header>
10
11   <div cdsModalContent>
12     <div cdsRow>
13       <div cdsCol
14            [columnNumbers]="{'lg': 2, 'md': 2, 'sm': 2}"
15            class="indicator-wrapper">
16         <cd-wizard [stepsTitle]="stepTitles"></cd-wizard>
17       </div>
18
19       <div cdsCol
20            [columnNumbers]="{'lg': 14, 'md': 14, 'sm': 14}">
21         <form [formGroup]="multisiteSetupForm"
22               #formDir="ngForm"
23               novalidate>
24           <ng-container [ngSwitch]="currentStep?.stepIndex">
25             <div *ngSwitchCase="0"
26                  class="ms-5">
27               <cd-alert-panel type="info"
28                               spacingClass="mb-3">
29                   This wizard enables you to set up multi-site replication within your
30                   Ceph environment.If you have already added another cluster to your
31                   multi-cluster setup, you can select that cluster in the wizard to
32                   automate the replication process.If no additional cluster is currently
33                   added, the wizard will guide you through creating the necessary realm,
34                   zonegroup, and zone, and provide a realm token.This token can be used
35                   later to manually import into a desired cluster to establish replication
36                   between the clusters.
37               </cd-alert-panel>
38               <div class="form-group row">
39                 <label class="cd-col-form-label required"
40                        for="realmName"
41                        i18n>Realm Name</label>
42                 <div class="cd-col-form-input">
43                   <input class="form-control"
44                          type="text"
45                          placeholder="Realm name..."
46                          id="realmName"
47                          name="realmName"
48                          formControlName="realmName">
49                   <cd-help-text>
50                     <span i18n>Enter a unique name for the Realm. The Realm is a logical grouping of all your Zonegroups.</span>
51                   </cd-help-text>
52                   <span class="invalid-feedback"
53                         *ngIf="multisiteSetupForm.showError('realmName', formDir, 'required')"
54                         i18n>This field is required.</span>
55                   <span class="invalid-feedback"
56                         *ngIf="multisiteSetupForm.showError('realmName', formDir, 'uniqueName')"
57                         i18n>The chosen realm name is already in use.</span>
58                 </div>
59               </div>
60               <div class="form-group row">
61                 <label class="cd-col-form-label required"
62                        for="zonegroupName"
63                        i18n>Zone Group Name</label>
64                 <div class="cd-col-form-input">
65                   <input class="form-control"
66                          type="text"
67                          placeholder="Zone group name..."
68                          id="zonegroupName"
69                          name="zonegroupName"
70                          formControlName="zonegroupName">
71                   <cd-help-text>
72                     <span i18n>Enter a name for the Zonegroup. Zonegroup will help you identify and manage the group of zones.</span>
73                   </cd-help-text>
74                   <span class="invalid-feedback"
75                         *ngIf="multisiteSetupForm.showError('zonegroupName', formDir, 'required')"
76                         i18n>This field is required.</span>
77                   <span class="invalid-feedback"
78                         *ngIf="multisiteSetupForm.showError('zonegroupName', formDir, 'uniqueName')"
79                         i18n>The chosen zone group name is already in use.</span>
80                 </div>
81               </div>
82               <div class="form-group row">
83                 <label class="cd-col-form-label required"
84                        for="zonegroup_endpoints"
85                        i18n>Zonegroup Endpoints</label>
86                 <div class="cd-col-form-input">
87                   <cd-select-badges id="zonegroup_endpoints"
88                                     [data]="rgwEndpoints.value"
89                                     [options]="rgwEndpoints.options"
90                                     [customBadges]="true">
91                   </cd-select-badges>
92                   <cd-help-text>
93                     <span i18n>Select the endpoints for the Zonegroup. Endpoints are the URLs or IP addresses from which the rgw gateways in that zonegroup can be accessed. You can select multiple endpoints in case you have multiple rgw gateways in a zonegroup</span>
94                   </cd-help-text>
95                 </div>
96               </div>
97             </div>
98             <div *ngSwitchCase="1"
99                  class="ms-5">
100               <div class="form-group row">
101                 <label class="cd-col-form-label required"
102                        for="zonegroupName"
103                        i18n>Zone Name</label>
104                 <div class="cd-col-form-input">
105                   <input class="form-control"
106                          type="text"
107                          placeholder="Zone name..."
108                          id="zoneName"
109                          name="zoneName"
110                          formControlName="zoneName">
111                   <cd-help-text>
112                     <span i18n>Enter a unique name for the Zone. A Zone represents a distinct data center or geographical location within a Zonegroup.</span>
113                   </cd-help-text>
114                   <span class="invalid-feedback"
115                         *ngIf="multisiteSetupForm.showError('zoneName', formDir, 'required')"
116                         i18n>This field is required.</span>
117                   <span class="invalid-feedback"
118                         *ngIf="multisiteSetupForm.showError('zoneName', formDir, 'uniqueName')"
119                         i18n>The chosen zone name is already in use.</span>
120                 </div>
121               </div>
122               <div class="form-group row">
123                 <label class="cd-col-form-label required"
124                        for="zone_endpoints"
125                        i18n>Zone Endpoints</label>
126                 <div class="cd-col-form-input">
127                   <cd-select-badges id="zone_endpoints"
128                                     [data]="rgwEndpoints.value"
129                                     [options]="rgwEndpoints.options"
130                                     [customBadges]="true">
131                   </cd-select-badges>
132                   <cd-help-text>
133                     <span i18n>Select the endpoints for the Zone. Endpoints are the URLs or IP addresses from which the rgw gateways in that zone can be accessed. You can select multiple endpoints in case you have multiple rgw gateways in a zone</span>
134                   </cd-help-text>
135                 </div>
136               </div>
137               <div class="form-group row">
138                 <label class="cd-col-form-label required"
139                        for="username"
140                        i18n>Username</label>
141                 <div class="cd-col-form-input">
142                   <input class="form-control"
143                          type="text"
144                          placeholder="Username..."
145                          id="username"
146                          name="username"
147                          formControlName="username"
148                          ngbTooltip="White spaces at the beginning and end will be trimmed"
149                          i18n-ngbTooltip
150                          cdTrim>
151                   <cd-help-text>
152                     <span i18n>Specify the username for the system user.</span>
153                   </cd-help-text>
154                   <cd-alert-panel type="info"
155                                   [showTitle]="false">
156                     <span i18n>This user will be created automatically as part of the process, and it will have the necessary permissions to manage and synchronize resources across zones.</span>
157                   </cd-alert-panel>
158                   <span class="invalid-feedback"
159                         *ngIf="multisiteSetupForm.showError('username', formDir, 'required')"
160                         i18n>This field is required.</span>
161                   <span class="invalid-feedback"
162                         *ngIf="multisiteSetupForm.showError('username', formDir, 'notUnique')"
163                         i18n>The username already exists.</span>
164                 </div>
165               </div>
166             </div>
167             <div cass="ms-5"
168                  *ngSwitchCase="2">
169               <div *ngIf="isMultiClusterConfigured; else nonMultiClusterTemplate">
170                 <div class="form-group row">
171                   <label class="cd-col-form-label required"
172                          for="cluster"
173                          i18n>Replication Cluster</label>
174                   <div class="cd-col-form-input">
175                     <select class="form-select"
176                             id="cluster"
177                             [(ngModel)]="selectedCluster"
178                             formControlName="cluster"
179                             name="cluster">
180                       <option *ngFor="let cluster_detail of clusterDetailsArray"
181                               [value]="cluster_detail.name">
182                         {{ cluster_detail.cluster_alias }} - {{ cluster_detail.name }}
183                       </option>
184                     </select>
185                     <cd-help-text>
186                       <span i18n>Choose the cluster where you want to apply this multisite configuration. The selected cluster will integrate the defined Realm, Zonegroup, and Zones, enabling data synchronization and management across the multisite setup.</span>
187                     </cd-help-text>
188                     <cd-alert-panel type="info"
189                                     [showTitle]="false">
190                       <span i18n>Before submitting this form, please verify that the selected cluster has an active RGW (Rados Gateway) service running.</span>
191                     </cd-alert-panel>
192                   </div>
193                 </div>
194                 <div class="form-group row">
195                   <label class="cd-col-form-label required"
196                          for="zonegroupName"
197                          i18n>Replication Zone Name</label>
198                   <div class="cd-col-form-input">
199                     <input class="form-control"
200                            type="text"
201                            placeholder="Zone name..."
202                            id="replicationZoneName"
203                            name="replicationZoneName"
204                            formControlName="replicationZoneName">
205                     <cd-help-text>
206                       <span i18n>Replication zone represents the zone to be created in the replication cluster where your data will be replicated.</span>
207                     </cd-help-text>
208                     <span class="invalid-feedback"
209                           *ngIf="multisiteSetupForm.showError('replicationZoneName', formDir, 'required')"
210                           i18n>This field is required.</span>
211                   </div>
212                 </div>
213               </div>
214             </div>
215             <div *ngSwitchCase="3"
216                  class="ms-5">
217               <div *ngIf="isMultiClusterConfigured">
218                 <ng-container *ngIf="!loading; else loadingTemplate">
219                   <ng-container *ngIf="!setupCompleted; else progressCompleteTemplate">
220                     <ng-container *ngTemplateOutlet="reviewTemplate"></ng-container>
221                   </ng-container>
222                 </ng-container>
223               </div>
224             </div>
225           </ng-container>
226         </form>
227       </div>
228     </div>
229   </div>
230   <cds-modal-footer>
231     <button cdsButton="secondary"
232             name="skip-cluster-selection"
233             aria-label="Skip"
234             (click)="onSkip()"
235             *ngIf="stepTitles[currentStep.stepIndex]['label'] === 'Select Cluster'"
236             i18n>Skip</button>
237     <button cdsButton="secondary"
238             (click)="onPreviousStep()"
239             [attr.aria-label]="showCancelButtonLabel()"
240             [disabled]="loading"
241             i18n>{{ showCancelButtonLabel() }}</button>
242     <button cdsButton="primary"
243             (click)="onNextStep()"
244             aria-label="Next"
245             [disabled]="loading"
246             i18n>{{ showSubmitButtonLabel() }}
247       <cds-loading [isActive]="loading"
248                    [overlay]="false"
249                    size="sm"
250                    *ngIf="loading"></cds-loading>
251     </button>
252   </cds-modal-footer>
253 </cds-modal>
254
255 <ng-template #nonMultiClusterTemplate>
256   <ng-container *ngIf="!loading; else loadingTemplate">
257     <ng-container *ngIf="!setupCompleted else exportTokenTemplate">
258       <ng-container *ngTemplateOutlet="reviewTemplate"></ng-container>
259     </ng-container>
260   </ng-container>
261 </ng-template>
262
263 <ng-template #loadingTemplate>
264   <ng-container *ngTemplateOutlet="progressTemplate"></ng-container>
265 </ng-template>
266
267 <ng-template #progressCompleteTemplate>
268   <div *ngIf="isMultiClusterConfigured && !stepsToSkip['Select Cluster']; else exportTokenTemplate">
269     <div class="text-center text-success"
270          i18n>
271       Multi-site replication setup is complete.
272     </div>
273   </div>
274 </ng-template>
275
276 <ng-template #progressTemplate>
277   <cd-progress [value]="executingTask?.progress"
278                [description]="executingTask?.name?.replace('progress/Multisite-Setup:', '')">
279   </cd-progress>
280 </ng-template>
281
282 <ng-template #exportTokenTemplate>
283   <div *ngFor="let realminfo of realms">
284     <div class="form-group row">
285       <label class="cd-col-form-label"
286              for="realmName"
287              i18n>Realm Name</label>
288       <div class="cd-col-form-input">
289         <input id="realmName"
290                name="realmName"
291                type="text"
292                [value]="realminfo.realm"
293                readonly>
294         <cd-help-text>
295           <span i18n>Name of the realm that will be involved in replication.</span>
296         </cd-help-text>
297       </div>
298     </div>
299     <div class="form-group row">
300       <label class="cd-col-form-label"
301              for="token"
302              i18n>Token</label>
303       <div class="cd-col-form-input">
304         <input id="realmToken"
305                name="realmToken"
306                type="text"
307                [value]="realminfo.token"
308                class="me-2 mb-4"
309                readonly>
310         <cd-copy-2-clipboard-button [source]="realminfo.token"
311                                     [byId]="false">
312         </cd-copy-2-clipboard-button>
313         <cd-help-text>
314           <span i18n>This field displays the token needed to import the multisite configuration into a secondary cluster. Copy this token securely and use it on the secondary cluster to replicate the current multisite setup. Ensure that the token is handled securely to prevent unauthorized access.</span>
315         </cd-help-text>
316       </div>
317     </div>
318     <hr *ngIf="realms.length > 1">
319   </div>
320 </ng-template>
321
322 <ng-template #reviewTemplate>
323   <div class="form-group row">
324     <label class="cd-col-form-label"
325            i18n>Realm Name:</label>
326     <div class="cd-col-form-input mt-2 text-muted">
327       <b>{{ multisiteSetupForm.get('realmName').value }}</b>
328     </div>
329   </div>
330   <div class="form-group row">
331     <label class="cd-col-form-label"
332            i18n>Zonegroup Name:</label>
333     <div class="cd-col-form-input mt-2 text-muted">
334       <b>{{ multisiteSetupForm.get('zonegroupName').value }}</b>
335     </div>
336   </div>
337   <div class="form-group row">
338     <label class="cd-col-form-label"
339            i18n>Zonegroup Endpoints:</label>
340     <div class="cd-col-form-input mt-2 text-muted">
341       <b>{{ rgwEndpoints.value.join(', ') }}</b>
342     </div>
343   </div>
344   <div class="form-group row">
345     <label class="cd-col-form-label"
346            i18n>Zone Name:</label>
347     <div class="cd-col-form-input mt-2 text-muted">
348       <b>{{ multisiteSetupForm.get('zoneName').value }}</b>
349     </div>
350   </div>
351   <div class="form-group row">
352     <label class="cd-col-form-label"
353            i18n>Zone Endpoints:</label>
354     <div class="cd-col-form-input mt-2 text-muted">
355       <b>{{ rgwEndpoints.value.join(', ') }}</b>
356     </div>
357   </div>
358   <div class="form-group row">
359     <label class="cd-col-form-label"
360            i18n>Username:</label>
361     <div class="cd-col-form-input mt-2 text-muted">
362       <b>{{ multisiteSetupForm.get('username').value }}</b>
363     </div>
364   </div>
365   <div *ngIf="isMultiClusterConfigured && !stepsToSkip['Select Cluster']">
366     <div class="form-group row">
367       <label class="cd-col-form-label"
368              i18n>Selected Replication Cluster:</label>
369       <div class="cd-col-form-input mt-2 text-muted">
370         <b>{{ selectedCluster }}</b>
371       </div>
372     </div>
373     <div class="form-group row">
374       <label class="cd-col-form-label"
375              i18n>Replication Zone Name:</label>
376       <div class="cd-col-form-input mt-2 text-muted">
377         <b>{{ multisiteSetupForm.get('replicationZoneName').value }}</b>
378       </div>
379     </div>
380   </div>
381 </ng-template>