This is an automated email from the ASF dual-hosted git repository.
shwstppr pushed a commit to branch 4.22
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.22 by this push:
new a9b2f333d13 ui: filter accessible pools on live migration with storage
wizard (#14064)
a9b2f333d13 is described below
commit a9b2f333d13186adb6ffaf4183eab2134952ce05
Author: Fabricio Duarte <[email protected]>
AuthorDate: Wed Sep 9 07:33:53 2026 -0300
ui: filter accessible pools on live migration with storage wizard (#14064)
The "Migrate instance to another host" wizard lets an operator pick a
destination host and, optionally, a destination
primary storage. Today the storage list is not filtered by the selected
host, so it offers primary storages the host cannot reach. This filters that
list down to the storages actually accessible to the selected host.
---
.../view/InstanceVolumesStoragePoolSelectListView.vue | 6 ++++++
ui/src/components/view/StoragePoolSelectView.vue | 15 ++++++++++++++-
ui/src/components/view/VolumeStoragePoolSelectForm.vue | 6 ++++++
ui/src/views/compute/MigrateWizard.vue | 4 +++-
4 files changed, 29 insertions(+), 2 deletions(-)
diff --git
a/ui/src/components/view/InstanceVolumesStoragePoolSelectListView.vue
b/ui/src/components/view/InstanceVolumesStoragePoolSelectListView.vue
index bac645e3e03..3efbce5c131 100644
--- a/ui/src/components/view/InstanceVolumesStoragePoolSelectListView.vue
+++ b/ui/src/components/view/InstanceVolumesStoragePoolSelectListView.vue
@@ -54,6 +54,7 @@
<volume-storage-pool-select-form
:resource="selectedVolumeForStoragePoolSelection"
:clusterId="storagePoolsClusterId"
+ :hostId="hostId"
:autoAssignAllowed="storagePoolsClusterId != null"
:isOpen="!(!selectedVolumeForStoragePoolSelection.id)"
@close-action="closeVolumeStoragePoolSelector()"
@@ -80,6 +81,11 @@ export default {
type: String,
required: false,
default: null
+ },
+ hostId: {
+ type: String,
+ required: false,
+ default: null
}
},
data () {
diff --git a/ui/src/components/view/StoragePoolSelectView.vue
b/ui/src/components/view/StoragePoolSelectView.vue
index 4dfccfe84e7..24ff50fd3ee 100644
--- a/ui/src/components/view/StoragePoolSelectView.vue
+++ b/ui/src/components/view/StoragePoolSelectView.vue
@@ -110,6 +110,11 @@ export default {
required: false,
default: null
},
+ hostId: {
+ type: String,
+ required: false,
+ default: null
+ },
suitabilityEnabled: {
type: Boolean,
required: false,
@@ -178,6 +183,12 @@ export default {
if (newValue !== oldValue) {
this.page = 1
}
+ },
+ hostId () {
+ if (!this.resource || !this.resource.id) {
+ return
+ }
+ this.reset()
}
},
methods: {
@@ -204,7 +215,9 @@ export default {
page: this.page,
pagesize: this.pageSize
}
- if (this.clusterId) {
+ if (this.hostId) {
+ params.hostid = this.hostId
+ } else if (this.clusterId) {
params.clusterid = this.clusterId
}
getAPI('listStoragePools', params).then(response => {
diff --git a/ui/src/components/view/VolumeStoragePoolSelectForm.vue
b/ui/src/components/view/VolumeStoragePoolSelectForm.vue
index 9981418ee14..ca1ada1c960 100644
--- a/ui/src/components/view/VolumeStoragePoolSelectForm.vue
+++ b/ui/src/components/view/VolumeStoragePoolSelectForm.vue
@@ -21,6 +21,7 @@
ref="selectionView"
:resource="resource"
:clusterId="clusterId"
+ :hostId="hostId"
:suitabilityEnabled="suitabilityEnabled"
:autoAssignAllowed="autoAssignAllowed"
@select="handleSelect" />
@@ -64,6 +65,11 @@ export default {
required: false,
default: null
},
+ hostId: {
+ type: String,
+ required: false,
+ default: null
+ },
suitabilityEnabled: {
type: Boolean,
required: false,
diff --git a/ui/src/views/compute/MigrateWizard.vue
b/ui/src/views/compute/MigrateWizard.vue
index a3ad92a2d30..0e8c08d320f 100644
--- a/ui/src/views/compute/MigrateWizard.vue
+++ b/ui/src/views/compute/MigrateWizard.vue
@@ -124,6 +124,7 @@
ref="storagePoolSelection"
:autoAssignAllowed="false"
:resource="resource"
+ :hostId="selectedHost.id && selectedHost.id !== -1 ? selectedHost.id :
null"
@select="handleStoragePoolChange" />
</div>
<instance-volumes-storage-pool-select-list-view
@@ -132,6 +133,7 @@
class="top-spaced"
:resource="resource"
:clusterId="selectedHost.id ? selectedHost.clusterid : null"
+ :hostId="selectedHost.id && selectedHost.id !== -1 ? selectedHost.id :
null"
@select="handleVolumeToPoolChange" />
<a-divider />
@@ -284,7 +286,7 @@ export default {
this.selectedHost = host
this.selectedVolumeForStoragePoolSelection = {}
this.volumeToPoolSelection = []
- if (this.migrateWithStorage) {
+ if (this.migrateWithStorage && this.migrateMode !== 1) {
this.$refs.volumeToPoolSelect.resetSelection()
}
},