From 6f7655d3e25f3fa9edd90e64f87e12afc8db1ef0 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Date: Fri, 30 May 2025 17:08:28 +0530 Subject: [PATCH 1/7] Registration template step in ZoneWizard for populating generic templates --- ui/public/locales/en.json | 1 + ui/src/views/infra/zone/ZoneWizard.vue | 30 +- .../views/infra/zone/ZoneWizardLaunchZone.vue | 9 +- .../infra/zone/ZoneWizardRegisterTemplate.vue | 339 ++++++++++++++++++ 4 files changed, 375 insertions(+), 4 deletions(-) create mode 100644 ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index b3d5536e1f15..1e0e47372a49 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -1010,6 +1010,7 @@ "label.filter.annotations.self": "Created by me", "label.filterby": "Filter by", "label.fingerprint": "FingerPrint", +"label.skip": "Skip", "label.finish": "Finish", "label.firewall": "Firewall", "label.firewall.policy": "Firewall Policy", diff --git a/ui/src/views/infra/zone/ZoneWizard.vue b/ui/src/views/infra/zone/ZoneWizard.vue index 9211aed92a50..1e9d1785abeb 100644 --- a/ui/src/views/infra/zone/ZoneWizard.vue +++ b/ui/src/views/infra/zone/ZoneWizard.vue @@ -74,8 +74,10 @@ :prefillContent="zoneConfig" /> + + @@ -95,6 +104,7 @@ import ZoneWizardCoreZoneTypeStep from '@views/infra/zone/ZoneWizardCoreZoneType import ZoneWizardZoneDetailsStep from '@views/infra/zone/ZoneWizardZoneDetailsStep' import ZoneWizardNetworkSetupStep from '@views/infra/zone/ZoneWizardNetworkSetupStep' import ZoneWizardAddResources from '@views/infra/zone/ZoneWizardAddResources' +import ZoneWizardRegisterTemplate from '@views/infra/zone/ZoneWizardRegisterTemplate' import ZoneWizardLaunchZone from '@views/infra/zone/ZoneWizardLaunchZone' export default { @@ -103,6 +113,7 @@ export default { ZoneWizardCoreZoneTypeStep, ZoneWizardZoneDetailsStep, ZoneWizardNetworkSetupStep, + ZoneWizardRegisterTemplate, ZoneWizardAddResources, ZoneWizardLaunchZone }, @@ -114,6 +125,13 @@ export default { launchZone: false, launchData: {}, stepChild: '', + registerTemplateStep: { + name: 'registerTemplate', + title: 'label.register.template', + step: ['registerTemplateAction'], + description: this.$t('message.desc.register.template'), + hint: this.$t('message.hint.register.template') + }, coreZoneTypeStep: { name: 'coreType', title: 'label.core.zone.type', @@ -158,7 +176,8 @@ export default { hint: this.$t('message.launch.zone.hint') } ], - zoneConfig: {} + zoneConfig: {}, + returnedZoneId: null } }, computed: { @@ -167,6 +186,9 @@ export default { if (this.zoneConfig.zoneSuperType !== 'Edge') { steps.splice(1, 0, this.coreZoneTypeStep) } + if (this.zoneConfig.hypervisor === 'KVM') { + steps.splice(steps.length, 0, this.registerTemplateStep) + } return steps } }, @@ -201,6 +223,10 @@ export default { this.zoneConfig.physicalNetworks = null } + if (data.zoneReturned) { + this.returnedZoneId = data.zoneReturned.id + } + this.zoneConfig = { ...this.zoneConfig, ...data } }, onCloseAction () { diff --git a/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue b/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue index 571699a1f312..1f6653e920c5 100644 --- a/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue +++ b/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue @@ -1723,8 +1723,13 @@ export default { await this.$message.success('Success') this.loading = false this.steps = [] - this.$emit('closeAction') - this.$emit('refresh-data') + if (this.prefillContent.hypervisor === 'KVM') { + this.$emit('fieldsChanged', { zoneReturned: { id: this.stepData.zoneReturned.id } }) + this.$emit('nextPressed') + } else { + this.$emit('closeAction') + this.$emit('refresh-data') + } } catch (e) { this.loading = false await this.$notification.error({ diff --git a/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue new file mode 100644 index 000000000000..8ac8d008995b --- /dev/null +++ b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue @@ -0,0 +1,339 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + From ea6d14275e6d05ed44bba7d68e4d2a91df2e353e Mon Sep 17 00:00:00 2001 From: Manoj Kumar Date: Tue, 3 Jun 2025 12:46:31 +0530 Subject: [PATCH 2/7] fix typos --- .../views/infra/zone/ZoneWizardRegisterTemplate.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue index 8ac8d008995b..62fc092348eb 100644 --- a/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue +++ b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue @@ -159,7 +159,7 @@ export default { id: 7, name: 'OpenSUSE 15.5', version: '15.5', - osCategoryName: 'OpneSUSE', + osCategoryName: 'OpenSUSE', arch: 'x86_64', url: 'https://mirror.squ.edu.om/opensuse/opensuse/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2' }, @@ -207,7 +207,7 @@ export default { id: 13, name: 'OpenSUSE 15.5', version: '15.5', - osCategoryName: 'OpneSUSE', + osCategoryName: 'OpenSUSE', arch: 'aarch64', url: 'https://download.opensuse.org/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2' } @@ -248,7 +248,6 @@ export default { const templatesToRegister = this.predefinedTemplates.filter(template => this.selectedRowKeys.includes(template.id) && this.deployedTemplates[template.id] !== true) const registrationResults = [] for (const templateData of templatesToRegister) { - console.log(`Registering template: ${templateData.name} with ID: ${templateData.id}`) const promise = this.registerTemplate(templateData) .then(() => ({ id: templateData.id, @@ -305,9 +304,9 @@ export default { return osTypeId }, getImageFormat (url) { - const extenstion = url.split('.').pop() - var format = extenstion - switch (extenstion) { + const fileExtension = url.split('.').pop() + var format = fileExtension + switch (fileExtension) { case 'img': format = 'RAW' break From 2d3290bd4f78383f5ba43f1a29afe2ebfa591d31 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Date: Fri, 13 Jun 2025 09:43:47 +0530 Subject: [PATCH 3/7] use cloudstack cdn for genric templates --- .../infra/zone/ZoneWizardRegisterTemplate.vue | 107 +++++++++++++----- 1 file changed, 77 insertions(+), 30 deletions(-) diff --git a/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue index 62fc092348eb..72b9da7aef21 100644 --- a/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue +++ b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue @@ -111,108 +111,149 @@ export default { id: 1, name: 'Ubuntu 24.04', version: '24.04', - osCategoryName: 'Ubuntu', + distroName: 'Ubuntu', arch: 'x86_64', - url: 'https://cloud-images.ubuntu.com/releases/noble/release/ubuntu-24.04-server-cloudimg-amd64.img' + filename: 'ubuntu-24.04-server-cloudimg-amd64.img' }, { id: 2, name: 'Ubuntu 22.04', version: '22.04', - osCategoryName: 'Ubuntu', + distroName: 'Ubuntu', arch: 'x86_64', - url: 'https://cloud-images.ubuntu.com/releases/jammy/release/ubuntu-22.04-server-cloudimg-amd64.img' + filename: 'ubuntu-22.04-server-cloudimg-amd64.img' }, { id: 3, name: 'Ubuntu 20.04', version: '20.04', - osCategoryName: 'Ubuntu', + distroName: 'Ubuntu', arch: 'x86_64', - url: 'https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64.img' + filename: 'ubuntu-20.04-server-cloudimg-amd64.img' }, { id: 4, name: 'Debian GNU/Linux 12 (64-bit)', version: '12', - osCategoryName: 'Debian', + distroName: 'Debian', arch: 'x86_64', - url: 'https://laotzu.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2' + filename: 'debian-12-genericcloud-amd64.qcow2' }, { id: 5, - name: 'AlmaLinux 8', + name: 'Rocky Linux 8', version: '8', - osCategoryName: 'CentOS', + distroName: 'Rockylinux', arch: 'x86_64', - url: 'https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2' + filename: 'Rocky-8-GenericCloud.latest.x86_64.qcow2' }, { id: 6, - name: 'AlmaLinux 9', + name: 'Rocky Linux 9', version: '9', - osCategoryName: 'CentOS', + distroName: 'Rockylinux', arch: 'x86_64', - url: 'https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2' + filename: 'Rocky-9-GenericCloud.latest.x86_64.qcow2' }, { id: 7, name: 'OpenSUSE 15.5', version: '15.5', - osCategoryName: 'OpenSUSE', + distroName: 'OpenSUSE', arch: 'x86_64', - url: 'https://mirror.squ.edu.om/opensuse/opensuse/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2' + filename: 'openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2' }, { id: 8, name: 'Ubuntu 24.04', version: '24.04', - osCategoryName: 'Ubuntu', + distroName: 'Ubuntu', arch: 'aarch64', - url: 'https://cloud-images.ubuntu.com/releases/noble/release/ubuntu-24.04-server-cloudimg-arm64.img' + filename: 'ubuntu-24.04-server-cloudimg-arm64.img' }, { id: 9, name: 'Ubuntu 22.04', version: '22.04', - osCategoryName: 'Ubuntu', + distroName: 'Ubuntu', arch: 'aarch64', - url: 'https://cloud-images.ubuntu.com/releases/jammy/release/ubuntu-22.04-server-cloudimg-arm64.img' + filename: 'ubuntu-22.04-server-cloudimg-arm64.img' }, { id: 10, name: 'Ubuntu 20.04', version: '20.04', - osCategoryName: 'Ubuntu', + distroName: 'Ubuntu', arch: 'aarch64', - url: 'https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-arm64.img' + filename: 'ubuntu-20.04-server-cloudimg-arm64.img' }, { id: 11, name: 'Debian GNU/Linux 12 (64-bit)', version: '12', - osCategoryName: 'Debian', + distroName: 'Debian', arch: 'aarch64', - url: 'https://saimei.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-genericcloud-arm64.qcow2' + filename: 'debian-12-genericcloud-arm64.qcow2' }, { id: 12, - name: 'AlmaLinux 9', - version: '9', - osCategoryName: 'CentOS', + name: 'Rocky Linux 8', + version: '8', + distroName: 'Rockylinux', arch: 'aarch64', - url: 'https://repo.almalinux.org/almalinux/9/cloud/aarch64/images/AlmaLinux-9-GenericCloud-latest.aarch64.qcow2' + filename: 'Rocky-8-GenericCloud.latest.aarch64.qcow2' }, { id: 13, + name: 'Rocky Linux 9', + version: '9', + distroName: 'Rockylinux', + arch: 'aarch64', + filename: 'Rocky-9-GenericCloud.latest.aarch64.qcow2' + }, + { + id: 14, name: 'OpenSUSE 15.5', version: '15.5', - osCategoryName: 'OpenSUSE', + distroName: 'OpenSUSE', + arch: 'aarch64', + filename: 'openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2' + }, + { + id: 15, + name: 'Oracle Linux 8', + version: '8.10', + distroName: 'OracleLinux', + arch: 'aarch64', + filename: 'OL8U10_aarch64-kvm-b122.qcow2' + }, + { + id: 16, + name: 'Oracle Linux 8', + version: '8.10', + distroName: 'OracleLinux', + arch: 'x86_64', + filename: 'OL8U10_x86_64-kvm-b258.qcow2' + }, + { + id: 17, + name: 'Oracle Linux 9', + version: '9.5', + distroName: 'OracleLinux', arch: 'aarch64', - url: 'https://download.opensuse.org/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2' + filename: 'OL9U5_aarch64-kvm-b126.qcow2' + }, + { + id: 18, + name: 'Oracle Linux 9', + version: '9.5', + distroName: 'OracleLinux', + arch: 'x86_64', + filename: 'OL9U5_x86_64-kvm-b259.qcow2' } ] this.defaultOsTypeId = await this.fetchOsTypeId('Other Linux (64-bit)') + this.prepareDownloadUrls() }, handleDone () { this.$emit('refresh-data') @@ -317,6 +358,12 @@ export default { format = 'RAW' } return format + }, + prepareDownloadUrls () { + const templatesBaseUrl = 'https://download.cloudstack.org/templates/cloud-images/' + for (const template of this.predefinedTemplates) { + template.url = templatesBaseUrl + template.distroName.toLowerCase() + '/' + template.filename + } } } } From 64b0cc06e7169dbb863dd62a8e48cf7a8f770bb2 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Date: Wed, 18 Jun 2025 22:11:40 +0530 Subject: [PATCH 4/7] move template metadata to json file instead of hardcoding --- ui/public/cloud-image-templates.json | 146 +++++++++++++++ ui/public/locales/en.json | 1 + .../infra/zone/ZoneWizardRegisterTemplate.vue | 173 +++--------------- 3 files changed, 169 insertions(+), 151 deletions(-) create mode 100644 ui/public/cloud-image-templates.json diff --git a/ui/public/cloud-image-templates.json b/ui/public/cloud-image-templates.json new file mode 100644 index 000000000000..6247ab20dde3 --- /dev/null +++ b/ui/public/cloud-image-templates.json @@ -0,0 +1,146 @@ +[ + { + "id": 1, + "name": "Ubuntu 24.04", + "version": "24.04", + "distro": "Ubuntu", + "arch": "x86_64", + "filename": "ubuntu-24.04-server-cloudimg-amd64.img" + }, + { + "id": 2, + "name": "Ubuntu 22.04", + "version": "22.04", + "distro": "Ubuntu", + "arch": "x86_64", + "filename": "ubuntu-22.04-server-cloudimg-amd64.img" + }, + { + "id": 3, + "name": "Ubuntu 20.04", + "version": "20.04", + "distro": "Ubuntu", + "arch": "x86_64", + "filename": "ubuntu-20.04-server-cloudimg-amd64.img" + }, + { + "id": 4, + "name": "Debian GNU/Linux 12 (64-bit)", + "version": "12", + "distro": "Debian", + "arch": "x86_64", + "filename": "debian-12-genericcloud-amd64.qcow2" + }, + { + "id": 5, + "name": "Rocky Linux 8", + "version": "8", + "distro": "Rockylinux", + "arch": "x86_64", + "filename": "Rocky-8-GenericCloud.latest.x86_64.qcow2" + }, + { + "id": 6, + "name": "Rocky Linux 9", + "version": "9", + "distro": "Rockylinux", + "arch": "x86_64", + "filename": "Rocky-9-GenericCloud.latest.x86_64.qcow2" + }, + { + "id": 7, + "name": "OpenSUSE 15.5", + "version": "15.5", + "distro": "OpenSUSE", + "arch": "x86_64", + "filename": "openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2" + }, + { + "id": 8, + "name": "Ubuntu 24.04", + "version": "24.04", + "distro": "Ubuntu", + "arch": "aarch64", + "filename": "ubuntu-24.04-server-cloudimg-arm64.img" + }, + { + "id": 9, + "name": "Ubuntu 22.04", + "version": "22.04", + "distro": "Ubuntu", + "arch": "aarch64", + "filename": "ubuntu-22.04-server-cloudimg-arm64.img" + }, + { + "id": 10, + "name": "Ubuntu 20.04", + "version": "20.04", + "distro": "Ubuntu", + "arch": "aarch64", + "filename": "ubuntu-20.04-server-cloudimg-arm64.img" + }, + { + "id": 11, + "name": "Debian GNU/Linux 12 (64-bit)", + "version": "12", + "distro": "Debian", + "arch": "aarch64", + "filename": "debian-12-genericcloud-arm64.qcow2" + }, + { + "id": 12, + "name": "Rocky Linux 8", + "version": "8", + "distro": "Rockylinux", + "arch": "aarch64", + "filename": "Rocky-8-GenericCloud.latest.aarch64.qcow2" + }, + { + "id": 13, + "name": "Rocky Linux 9", + "version": "9", + "distro": "Rockylinux", + "arch": "aarch64", + "filename": "Rocky-9-GenericCloud.latest.aarch64.qcow2" + }, + { + "id": 14, + "name": "OpenSUSE 15.5", + "version": "15.5", + "distro": "OpenSUSE", + "arch": "aarch64", + "filename": "openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2" + }, + { + "id": 15, + "name": "Oracle Linux 8", + "version": "8.10", + "distro": "OracleLinux", + "arch": "aarch64", + "filename": "OL8U10_aarch64-kvm-b122.qcow2" + }, + { + "id": 16, + "name": "Oracle Linux 8", + "version": "8.10", + "distro": "OracleLinux", + "arch": "x86_64", + "filename": "OL8U10_x86_64-kvm-b258.qcow2" + }, + { + "id": 17, + "name": "Oracle Linux 9", + "version": "9.5", + "distro": "OracleLinux", + "arch": "aarch64", + "filename": "OL9U5_aarch64-kvm-b126.qcow2" + }, + { + "id": 18, + "name": "Oracle Linux 9", + "version": "9.5", + "distro": "OracleLinux", + "arch": "x86_64", + "filename": "OL9U5_x86_64-kvm-b259.qcow2" + } +] diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 1e0e47372a49..61bb45a73e43 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -3057,6 +3057,7 @@ "message.desc.importexportinstancewizard": "By choosing to manage an Instance, CloudStack takes over the orchestration of that Instance. Unmanaging an Instance removes CloudStack ability to manage it. In both cases, the Instance is left running and no changes are done to the VM on the hypervisor.

