Skip to content
This repository was archived by the owner on Jan 20, 2021. It is now read-only.
Draft
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
12 changes: 12 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,12 @@
"label.transportzoneuuid": "Transport Zone Uuid",
"label.try.again": "Try Again",
"label.tuesday": "Tuesday",
"label.tungsten.provider": "Tungsten provider",
"label.tungsten.provider.name": "Tungsten provider name",
"label.tungsten.provider.hostname": "Tungsten provider hostname",
"label.tungsten.provider.port": "Tungsten provider port",
"label.tungsten.provider.vrouter": "Tungsten provider vrouter",
"label.tungsten.provider.vrouterport": "Tungsten provider vrouter port",
"label.type": "Type",
"label.type.id": "Type ID",
"label.ucs": "UCS",
Expand Down Expand Up @@ -2863,6 +2869,7 @@
"message.host.dedicated": "Host Dedicated",
"message.host.dedication.released": "Host dedication released",
"message.info.cloudian.console": "Cloudian Management Console should open in another window",
"message.infra.setup.tungsten.description": "This zone must contain a tungsten provider because the isolation method is TF",
"message.installwizard.click.retry": "Click the button to retry launch.",
"message.installwizard.copy.whatisacluster": "A cluster provides a way to group hosts. The hosts in a cluster all have identical hardware, run the same hypervisor, are on the same subnet, and access the same shared storage. Virtual machine instances (VMs) can be live-migrated from one host to another within the same cluster, without interrupting service to the user. A cluster is the third-largest organizational unit within a CloudStack™; deployment. Clusters are contained within pods, and pods are contained within zones.<br/><br/>CloudStack™; allows multiple clusters in a cloud deployment, but for a Basic Installation, we only need one cluster.",
"message.installwizard.copy.whatisahost": "A host is a single computer. Hosts provide the computing resources that run the guest virtual machines. Each host has hypervisor software installed on it to manage the guest VMs (except for bare metal hosts, which are a special case discussed in the Advanced Installation Guide). For example, a Linux KVM-enabled server, a Citrix XenServer server, and an ESXi server are hosts. In a Basic Installation, we use a single host running XenServer or KVM.<br/><br/>The host is the smallest organizational unit within a CloudStack™; deployment. Hosts are contained within clusters, clusters are contained within pods, and pods are contained within zones.",
Expand Down Expand Up @@ -2897,6 +2904,11 @@
"message.installwizard.tooltip.configureguesttraffic.guestnetmask": "The netmask in use on the subnet that the guests should use",
"message.installwizard.tooltip.configureguesttraffic.gueststartip": "The range of IP addresses that will be available for allocation to guests in this zone. If one NIC is used, these IPs should be in the same CIDR as the pod CIDR.",
"message.installwizard.tooltip.configureguesttraffic.name": "A name for your network",
"message.installwizard.tooltip.tungsten.provider.name": "Tungsten provider name is required",
"message.installwizard.tooltip.tungsten.provider.hostname": "Tungsten provider hostname is required",
"message.installwizard.tooltip.tungsten.provider.port": "Tungsten provider port is required",
"message.installwizard.tooltip.tungsten.provider.vrouter": "Tungsten provider vrouter is required",
"message.installwizard.tooltip.tungsten.provider.vrouterport": "Tungsten provider vrouter port is required",
"message.instance.scaled.up.confirm": "Do you really want to scale Up your instance ?",
"message.instancewizard.notemplates": "You do not have any templates available; please add a compatible template, and re-launch the instance wizard.",
"message.interloadbalance.not.return.elementid": "error: listInternalLoadBalancerElements API doesn't return Internal LB Element Id",
Expand Down
2 changes: 1 addition & 1 deletion src/views/infra/zone/ZoneWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default {
},
{
title: 'label.network',
step: ['physicalNetwork', 'netscaler', 'pod', 'guestTraffic', 'storageTraffic', 'publicTraffic'],
step: ['physicalNetwork', 'tungsten', 'netscaler', 'pod', 'guestTraffic', 'storageTraffic', 'publicTraffic'],
description: this.$t('message.network.description'),
hint: this.$t('message.network.hint')
},
Expand Down
92 changes: 91 additions & 1 deletion src/views/infra/zone/ZoneWizardLaunchZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,12 @@ export default {
this.stepData.physicalNetworkReturned = physicalNetworkReturned
this.stepData.physicalNetworkItem['createPhysicalNetwork' + index] = physicalNetworkReturned
this.stepData.stepMove.push('createPhysicalNetwork' + index)

if (physicalNetwork.isolationMethod === 'TF' &&
physicalNetwork.traffics.findIndex(traffic => traffic.type === 'public') > -1) {
this.stepData.isTungstenZone = true
this.stepData.tungstenPhysicalNetworkId = physicalNetworkReturned.id
}
} else {
this.stepData.physicalNetworkReturned = this.stepData.physicalNetworkItem['createPhysicalNetwork' + index]
}
Expand Down Expand Up @@ -935,7 +941,11 @@ export default {
return
}

