Skip to content

Commit 57126b7

Browse files
keep quiescevm for supported hypervisors (VMware, KVM) in ui
1 parent 9675df5 commit 57126b7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

ui/src/config/section/compute.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,13 @@ export default {
184184
label: 'label.action.vmsnapshot.create',
185185
docHelp: 'adminguide/virtual_machines.html#virtual-machine-snapshots',
186186
dataView: true,
187-
args: ['virtualmachineid', 'name', 'description', 'snapshotmemory', 'quiescevm'],
187+
args: (record, store) => {
188+
var args = ['virtualmachineid', 'name', 'description', 'snapshotmemory']
189+
if (['KVM', 'VMware'].includes(record.hypervisor)) {
190+
args.push('quiescevm')
191+
}
192+
return args
193+
},
188194
show: (record) => {
189195
return ((['Running'].includes(record.state) && record.hypervisor !== 'LXC') ||
190196
(['Stopped'].includes(record.state) && ((record.hypervisor !== 'KVM' && record.hypervisor !== 'LXC') ||

ui/src/views/compute/CreateSnapshotWizard.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
v-model:value="form.name"
5656
:placeholder="apiParams.name.description"/>
5757
</a-form-item>
58-
<a-form-item name="quiescevm" ref="quiescevm" v-if="isQuiesceVm">
58+
<a-form-item name="quiescevm" ref="quiescevm" v-if="isQuiesceVm && hypervisorSupportsQuiesceVm">
5959
<template #label>
6060
<tooltip-label :title="$t('label.quiescevm')" :tooltip="apiParams.quiescevm.description"/>
6161
</template>
@@ -98,6 +98,7 @@ export default {
9898
return {
9999
loading: false,
100100
isQuiesceVm: false,
101+
hypervisorSupportsQuiesceVm: false,
101102
supportsStorageSnapshot: false,
102103
listVolumes: []
103104
}
@@ -119,6 +120,9 @@ export default {
119120
},
120121
fetchData () {
121122
this.loading = true
123+
if (['KVM', 'VMware'].includes(this.resource.hypervisor)) {
124+
this.hypervisorSupportsQuiesceVm = true
125+
}
122126
123127
api('listVolumes', { virtualMachineId: this.resource.id, listall: true })
124128
.then(json => {

ui/src/views/storage/TakeSnapshot.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<a-form-item :label="$t('label.asyncbackup')" name="asyncbackup" ref="asyncbackup" v-if="!supportsStorageSnapshot">
7070
<a-switch v-model:checked="form.asyncbackup" />
7171
</a-form-item>
72-
<a-form-item :label="$t('label.quiescevm')" name="quiescevm" ref="quiescevm" v-if="quiescevm">
72+
<a-form-item :label="$t('label.quiescevm')" name="quiescevm" ref="quiescevm" v-if="quiescevm && hypervisorSupportsQuiesceVm">
7373
<a-switch v-model:checked="form.quiescevm" />
7474
</a-form-item>
7575
<a-divider/>
@@ -152,6 +152,7 @@ export default {
152152
return {
153153
actionLoading: false,
154154
quiescevm: false,
155+
hypervisorSupportsQuiesceVm: false,
155156
supportsStorageSnapshot: false,
156157
inputValue: '',
157158
inputKey: '',
@@ -168,6 +169,10 @@ export default {
168169
created () {
169170
this.initForm()
170171
this.quiescevm = this.resource.quiescevm
172+
if (['KVM', 'VMware'].includes(this.resource.hypervisor)) {
173+
this.hypervisorSupportsQuiesceVm = true
174+
}
175+
171176
this.supportsStorageSnapshot = this.resource.supportsstoragesnapshot
172177
this.fetchZoneData()
173178
},

0 commit comments

Comments
 (0)