Skip to content

Commit fac3676

Browse files
sudo87dhslove
authored andcommitted
Allow populating generic templates during Zone Deployment (apache#10947)
1 parent 0d65ae0 commit fac3676

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
@@ -1045,6 +1045,7 @@
10451045
"label.filter.annotations.self": "Created by me",
10461046
"label.filterby": "Filter by",
10471047
"label.fingerprint": "FingerPrint",
1048+
"label.skip": "Skip",
10481049
"label.finish": "Finish",
10491050
"label.firewall": "Firewall",
10501051
"label.firewall.policy": "Firewall Policy",
@@ -3180,6 +3181,7 @@
31803181
"message.desc.importexportinstancewizard": "By choosing to manage an Instance, ABLESTACK takes over the orchestration of that Instance. Unmanaging an Instance removes ABLESTACK ability to manage it. In both cases, the Instance is left running and no changes are done to the VM on the hypervisor.",
31813182
"message.desc.importmigratefromvmwarewizard": "By selecting an existing or external VMware Datacenter and an instance to import, ABLESTACK migrates the selected instance from VMware to KVM on a conversion host using virt-v2v and imports it into a KVM cluster",
31823183
"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.",
3184+
"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.",
31833185
"message.desc.reset.ssh.key.pair": "Please specify a ssh key pair that you would like to add to this Instance.",
31843186
"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.",
31853187
"message.desc.register.user.data": "Please fill in the following data to register a User data.",
@@ -3963,6 +3965,7 @@
39633965
"message.zonewizard.enable.local.storage": "WARNING: If you enable local storage for this zone, you must do the following, depending on where you would like your system VMs to launch:<br/><br/>1. If system VMs need to be launched in shared primary storage, shared primary storage needs to be added to the zone after creation. You must also start the zone in a disabled state.<br/><br/>2. If system VMs need to be launched in local primary storage, system.vm.use.local.storage needs to be set to true before you enable the zone.<br/><br/><br/>Would you like to continue?",
39643966
"messgae.validate.min": "Please enter a value greater than or equal to {0}.",
39653967
"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.",
3968+
"message.warn.select.template": "Please select a Template for Registration.",
39663969
"message.warn.zone.mtu.update": "Please note that this limit won't affect pre-existing Network’s MTU settings",
39673970
"message.webhook.deliveries.time.filter": "Webhook deliveries list can be filtered based on date-time. Select 'Custom' for specifying start and end date range.",
39683971
"message.validate.min": "Please enter a value greater than or equal to {0}.",

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
@@ -1738,8 +1738,13 @@ export default {
17381738
await this.$message.success('Success')
17391739
this.loading = false
17401740
this.steps = []
1741-
this.$emit('closeAction')
1742-
this.$emit('refresh-data')
1741+
if (this.prefillContent.hypervisor === 'KVM') {
1742+
this.$emit('fieldsChanged', { zoneReturned: { id: this.stepData.zoneReturned.id } })
1743+
this.$emit('nextPressed')
1744+
} else {
1745+
this.$emit('closeAction')
1746+
this.$emit('refresh-data')
1747+
}
17431748
} catch (e) {
17441749
this.loading = false
17451750
await this.$notification.error({

0 commit comments

Comments
 (0)