Skip to content

Allow populating generic templates during Zone Deployment #10947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions ui/public/cloud-image-templates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
[
{
"id": 1,
"name": "Ubuntu 24.04",
"arch": "x86_64",
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-24.04-server-cloudimg-amd64.img"
},
{
"id": 2,
"name": "Ubuntu 22.04",
"arch": "x86_64",
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-22.04-server-cloudimg-amd64.img"
},
{
"id": 3,
"name": "Ubuntu 20.04",
"arch": "x86_64",
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-20.04-server-cloudimg-amd64.img"
},
{
"id": 4,
"name": "Debian GNU/Linux 12 (64-bit)",
"arch": "x86_64",
"url": "https://download.cloudstack.org/templates/cloud-images/debian/debian-12-genericcloud-amd64.qcow2"
},
{
"id": 5,
"name": "Rocky Linux 8",
"arch": "x86_64",
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-8-GenericCloud.latest.x86_64.qcow2"
},
{
"id": 6,
"name": "Rocky Linux 9",
"arch": "x86_64",
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-9-GenericCloud.latest.x86_64.qcow2"
},
{
"id": 7,
"name": "OpenSUSE 15.5",
"arch": "x86_64",
"url": "https://download.cloudstack.org/templates/cloud-images/opensuse/openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2"
},
{
"id": 8,
"name": "Ubuntu 24.04",
"arch": "aarch64",
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-24.04-server-cloudimg-arm64.img"
},
{
"id": 9,
"name": "Ubuntu 22.04",
"arch": "aarch64",
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-22.04-server-cloudimg-arm64.img"
},
{
"id": 10,
"name": "Ubuntu 20.04",
"arch": "aarch64",
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-20.04-server-cloudimg-arm64.img"
},
{
"id": 11,
"name": "Debian GNU/Linux 12 (64-bit)",
"arch": "aarch64",
"url": "https://download.cloudstack.org/templates/cloud-images/debian/debian-12-genericcloud-arm64.qcow2"
},
{
"id": 12,
"name": "Rocky Linux 8",
"arch": "aarch64",
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-8-GenericCloud.latest.aarch64.qcow2"
},
{
"id": 13,
"name": "Rocky Linux 9",
"arch": "aarch64",
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-9-GenericCloud.latest.aarch64.qcow2"
},
{
"id": 14,
"name": "OpenSUSE 15.5",
"arch": "aarch64",
"url": "https://download.cloudstack.org/templates/cloud-images/opensuse/openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2"
},
{
"id": 15,
"name": "Oracle Linux 8",
"arch": "aarch64",
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL8U10_aarch64-kvm-b122.qcow2"
},
{
"id": 16,
"name": "Oracle Linux 8",
"arch": "x86_64",
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL8U10_x86_64-kvm-b258.qcow2"
},
{
"id": 17,
"name": "Oracle Linux 9",
"arch": "aarch64",
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL9U5_aarch64-kvm-b126.qcow2"
},
{
"id": 18,
"name": "Oracle Linux 9",
"arch": "x86_64",
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL9U5_x86_64-kvm-b259.qcow2"
}
]
3 changes: 3 additions & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -3056,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.<br><br>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 <strong>Register Template</strong> 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.<br/><br/>Provide the IP address and exported path.",
"message.desc.register.user.data": "Please fill in the following data to register a User data.",
Expand Down Expand Up @@ -3759,6 +3761,7 @@
"message.warn.change.primary.storage.scope": "This feature is tested and supported for the following configurations:<br>KVM - NFS/Ceph - DefaultPrimary<br>VMware - NFS - DefaultPrimary<br>*There might be extra steps involved to make it work for other configurations.",
"message.warn.filetype": "jpg, jpeg, png, bmp and svg are the only supported image formats.",
"message.warn.importing.instance.without.nic": "WARNING: This Instance is being imported without NICs and many Network resources will not be available. Consider creating a NIC via vCenter before importing or as soon as the Instance is imported.",
"message.warn.select.template": "Please select a Template for Registration.",
"message.warn.zone.mtu.update": "Please note that this limit won't affect pre-existing Network’s MTU settings",
"message.webhook.deliveries.time.filter": "Webhook deliveries list can be filtered based on date-time. Select 'Custom' for specifying start and end date range.",
"message.zone.creation.complete": "Zone creation complete.",
Expand Down
40 changes: 37 additions & 3 deletions ui/src/views/infra/zone/ZoneWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@
:prefillContent="zoneConfig"
/>
<zone-wizard-launch-zone
v-else
v-else-if="zoneSteps[currentStep].name === 'launch'"
@backPressed="backPressed"
@nextPressed="nextPressed"
@fieldsChanged="onFieldsChanged"
@closeAction="onCloseAction"
@refresh-data="onRefreshData"
@stepError="onStepError"
Expand All @@ -85,6 +87,15 @@
:isFixError="stepFixError"
:prefillContent="zoneConfig"
/>

<zone-wizard-register-template
v-else-if="zoneSteps[currentStep].name === 'registerTemplate'"
:zoneid="returnedZoneId"
:arch="selectedArch"
:zoneSuperType="selectedZoneSuperType"
@closeAction="onCloseAction"
@refresh-data="onRefreshData"
/>
</div>
</div>
</template>
Expand All @@ -95,6 +106,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 {
Expand All @@ -103,6 +115,7 @@ export default {
ZoneWizardCoreZoneTypeStep,
ZoneWizardZoneDetailsStep,
ZoneWizardNetworkSetupStep,
ZoneWizardRegisterTemplate,
ZoneWizardAddResources,
ZoneWizardLaunchZone
},
Expand All @@ -114,6 +127,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',
Expand Down Expand Up @@ -158,7 +178,10 @@ export default {
hint: this.$t('message.launch.zone.hint')
}
],
zoneConfig: {}
zoneConfig: {},
returnedZoneId: null,
selectedArch: null,
selectedZoneSuperType: 'Core'
}
},
computed: {
Expand All @@ -167,6 +190,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
}
},
Expand Down Expand Up @@ -200,7 +226,15 @@ export default {
data.zoneType !== this.zoneConfig.zoneType) {
this.zoneConfig.physicalNetworks = null
}

if (data.zoneSuperType && data.zoneSuperType !== this.selectedZoneSuperType) {
this.selectedZoneSuperType = data.zoneSuperType
}
if (data.arch && data.arch !== this.selectedArch) {
this.selectedArch = data.arch
}
if (data.zoneReturned?.id) {
this.returnedZoneId = data.zoneReturned.id
}
this.zoneConfig = { ...this.zoneConfig, ...data }
},
onCloseAction () {
Expand Down
9 changes: 7 additions & 2 deletions ui/src/views/infra/zone/ZoneWizardLaunchZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Loading
Loading