Skip to content

Commit b8813c7

Browse files
UI: Add info for 'Use primary storage replication' in snapshot view(s) (#11943)
1 parent 2358632 commit b8813c7

File tree

7 files changed

+38
-8
lines changed

7 files changed

+38
-8
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/snapshot/CopySnapshotCmd.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ public class CopySnapshotCmd extends BaseAsyncCmd implements UserCmd {
9797
"The snapshot will always be made available in the zone in which the volume is present. Currently supported for StorPool only")
9898
protected List<Long> storagePoolIds;
9999

100-
@Parameter (name = ApiConstants.USE_STORAGE_REPLICATION, type=CommandType.BOOLEAN, required = false, since = "4.21.0", description = "This parameter enables the option the snapshot to be copied to supported primary storage")
100+
@Parameter (name = ApiConstants.USE_STORAGE_REPLICATION,
101+
type=CommandType.BOOLEAN,
102+
since = "4.21.0",
103+
description = "Enables the snapshot to be copied to the supported primary storages when the config 'use.storage.replication' is set to true for the storage or globally. " +
104+
"This is supported only for StorPool storage for now.")
101105
protected Boolean useStorageReplication;
102106

103107
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
112112
since = "4.21.0")
113113
protected List<Long> storagePoolIds;
114114

115-
@Parameter (name = ApiConstants.USE_STORAGE_REPLICATION, type=CommandType.BOOLEAN, required = false, description = "This parameter enables the option the snapshot to be copied to supported primary storage")
115+
@Parameter (name = ApiConstants.USE_STORAGE_REPLICATION,
116+
type=CommandType.BOOLEAN,
117+
description = "Enables the snapshot to be copied to the supported primary storages when the config 'use.storage.replication' is set to true for the storage or globally. " +
118+
"This is supported only for StorPool storage for now.")
116119
protected Boolean useStorageReplication;
117120

118121
private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;

api/src/main/java/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ public class CreateSnapshotPolicyCmd extends BaseCmd {
9494
since = "4.21.0")
9595
protected List<Long> storagePoolIds;
9696

97-
@Parameter (name = ApiConstants.USE_STORAGE_REPLICATION, type=CommandType.BOOLEAN, required = false, since = "4.21.0", description = "This parameter enables the option the snapshot to be copied to supported primary storage")
97+
@Parameter (name = ApiConstants.USE_STORAGE_REPLICATION,
98+
type=CommandType.BOOLEAN,
99+
since = "4.21.0",
100+
description = "Enables the snapshot to be copied to the supported primary storages when the config 'use.storage.replication' is set to true for the storage or globally. " +
101+
"This is supported only for StorPool storage for now.")
98102
protected Boolean useStorageReplication;
99103
/////////////////////////////////////////////////////
100104
/////////////////// Accessors ///////////////////////

server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public interface SnapshotManager extends Configurable {
6868
"Whether to show chain size (sum of physical size of snapshot and all its parents) for incremental snapshots in the snapshot response",
6969
true, ConfigKey.Scope.Global, null);
7070

71-
public static final ConfigKey<Boolean> UseStorageReplication = new ConfigKey<Boolean>(Boolean.class, "use.storage.replication", "Snapshots", "false", "For snapshot copy to another primary storage in a different zone. Supports only StorPool storage for now", true, ConfigKey.Scope.StoragePool, null);
71+
ConfigKey<Boolean> UseStorageReplication = new ConfigKey<>(Boolean.class, "use.storage.replication", "Snapshots", "false",
72+
"For snapshot copy to another primary storage in a different zone. This is supported only for StorPool storage for now.",
73+
true, ConfigKey.Scope.StoragePool, null);
7274

7375
void deletePoliciesForVolume(Long volumeId);
7476