For KVM, managing a VM is an experimental feature.", "message.desc.importmigratefromvmwarewizard": "By selecting an existing or external VMware Datacenter and an instance to import, CloudStack migrates the selected instance from VMware to KVM on a conversion host using virt-v2v and imports it into a KVM cluster", "message.desc.primary.storage": "Each cluster must contain one or more primary storage servers. We will add the first one now. Primary storage contains the disk volumes for all the Instances running on hosts in the cluster. Use any standards-compliant protocol that is supported by the underlying hypervisor.", +"message.desc.register.template": "Hosted on download.cloudstack.org, these templates can be easily registered directly within CloudStack. Simply click Register Template for the templates you wish to use.", "message.desc.reset.ssh.key.pair": "Please specify a ssh key pair that you would like to add to this Instance.", "message.desc.secondary.storage": "Each zone must have at least one NFS or secondary storage server. We will add the first one now. Secondary storage stores Instance Templates, ISO images, and Instance disk volume Snapshots. This server must be available to all hosts in the zone.

Provide the IP address and exported path.", "message.desc.register.user.data": "Please fill in the following data to register a User data.", diff --git a/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue index 72b9da7aef21..873e39f14477 100644 --- a/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue +++ b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue @@ -17,6 +17,7 @@ @@ -57,6 +76,14 @@ export default { zoneid: { type: String, required: false + }, + arch: { + type: String, + required: false + }, + zoneSuperType: { + type: String, + required: false } }, data: () => ({ @@ -66,7 +93,8 @@ export default { rowKey: 0, selectedRowKeys: [], defaultOsTypeId: null, - deployedTemplates: {} + deployedTemplates: {}, + showAlert: false }), created () { this.initForm() @@ -132,6 +160,9 @@ export default { ostypeid: await this.fetchOsTypeId(templateData.name), zoneid: this.zoneid } + if (this.zoneSuperType === 'Edge') { + params.directdownload = true + } return new Promise((resolve, reject) => { api('registerTemplate', params).then(json => { const result = json.registertemplateresponse.template[0] @@ -144,6 +175,10 @@ export default { }, async stepRegisterTemplates () { const templatesToRegister = this.predefinedTemplates.filter(template => this.selectedRowKeys.includes(template.id) && this.deployedTemplates[template.id] !== true) + if (templatesToRegister.length === 0) { + this.showAlert = true + return + } const registrationResults = [] for (const templateData of templatesToRegister) { const promise = this.registerTemplate(templateData) @@ -223,7 +258,10 @@ export default { if (!response.ok) { throw new Error(`Error fetching predefined templates, status_code: ${response.status}`) } - this.predefinedTemplates = await response.json() + const templates = await response.json() + this.predefinedTemplates = this.arch + ? templates.filter(template => template.arch === this.arch) + : templates } catch (error) { console.error('Error fetching predefined templates:', error) this.predefinedTemplates = [] From 39435e5c96d9c1480cb11a0b2ea62e2671db06f6 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Date: Fri, 4 Jul 2025 13:12:20 +0530 Subject: [PATCH 7/7] use http urls for edgezone as directdownload fails for https --- .../views/infra/zone/ZoneWizardRegisterTemplate.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue index 9221def604b3..28fd4b950478 100644 --- a/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue +++ b/ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue @@ -89,7 +89,7 @@ export default { data: () => ({ columns: null, loading: false, - predefinedTemplates: null, + predefinedTemplates: [], rowKey: 0, selectedRowKeys: [], defaultOsTypeId: null, @@ -262,6 +262,15 @@ export default { this.predefinedTemplates = this.arch ? templates.filter(template => template.arch === this.arch) : templates + + // Replace 'https' with 'http' in all URLs for EdgeZone + if (this.zoneSuperType === 'Edge') { + this.predefinedTemplates.forEach(template => { + if (template.url.startsWith('https://')) { + template.url = template.url.replace('https://', 'http://') + } + }) + } } catch (error) { console.error('Error fetching predefined templates:', error) this.predefinedTemplates = []