Skip to content

Commit ac6cef3

Browse files
committed
ui: filter accessible pools on live migration with storage wizard
1 parent 2b3cca6 commit ac6cef3

4 files changed

Lines changed: 29 additions & 2 deletions

File tree

‎ui/src/components/view/InstanceVolumesStoragePoolSelectListView.vue‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<volume-storage-pool-select-form
5555
:resource="selectedVolumeForStoragePoolSelection"
5656
:clusterId="storagePoolsClusterId"
57+
:hostId="hostId"
5758
:autoAssignAllowed="storagePoolsClusterId != null"
5859
:isOpen="!(!selectedVolumeForStoragePoolSelection.id)"
5960
@close-action="closeVolumeStoragePoolSelector()"
@@ -80,6 +81,11 @@ export default {
8081
type: String,
8182
required: false,
8283
default: null
84+
},
85+
hostId: {
86+
type: String,
87+
required: false,
88+
default: null
8389
}
8490
},
8591
data () {

‎ui/src/components/view/StoragePoolSelectView.vue‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ export default {
110110
required: false,
111111
default: null
112112
},
113+
hostId: {
114+
type: String,
115+
required: false,
116+
default: null
117+
},
113118
suitabilityEnabled: {
114119
type: Boolean,
115120
required: false,
@@ -178,6 +183,12 @@ export default {
178183
if (newValue !== oldValue) {
179184
this.page = 1
180185
}
186+
},
187+
hostId () {
188+
if (!this.resource || !this.resource.id) {
189+
return
190+
}
191+
this.reset()
181192
}
182193
},
183194
methods: {
@@ -204,7 +215,9 @@ export default {
204215
page: this.page,
205216
pagesize: this.pageSize
206217
}
207-
if (this.clusterId) {
218+
if (this.hostId) {
219+
params.hostid = this.hostId
220+
} else if (this.clusterId) {
208221
params.clusterid = this.clusterId
209222
}
210223
getAPI('listStoragePools', params).then(response => {

‎ui/src/components/view/VolumeStoragePoolSelectForm.vue‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
ref="selectionView"
2222
:resource="resource"
2323
:clusterId="clusterId"
24+
:hostId="hostId"
2425
:suitabilityEnabled="suitabilityEnabled"
2526
:autoAssignAllowed="autoAssignAllowed"
2627
@select="handleSelect" />
@@ -64,6 +65,11 @@ export default {
6465
required: false,
6566
default: null
6667
},
68+
hostId: {
69+
type: String,
70+
required: false,
71+
default: null
72+
},
6773
suitabilityEnabled: {
6874
type: Boolean,
6975
required: false,

‎ui/src/views/compute/MigrateWizard.vue‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
ref="storagePoolSelection"
125125
:autoAssignAllowed="false"
126126
:resource="resource"
127+
:hostId="selectedHost.id && selectedHost.id !== -1 ? selectedHost.id : null"
127128
@select="handleStoragePoolChange" />
128129
</div>
129130
<instance-volumes-storage-pool-select-list-view
@@ -132,6 +133,7 @@
132133
class="top-spaced"
133134
:resource="resource"
134135
:clusterId="selectedHost.id ? selectedHost.clusterid : null"
136+
:hostId="selectedHost.id && selectedHost.id !== -1 ? selectedHost.id : null"
135137
@select="handleVolumeToPoolChange" />
136138

137139
<a-divider />
@@ -284,7 +286,7 @@ export default {
284286
this.selectedHost = host
285287
this.selectedVolumeForStoragePoolSelection = {}
286288
this.volumeToPoolSelection = []
287-
if (this.migrateWithStorage) {
289+
if (this.migrateWithStorage && this.migrateMode !== 1) {
288290
this.$refs.volumeToPoolSelect.resetSelection()
289291
}
290292
},

0 commit comments

Comments
 (0)