ui/src/views/storage/FormSchedule.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@
174174
</a-form-item>
175175
</a-col>
176176
<a-col :md="24" :lg="24" v-if="resourceType === 'Volume'">
177-
<a-form-item :label="$t('label.usestoragereplication')" name="useStorageReplication" ref="useStorageReplication">
177+
<a-form-item name="useStorageReplication" ref="useStorageReplication">
178+
<template #label>
179+
<tooltip-label :title="$t('label.usestoragereplication')" :tooltip="apiParams.usestoragereplication.description" />
180+
</template>
178181
<a-switch v-model:checked="form.useStorageReplication" />
179182
</a-form-item>
180183
<a-form-item v-if="isAdmin && form.useStorageReplication" ref="storageids" name="storageids">
@@ -310,6 +313,9 @@ export default {
310313
storagePools: []
311314
}
312315
},
316+
beforeCreate () {
317+
this.apiParams = this.$getApiParams('createSnapshotPolicy')
318+
},
313319
created () {
314320
this.initForm()
315321
this.volumeId = this.resource.id

ui/src/views/storage/SnapshotZones.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@
137137
</a-select-option>
138138
</a-select>
139139
</a-form-item>
140-
<a-form-item :label="$t('label.usestoragereplication')" name="useStorageReplication" ref="useStorageReplication">
140+
<a-form-item name="useStorageReplication" ref="useStorageReplication">
141+
<template #label>
142+
<tooltip-label :title="$t('label.usestoragereplication')" :tooltip="apiParams.usestoragereplication.description" />
143+
</template>
141144
<a-switch v-model:checked="form.useStorageReplication" />
142145
</a-form-item>
143146
<a-form-item v-if="isAdmin && form.useStorageReplication" ref="storageid" name="storageid" :label="$t('label.storagepools')">
@@ -236,6 +239,7 @@ import { isAdmin } from '@/role'
236239
import OsLogo from '@/components/widgets/OsLogo'
237240
import ResourceIcon from '@/components/view/ResourceIcon'
238241
import TooltipButton from '@/components/widgets/TooltipButton'
242+
import TooltipLabel from '@/components/widgets/TooltipLabel'
239243
import BulkActionProgress from '@/components/view/BulkActionProgress'
240244
import Status from '@/components/widgets/Status'
241245
import eventBus from '@/config/eventBus'
@@ -244,6 +248,7 @@ export default {
244248
name: 'SnapshotZones',
245249
components: {
246250
TooltipButton,
251+
TooltipLabel,
247252
OsLogo,
248253
ResourceIcon,
249254
BulkActionProgress,

ui/src/views/storage/TakeSnapshot.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@
6666
</a-select-option>
6767
</a-select>
6868
</a-form-item>
69-
<a-form-item :label="$t('label.usestoragereplication')" name="useStorageReplication" ref="useStorageReplication">
69+
<a-form-item name="useStorageReplication" ref="useStorageReplication">
70+
<template #label>
71+
<tooltip-label :title="$t('label.usestoragereplication')" :tooltip="apiParams.usestoragereplication.description" />
72+
</template>
7073
<a-switch v-model:checked="form.useStorageReplication" />
7174
</a-form-item>
7275
<a-form-item v-if="isAdmin && form.useStorageReplication" ref="storageids" name="storageids">
@@ -93,7 +96,10 @@
9396
</a-select-option>
9497
</a-select>
9598
</a-form-item>
96-
<a-form-item :label="$t('label.asyncbackup')" name="asyncbackup" ref="asyncbackup" v-if="!supportsStorageSnapshot">
99+
<a-form-item name="asyncbackup" ref="asyncbackup" v-if="!supportsStorageSnapshot">
100+
<template #label>
101+
<tooltip-label :title="$t('label.asyncbackup')" :tooltip="apiParams.asyncbackup.description" />
102+
</template>
97103
<a-switch v-model:checked="form.asyncbackup" />
98104
</a-form-item>
99105
<a-form-item :label="$t('label.quiescevm')" name="quiescevm" ref="quiescevm" v-if="quiescevm && hypervisorSupportsQuiesceVm">

0 commit comments

Comments
 (0)