Skip to content

Commit 8d26cb3

Browse files
Tonitzpptoni.zamparetti
andauthored
Support for migration of system VMs with volumes in the GUI (#13144)
Co-authored-by: toni.zamparetti <toni.zamparetti@scclouds.com.br>
1 parent 6434ff2 commit 8d26cb3

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

ui/src/components/view/InstanceVolumesStoragePoolSelectListView.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ export default {
170170
this.volumes = []
171171
getAPI('listVolumes', {
172172
listAll: true,
173-
virtualmachineid: this.resource.id
173+
virtualmachineid: this.resource.id,
174+
listsystemvms: true
174175
}).then(response => {
175176
var volumes = response.listvolumesresponse.volume
176177
if (volumes && volumes.length > 0) {

ui/src/views/compute/MigrateWizard.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
</a-pagination>
9898

9999
<a-form-item
100-
v-if="isUserVm && hasVolumes"
100+
v-if="hasVolumes"
101101
class="top-spaced">
102102
<template #label>
103103
<tooltip-label :title="$t('label.migrate.with.storage')" :tooltip="$t('message.migrate.with.storage')"/>
@@ -307,7 +307,8 @@ export default {
307307
this.volumes = []
308308
getAPI('listVolumes', {
309309
listAll: true,
310-
virtualmachineid: this.resource.id
310+
virtualmachineid: this.resource.id,
311+
listsystemvms: !this.isUserVm
311312
}).then(response => {
312313
this.volumes = response?.listvolumesresponse?.volume || []
313314
}).finally(() => {
@@ -338,11 +339,11 @@ export default {
338339
submitForm () {
339340
if (this.loading) return
340341
this.loading = true
341-
const migrateApi = this.isUserVm
342-
? this.requiresStorageMigration()
343-
? 'migrateVirtualMachineWithVolume'
344-
: 'migrateVirtualMachine'
345-
: 'migrateSystemVm'
342+
const migrateApi = !this.requiresStorageMigration()
343+
? this.isUserVm
344+
? 'migrateVirtualMachine'
345+
: 'migrateSystemVm'
346+
: 'migrateVirtualMachineWithVolume'
346347
var params = this.selectedHost.id === -1
347348
? { autoselect: true, virtualmachineid: this.resource.id }
348349
: { hostid: this.selectedHost.id, virtualmachineid: this.resource.id }

0 commit comments

Comments
 (0)