File tree Expand file tree Collapse file tree
api/src/main/java/org/apache/cloudstack/api
server/src/main/java/com/cloud/api/query Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -339,6 +339,7 @@ public class ApiConstants {
339339 public static final String SNAPSHOT_POLICY_ID = "snapshotpolicyid" ;
340340 public static final String SNAPSHOT_TYPE = "snapshottype" ;
341341 public static final String SNAPSHOT_QUIESCEVM = "quiescevm" ;
342+ public static final String SUPPORTS_STORAGE_SNAPSHOT = "supportsstoragesnapshot" ;
342343 public static final String SOURCE_ZONE_ID = "sourcezoneid" ;
343344 public static final String START_DATE = "startdate" ;
344345 public static final String START_ID = "startid" ;
Original file line number Diff line number Diff line change @@ -248,8 +248,12 @@ public class VolumeResponse extends BaseResponseWithTagInformation implements Co
248248 @ Param (description = "need quiesce vm or not when taking snapshot" , since = "4.3" )
249249 private boolean needQuiescevm ;
250250
251+ @ SerializedName (ApiConstants .SUPPORTS_STORAGE_SNAPSHOT )
252+ @ Param (description = "true if storage snapshot is supported for the volume, false otherwise" , since = "4.16" )
253+ private boolean supportsStorageSnapshot ;
254+
251255 @ SerializedName (ApiConstants .PHYSICAL_SIZE )
252- @ Param (description = "the bytes alloaated " )
256+ @ Param (description = "the bytes allocated " )
253257 private Long physicalsize ;
254258
255259 @ SerializedName (ApiConstants .VIRTUAL_SIZE )
@@ -538,6 +542,14 @@ public boolean isNeedQuiescevm() {
538542 return this .needQuiescevm ;
539543 }
540544
545+ public void setSupportsStorageSnapshot (boolean supportsStorageSnapshot ) {
546+ this .supportsStorageSnapshot = supportsStorageSnapshot ;
547+ }
548+
549+ public boolean getSupportsStorageSnapshot () {
550+ return this .supportsStorageSnapshot ;
551+ }
552+
541553 public String getIsoId () {
542554 return isoId ;
543555 }
Original file line number Diff line number Diff line change @@ -1901,6 +1901,9 @@ public ListResponse<VolumeResponse> searchForVolumes(ListVolumesCmd cmd) {
19011901 if (caps != null ) {
19021902 boolean quiescevm = Boolean .parseBoolean (caps .get (DataStoreCapabilities .VOLUME_SNAPSHOT_QUIESCEVM .toString ()));
19031903 vr .setNeedQuiescevm (quiescevm );
1904+
1905+ boolean supportsStorageSnapshot = Boolean .parseBoolean (caps .get (DataStoreCapabilities .STORAGE_SYSTEM_SNAPSHOT .toString ()));
1906+ vr .setSupportsStorageSnapshot (supportsStorageSnapshot );
19041907 }
19051908 }
19061909 response .setResponses (volumeResponses , result .second ());
Original file line number Diff line number Diff line change 6464 </span >
6565 <a-switch v-decorator =" ['quiescevm', { initialValue: false }]" />
6666 </a-form-item >
67- <a-form-item >
67+ <a-form-item v-if = " !supportsStorageSnapshot " >
6868 <span slot =" label" :title =" apiParams.asyncbackup.description" >
6969 {{ $t('label.asyncbackup') }}
7070 <a-tooltip >
@@ -97,6 +97,7 @@ export default {
9797 return {
9898 loading: false ,
9999 isQuiesceVm: false ,
100+ supportsStorageSnapshot: false ,
100101 listVolumes: []
101102 }
102103 },
@@ -131,7 +132,10 @@ export default {
131132 const params = {}
132133 params .volumeid = values .volumeid
133134 params .name = values .name
134- params .asyncbackup = values .asyncbackup
135+ params .asyncbackup = false
136+ if (values .asyncbackup ) {
137+ params .asyncbackup = values .asyncbackup
138+ }
135139 params .quiescevm = values .quiescevm
136140
137141 const title = this .$t (' label.action.vmstoragesnapshot.create' )
@@ -176,6 +180,7 @@ export default {
176180 const volumeFilter = this .listVolumes .filter (volume => volume .id === volumeId)
177181 if (volumeFilter && volumeFilter .length > 0 ) {
178182 this .isQuiesceVm = volumeFilter[0 ].quiescevm
183+ this .supportsStorageSnapshot = volumeFilter[0 ].supportsstoragesnapshot
179184 }
180185 },
181186 closeAction () {
Original file line number Diff line number Diff line change 3434 :placeholder =" apiParams.name.description" />
3535 </a-form-item >
3636 </a-col >
37- <a-col :md =" 24" :lg =" 24" >
37+ <a-col :md =" 24" :lg =" 24" v-if = " !supportsStorageSnapshot " >
3838 <a-form-item :label =" $t('label.asyncbackup')" >
3939 <a-switch v-decorator =" ['asyncbackup']" />
4040 </a-form-item >
@@ -113,6 +113,7 @@ export default {
113113 return {
114114 actionLoading: false ,
115115 quiescevm: false ,
116+ supportsStorageSnapshot: false ,
116117 inputValue: ' ' ,
117118 inputKey: ' ' ,
118119 inputVisible: ' ' ,
@@ -130,6 +131,7 @@ export default {
130131 },
131132 mounted () {
132133 this .quiescevm = this .resource .quiescevm
134+ this .supportsStorageSnapshot = this .resource .supportsstoragesnapshot
133135 },
134136 methods: {
135137 handleSubmit (e ) {
You can’t perform that action at this time.
0 commit comments