diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json
index 791da76d842..def524e15fb 100644
--- a/ui/src/locales/en.json
+++ b/ui/src/locales/en.json
@@ -2926,6 +2926,7 @@
"message.no.more.hosts.available": "No more hosts are available for migration",
"message.no.network.support": "Your selected hypervisor, vSphere, does not have any additional network features. Please continue to step 5.",
"message.no.network.support.configuration.not.true": "You do not have any zone that has security group enabled. Thus, no additional network features. Please continue to step 5.",
+"message.no.primary.stores": "No primary storage pools available for migration",
"message.no.projects": "You do not have any projects.
Please create a new one from the projects section.",
"message.no.projects.adminonly": "You do not have any projects.
Please ask your administrator to create a new project.",
"message.number.clusters": "
# of Clusters
",
diff --git a/ui/src/views/storage/MigrateVolume.vue b/ui/src/views/storage/MigrateVolume.vue
index 0fae82af693..ad1193a063d 100644
--- a/ui/src/views/storage/MigrateVolume.vue
+++ b/ui/src/views/storage/MigrateVolume.vue
@@ -19,28 +19,32 @@
@@ -68,7 +72,7 @@ export default {
required: true
}
},
- inject: ['parentFetchData', 'parentToggleLoading'],
+ inject: ['parentFetchData'],
data () {
return {
storagePools: [],
@@ -101,6 +105,7 @@ export default {
zoneid: this.resource.zoneid
}).then(response => {
this.storagePools = response.liststoragepoolsresponse.storagepool || []
+ this.storagePools = this.storagePools.filter(pool => { return pool.id !== this.resource.storageid })
if (Array.isArray(this.storagePools) && this.storagePools.length) {
this.selectedStoragePool = this.storagePools[0].id || ''
}
@@ -125,8 +130,10 @@ export default {
this.$parent.$parent.close()
},
submitMigrateVolume () {
- this.closeModal()
- this.parentToggleLoading()
+ if (this.storagePools.length === 0) {
+ this.closeModal()
+ return
+ }
api('migrateVolume', {
livemigrate: this.resource.vmstate === 'Running',
storageid: this.selectedStoragePool,
@@ -138,23 +145,23 @@ export default {
successMessage: this.$t('message.success.migrate.volume'),
successMethod: () => {
this.parentFetchData()
- this.parentToggleLoading()
},
errorMessage: this.$t('message.migrate.volume.failed'),
errorMethod: () => {
this.parentFetchData()
- this.parentToggleLoading()
},
loadingMessage: this.$t('message.migrate.volume.processing'),
catchMessage: this.$t('error.fetching.async.job.result'),
catchMethod: () => {
this.parentFetchData()
- this.parentToggleLoading()
}
})
}).catch(error => {
this.$notifyError(error)
this.closeModal()
+ }).finally(() => {
+ this.closeModal()
+ this.parentFetchData()
})
}
}