From 9ef73553993bcf99d648b09158fa7ad6777c1caf Mon Sep 17 00:00:00 2001 From: DK101010 <57522802+DK101010@users.noreply.github.com> Date: Wed, 29 Sep 2021 06:22:38 +0200 Subject: [PATCH] ui: show datastore cluster option in vmware zone deployment (#5522) Co-authored-by: DK101010 --- .../infra/zone/ZoneWizardAddResources.vue | 8 ++++-- .../views/infra/zone/ZoneWizardLaunchZone.vue | 28 ++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/ui/src/views/infra/zone/ZoneWizardAddResources.vue b/ui/src/views/infra/zone/ZoneWizardAddResources.vue index 04d09536d82..5804676fe9f 100644 --- a/ui/src/views/infra/zone/ZoneWizardAddResources.vue +++ b/ui/src/views/infra/zone/ZoneWizardAddResources.vue @@ -477,7 +477,7 @@ export default { placeHolder: 'message.error.vcenter.datacenter', required: true, display: { - primaryStorageProtocol: 'vmfs' + primaryStorageProtocol: ['vmfs', 'datastorecluster'] } }, { @@ -486,7 +486,7 @@ export default { placeHolder: 'message.error.vcenter.datastore', required: true, display: { - primaryStorageProtocol: 'vmfs' + primaryStorageProtocol: ['vmfs', 'datastorecluster'] } }, { @@ -861,6 +861,10 @@ export default { id: 'vmfs', description: 'vmfs' }) + protocols.push({ + id: 'datastorecluster', + description: 'datastorecluster' + }) } else if (hypervisor === 'Hyperv') { protocols.push({ id: 'SMB', diff --git a/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue b/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue index a245d3dc03b..95c3be7d8cd 100644 --- a/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue +++ b/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue @@ -1338,16 +1338,21 @@ export default { const rbdid = this.prefillContent.primaryStorageRADOSUser?.value || '' const rbdsecret = this.prefillContent.primaryStorageRADOSSecret?.value || '' url = this.rbdURL(rbdmonitor, rbdpool, rbdid, rbdsecret) - } else if (protocol === 'vmfs') { - let path = this.prefillContent.primaryStorageVmfsDatacenter?.value || '' - if (path.substring(0, 1) !== '/') { - path = '/' + path - } - path += '/' + this.prefillContent.primaryStorageVmfsDatastore?.value || '' - url = this.vmfsURL('dummy', path) } else if (protocol === 'Linstor') { url = this.linstorURL(server) params['details[0].resourceGroup'] = this.prefillContent.primaryStorageLinstorResourceGroup.value + } else if (protocol === 'vmfs' || protocol === 'datastorecluster') { + let path = this.prefillContent.primaryStorageVmfsDatacenter.value + if (path.substring(0, 1) !== '/') { + path = '/' + path + } + path += '/' + this.prefillContent.primaryStorageVmfsDatastore.value + if (protocol === 'vmfs') { + url = this.vmfsURL('dummy', path) + } + if (protocol === 'datastorecluster') { + url = this.datastoreclusterURL('dummy', path) + } } else { let iqn = this.prefillContent.primaryStorageTargetIQN?.value || '' if (iqn.substring(0, 1) !== '/') { @@ -2137,6 +2142,15 @@ export default { } return url }, + datastoreclusterURL (server, path) { + var url + if (server.indexOf('://') === -1) { + url = 'datastorecluster://' + server + path + } else { + url = server + path + } + return url + }, iscsiURL (server, iqn, lun) { let url = '' if (server.indexOf('://') === -1) {