Skip to content

Commit 65d3592

Browse files
authored
Allow populating generic templates during Zone Deployment (#10947)
1 parent 53eb2c5 commit 65d3592

File tree

5 files changed

+455
-5
lines changed

5 files changed

+455
-5
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
[
2+
{
3+
"id": 1,
4+
"name": "Ubuntu 24.04",
5+
"arch": "x86_64",
6+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-24.04-server-cloudimg-amd64.img"
7+
},
8+
{
9+
"id": 2,
10+
"name": "Ubuntu 22.04",
11+
"arch": "x86_64",
12+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-22.04-server-cloudimg-amd64.img"
13+
},
14+
{
15+
"id": 3,
16+
"name": "Ubuntu 20.04",
17+
"arch": "x86_64",
18+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-20.04-server-cloudimg-amd64.img"
19+
},
20+
{
21+
"id": 4,
22+
"name": "Debian GNU/Linux 12 (64-bit)",
23+
"arch": "x86_64",
24+
"url": "https://download.cloudstack.org/templates/cloud-images/debian/debian-12-genericcloud-amd64.qcow2"
25+
},
26+
{
27+
"id": 5,
28+
"name": "Rocky Linux 8",
29+
"arch": "x86_64",
30+
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-8-GenericCloud.latest.x86_64.qcow2"
31+
},
32+
{
33+
"id": 6,
34+
"name": "Rocky Linux 9",
35+
"arch": "x86_64",
36+
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-9-GenericCloud.latest.x86_64.qcow2"
37+
},
38+
{
39+
"id": 7,
40+
"name": "OpenSUSE 15.5",
41+
"arch": "x86_64",
42+
"url": "https://download.cloudstack.org/templates/cloud-images/opensuse/openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2"
43+
},
44+
{
45+
"id": 8,
46+
"name": "Ubuntu 24.04",
47+
"arch": "aarch64",
48+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-24.04-server-cloudimg-arm64.img"
49+
},
50+
{
51+
"id": 9,
52+
"name": "Ubuntu 22.04",
53+
"arch": "aarch64",
54+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-22.04-server-cloudimg-arm64.img"
55+
},
56+
{
57+
"id": 10,
58+
"name": "Ubuntu 20.04",
59+
"arch": "aarch64",
60+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-20.04-server-cloudimg-arm64.img"
61+
},
62+
{
63+
"id": 11,
64+
"name": "Debian GNU/Linux 12 (64-bit)",
65+
"arch": "aarch64",
66+
"url": "https://download.cloudstack.org/templates/cloud-images/debian/debian-12-genericcloud-arm64.qcow2"
67+
},
68+
{
69+
"id": 12,
70+
"name": "Rocky Linux 8",
71+
"arch": "aarch64",
72+
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-8-GenericCloud.latest.aarch64.qcow2"
73+
},
74+
{
75+
"id": 13,
76+
"name": "Rocky Linux 9",
77+
"arch": "aarch64",
78+
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-9-GenericCloud.latest.aarch64.qcow2"
79+
},
80+
{
81+
"id": 14,
82+
"name": "OpenSUSE 15.5",
83+
"arch": "aarch64",
84+
"url": "https://download.cloudstack.org/templates/cloud-images/opensuse/openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2"
85+
},
86+
{
87+
"id": 15,
88+
"name": "Oracle Linux 8",
89+
"arch": "aarch64",
90+
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL8U10_aarch64-kvm-b122.qcow2"
91+
},
92+
{
93+
"id": 16,
94+
"name": "Oracle Linux 8",
95+
"arch": "x86_64",
96+
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL8U10_x86_64-kvm-b258.qcow2"
97+
},
98+
{
99+
"id": 17,
100+
"name": "Oracle Linux 9",
101+
"arch": "aarch64",
102+
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL9U5_aarch64-kvm-b126.qcow2"
103+
},
104+
{
105+
"id": 18,
106+
"name": "Oracle Linux 9",
107+
"arch": "x86_64",
108+
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL9U5_x86_64-kvm-b259.qcow2"
109+
}
110+
]

ui/public/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,7 @@
10231023
"label.filter.annotations.self": "Created by me",
10241024
"label.filterby": "Filter by",
10251025
"label.fingerprint": "FingerPrint",
1026+
"label.skip": "Skip",
10261027
"label.finish": "Finish",
10271028
"label.firewall": "Firewall",
10281029
"label.firewall.policy": "Firewall Policy",
@@ -3100,6 +3101,7 @@
31003101
"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.",
31013102
"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",
31023103
"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.",
3104+
"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.",
31033105
"message.desc.reset.ssh.key.pair": "Please specify a ssh key pair that you would like to add to this Instance.",
31043106
"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.",
31053107
"message.desc.register.user.data": "Please fill in the following data to register a User data.",
@@ -3810,6 +3812,7 @@
38103812
"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.",
38113813
"message.warn.filetype": "jpg, jpeg, png, bmp and svg are the only supported image formats.",
38123814
"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.",
3815+
"message.warn.select.template": "Please select a Template for Registration.",
38133816
"message.warn.zone.mtu.update": "Please note that this limit won't affect pre-existing Network’s MTU settings",
38143817
"message.webhook.deliveries.time.filter": "Webhook deliveries list can be filtered based on date-time. Select 'Custom' for specifying start and end date range.",
38153818
"message.zone.creation.complete": "Zone creation complete.",

ui/src/views/infra/zone/ZoneWizard.vue

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@
7474
:prefillContent="zoneConfig"
7575
/>
7676
<zone-wizard-launch-zone
77-
v-else
77+
v-else-if="zoneSteps[currentStep].name === 'launch'"
7878
@backPressed="backPressed"
79+
@nextPressed="nextPressed"
80+
@fieldsChanged="onFieldsChanged"
7981
@closeAction="onCloseAction"
8082
@refresh-data="onRefreshData"
8183
@stepError="onStepError"
@@ -85,6 +87,15 @@
8587
:isFixError="stepFixError"
8688
:prefillContent="zoneConfig"
8789
/>
90+
91+
<zone-wizard-register-template
92+
v-else-if="zoneSteps[currentStep].name === 'registerTemplate'"
93+
:zoneid="returnedZoneId"
94+
:arch="selectedArch"
95+
:zoneSuperType="selectedZoneSuperType"
96+
@closeAction="onCloseAction"
97+
@refresh-data="onRefreshData"
98+
/>
8899
</div>
89100
</div>
90101
</template>
@@ -95,6 +106,7 @@ import ZoneWizardCoreZoneTypeStep from '@views/infra/zone/ZoneWizardCoreZoneType
95106
import ZoneWizardZoneDetailsStep from '@views/infra/zone/ZoneWizardZoneDetailsStep'
96107
import ZoneWizardNetworkSetupStep from '@views/infra/zone/ZoneWizardNetworkSetupStep'
97108
import ZoneWizardAddResources from '@views/infra/zone/ZoneWizardAddResources'
109+
import ZoneWizardRegisterTemplate from '@views/infra/zone/ZoneWizardRegisterTemplate'
98110
import ZoneWizardLaunchZone from '@views/infra/zone/ZoneWizardLaunchZone'
99111

100112
export default {
@@ -103,6 +115,7 @@ export default {
103115
ZoneWizardCoreZoneTypeStep,
104116
ZoneWizardZoneDetailsStep,
105117
ZoneWizardNetworkSetupStep,
118+
ZoneWizardRegisterTemplate,
106119
ZoneWizardAddResources,
107120
ZoneWizardLaunchZone
108121
},
@@ -114,6 +127,13 @@ export default {
114127
launchZone: false,
115128
launchData: {},
116129
stepChild: '',
130+
registerTemplateStep: {
131+
name: 'registerTemplate',
132+
title: 'label.register.template',
133+
step: ['registerTemplateAction'],
134+
description: this.$t('message.desc.register.template'),
135+
hint: this.$t('message.hint.register.template')
136+
},
117137
coreZoneTypeStep: {
118138
name: 'coreType',
119139
title: 'label.core.zone.type',
@@ -158,7 +178,10 @@ export default {
158178
hint: this.$t('message.launch.zone.hint')
159179
}
160180
],
161-
zoneConfig: {}
181+
zoneConfig: {},
182+
returnedZoneId: null,
183+
selectedArch: null,
184+
selectedZoneSuperType: 'Core'
162185
}
163186
},
164187
computed: {
@@ -167,6 +190,9 @@ export default {
167190
if (this.zoneConfig.zoneSuperType !== 'Edge') {
168191
steps.splice(1, 0, this.coreZoneTypeStep)
169192
}
193+
if (this.zoneConfig.hypervisor === 'KVM') {
194+
steps.splice(steps.length, 0, this.registerTemplateStep)
195+
}
170196
return steps
171197
}
172198
},
@@ -200,7 +226,15 @@ export default {
200226
data.zoneType !== this.zoneConfig.zoneType) {
201227
this.zoneConfig.physicalNetworks = null
202228
}
203-
229+
if (data.zoneSuperType && data.zoneSuperType !== this.selectedZoneSuperType) {
230+
this.selectedZoneSuperType = data.zoneSuperType
231+
}
232+
if (data.arch && data.arch !== this.selectedArch) {
233+
this.selectedArch = data.arch
234+
}
235+
if (data.zoneReturned?.id) {
236+
this.returnedZoneId = data.zoneReturned.id
237+
}
204238
this.zoneConfig = { ...this.zoneConfig, ...data }
205239
},
206240
onCloseAction () {

ui/src/views/infra/zone/ZoneWizardLaunchZone.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,8 +1723,13 @@ export default {
17231723
await this.$message.success('Success')
17241724
this.loading = false
17251725
this.steps = []
1726-
this.$emit('closeAction')
1727-
this.$emit('refresh-data')
1726+
if (this.prefillContent.hypervisor === 'KVM') {
1727+
this.$emit('fieldsChanged', { zoneReturned: { id: this.stepData.zoneReturned.id } })
1728+
this.$emit('nextPressed')
1729+
} else {
1730+
this.$emit('closeAction')
1731+
this.$emit('refresh-data')
1732+
}
17281733
} catch (e) {
17291734
this.loading = false
17301735
await this.$notification.error({

0 commit comments

Comments
 (0)