Skip to content

Commit 71bad8f

Browse files
UI: Add info for Use primary storage replication in snapshot view(s)
1 parent 2dbc86a commit 71bad8f

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ 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, type=CommandType.BOOLEAN, since = "4.21.0", description = "Enables the snapshot to be copied to the supported primary storages when the config 'use.storage.replication' set to true for the storage or globally. Supports only StorPool storage for now.")
101101
protected Boolean useStorageReplication;
102102

103103
/////////////////////////////////////////////////////

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ 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, type=CommandType.BOOLEAN, description = "Enables the snapshot to be copied to the supported primary storages when the config 'use.storage.replication' set to true for the storage or globally. Supports only StorPool storage for now.")
116116
protected Boolean useStorageReplication;
117117

118118
private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ 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, type=CommandType.BOOLEAN, since = "4.21.0", description = "Enables the snapshot to be copied to the supported primary storages when the config 'use.storage.replication' set to true for the storage or globally. Supports only StorPool storage for now.")
9898
protected Boolean useStorageReplication;
9999
/////////////////////////////////////////////////////
100100
/////////////////// Accessors ///////////////////////

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ 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", "For snapshot copy to another primary storage in a different zone. Supports only StorPool storage for now", true, ConfigKey.Scope.StoragePool, null);
7272

7373
void deletePoliciesForVolume(Long volumeId);
7474

ui/src/views/storage/FormSchedule.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@
170170
</a-form-item>
171171
</a-col>
172172
<a-col :md="24" :lg="24" v-if="resourceType === 'Volume'">
173-
<a-form-item :label="$t('label.usestoragereplication')" name="useStorageReplication" ref="useStorageReplication">
173+
<a-form-item name="useStorageReplication" ref="useStorageReplication">
174+
<template #label>
175+
<tooltip-label :title="$t('label.usestoragereplication')" :tooltip="apiParams.usestoragereplication.description" />
176+
</template>
174177
<a-switch v-model:checked="form.useStorageReplication" />
175178
</a-form-item>
176179
<a-form-item v-if="isAdmin && form.useStorageReplication" ref="storageids" name="storageids">
@@ -306,6 +309,9 @@ export default {
306309
storagePools: []
307310
}
308311
},
312+
beforeCreate () {
313+
this.apiParams = this.$getApiParams('createSnapshotPolicy')
314+
},
309315
created () {
310316
this.initForm()
311317
this.volumeId = this.resource.id

ui/src/views/storage/SnapshotZones.vue

Lines changed: 4 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')">

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)