await this.stepConfigureStorageTraffic()
if (this.stepData.isTungstenZone) {
await this.stepCreateTungstenPublicNetwork()
} else {
await this.stepConfigureStorageTraffic()
}
} else if (this.isAdvancedZone && this.sgEnabled) {
await this.stepConfigureStorageTraffic()
} else {
Expand All @@ -949,6 +959,56 @@ export default {
}
}
},
async stepCreateTungstenPublicNetwork () {
this.setStepStatus(STATUS_FINISH)
this.currentStep++
this.addStep('message.create.tungsten.public.network', 'tungsten')

if (this.stepData.stepMove.includes('tungsten')) {
await this.stepConfigureStorageTraffic()
return
}

try {
if (!this.stepData.stepMove.includes('configTungsten')) {
const configParams = {}
configParams.zoneid = this.stepData.zoneReturned.id
configParams.physicalnetworkid = this.stepData.tungstenPhysicalNetworkId

await this.configTungstenService(configParams)
this.stepData.stepMove.push('configTungsten')
}

if (!this.stepData.stepMove.includes('createTungstenProvider')) {
const providerParams = {}

providerParams.zoneid = this.stepData.zoneReturned.id
providerParams.tungstenproviderhostname = this.prefillContent.tungstenHostname.value || null
providerParams.name = this.prefillContent.tungstenName.value || null
providerParams.tungstenproviderport = this.prefillContent.tungstenPort.value || null
providerParams.tungstenprovidervrouter = this.prefillContent.tungstenVrouter.value || null
providerParams.tungstenprovidervrouterport = this.prefillContent.tungstenVrouterport.value || null

await this.createTungstenProvider(providerParams)
this.stepData.stepMove.push('createTungstenProvider')
}

if (!this.stepData.stepMove.includes('createTungstenNetwork')) {
const params = {}
params.zoneid = this.stepData.zoneReturned.id

await this.createTungstenPublicNetwork(params)
this.stepData.stepMove.push('createTungstenNetwork')
}

this.stepData.stepMove.push('tungsten')
await this.stepConfigureStorageTraffic()
} catch (e) {
this.messageError = e
this.processStatus = STATUS_FAILED
this.setStepStatus(STATUS_FAILED)
}
},
async stepConfigureStorageTraffic () {
let targetNetwork = false
this.prefillContent.physicalNetworks.forEach(physicalNetwork => {
Expand Down Expand Up @@ -2033,6 +2093,36 @@ export default {
})
})
},
configTungstenService (args) {
return new Promise((resolve, reject) => {
api('configTungstenService', {}, 'POST', args).then(json => {
resolve()
}).catch(error => {
const message = error.response.headers['x-description']
reject(message)
})
})
},
createTungstenProvider (args) {
return new Promise((resolve, reject) => {
api('createTungstenProvider', {}, 'POST', args).then(json => {
resolve()
}).catch(error => {
const message = error.response.headers['x-description']
reject(message)
})
})
},
createTungstenPublicNetwork (args) {
return new Promise((resolve, reject) => {
api('createTungstenPublicNetwork', args).then(json => {
resolve()
}).catch(error => {
const message = error.response.headers['x-description']
reject(message)
})
})
},
nfsURL (server, path) {
let url = null
if (path.substring(0, 1) !== '/') {
Expand Down
64 changes: 64 additions & 0 deletions src/views/infra/zone/ZoneWizardNetworkSetupStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@
:isFixError="isFixError"
/>

<static-inputs-form
v-if="steps && steps[currentStep].formKey === 'tungsten'"
@nextPressed="nextPressed"
@backPressed="handleBack"
@fieldsChanged="fieldsChanged"
@submitLaunchZone="submitLaunchZone"
:fields="tungstenFields"
:prefillContent="prefillContent"
:description="tungstenSetupDescription"
:isFixError="isFixError"
/>
<static-inputs-form
v-if="steps && steps[currentStep].formKey === 'pod'"
@nextPressed="nextPressed"
Expand Down Expand Up @@ -152,12 +163,29 @@ export default {
return this.zoneType === 'Basic' ||
(this.zoneType === 'Advanced' && this.sgEnabled)
},
isTungstenZone () {
let isTungsten = false

if (!this.prefillContent.physicalNetworks) {
isTungsten = false
} else if (this.prefillContent.physicalNetworks[0].isolationMethod === 'TF') {
isTungsten = true
}

return isTungsten
},
allSteps () {
const steps = []
steps.push({
title: 'label.physical.network',
formKey: 'physicalNetwork'
})
if (this.isTungstenZone) {
steps.push({
title: 'label.tungsten.provider',
formKey: 'tungsten'
})
}
if (this.havingNetscaler) {
steps.push({
title: 'label.netScaler',
Expand Down Expand Up @@ -192,6 +220,41 @@ export default {
}
return {}
},
tungstenFields () {
const fields = [
{
title: 'label.tungsten.provider.name',
key: 'tungstenName',
placeHolder: 'message.installwizard.tooltip.tungsten.provider.name',
required: true
},
{
title: 'label.tungsten.provider.hostname',
key: 'tungstenHostname',
placeHolder: 'message.installwizard.tooltip.tungsten.provider.hostname',
required: true
},
{
title: 'label.tungsten.provider.port',
key: 'tungstenPort',
placeHolder: 'message.installwizard.tooltip.tungsten.provider.port',
required: true
},
{
title: 'label.tungsten.provider.vrouter',
key: 'tungstenVrouter',
placeHolder: 'message.installwizard.tooltip.tungsten.provider.vrouter',
required: true
},
{
title: 'label.tungsten.provider.vrouterport',
key: 'tungstenVrouterport',
placeHolder: 'message.installwizard.tooltip.tungsten.provider.vrouterport',
required: true
}
]
return fields
},
netscalerFields () {
return [
{
Expand Down Expand Up @@ -321,6 +384,7 @@ export default {
basic: 'message.guest.traffic.in.basic.zone'
},
podSetupDescription: 'message.add.pod.during.zone.creation',
tungstenSetupDescription: 'message.infra.setup.tungsten.description',
netscalerSetupDescription: 'label.please.specify.netscaler.info',
storageTrafficDescription: 'label.zonewizard.traffictype.storage',
podFields: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<a-select-option value="L3VPN"> L3VPN </a-select-option>
<a-select-option value="VSP"> VSP </a-select-option>
<a-select-option value="VCS"> VCS </a-select-option>
<a-select-option value="TF"> TF </a-select-option>
</a-select>
</template>
<template slot="traffics" slot-scope="traffics, record">
Expand Down