Skip to content

Commit a6e4b49

Browse files
piyush5netappSrivastava, Piyush
andauthored
bugfix/CSTACKEX-135: added Netapp ontap screen during zone creation (#39)
### Description This PR... <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. --> <!-- For new features, provide link to FS, dev ML discussion etc. --> <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. --> <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged --> <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" --> <!-- Fixes: # --> <!--- ******************************************************************************* --> <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. --> <!--- PLEASE PUT AN 'X' in only **ONE** box --> <!--- ******************************************************************************* --> ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] Build/CI - [ ] Test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): <img width="1044" height="723" alt="image" src="https://github.com/user-attachments/assets/5edcd661-7b6a-4b5f-adb1-efc34faf3c76" /> <img width="1446" height="175" alt="image" src="https://github.com/user-attachments/assets/60cc9f05-d096-45d6-8c92-d1a7ce49b42a" /> ### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. --> <!-- Include details of your testing environment, and the tests you ran to --> #### How did you try to break this feature and the system with this change? <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document --> --------- Co-authored-by: Srivastava, Piyush <Piyush.Srivastava@netapp.com>
1 parent 4a62d40 commit a6e4b49

File tree

3 files changed

+79
-6
lines changed

3 files changed

+79
-6
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,15 @@ export default {
247247
return Promise.resolve()
248248
}
249249
},
250+
async checkNumberFormat (rule, value) {
251+
if (!value || value === '') {
252+
return Promise.resolve()
253+
} else if (!/^\d+$/.test(String(value).replace(/,/g, ''))) {
254+
return Promise.reject(rule.message)
255+
} else {
256+
return Promise.resolve()
257+
}
258+
},
250259
isDisplayInput (field) {
251260
if (!field.display && !field.hidden) {
252261
return true

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

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ export default {
575575
key: 'managed',
576576
checkbox: true,
577577
hidden: {
578-
provider: ['DefaultPrimary', 'PowerFlex', 'Linstor']
578+
provider: ['DefaultPrimary', 'PowerFlex', 'Linstor', 'NetApp ONTAP']
579579
}
580580
},
581581
{
@@ -589,14 +589,14 @@ export default {
589589
title: 'label.capacityiops',
590590
key: 'capacityIops',
591591
hidden: {
592-
provider: ['DefaultPrimary', 'PowerFlex', 'Linstor']
592+
provider: ['DefaultPrimary', 'PowerFlex', 'Linstor', 'NetApp ONTAP']
593593
}
594594
},
595595
{
596596
title: 'label.url',
597597
key: 'url',
598598
hidden: {
599-
provider: ['DefaultPrimary', 'PowerFlex', 'Linstor']
599+
provider: ['DefaultPrimary', 'PowerFlex', 'Linstor', 'NetApp ONTAP']
600600
}
601601
},
602602
{
@@ -636,6 +636,43 @@ export default {
636636
provider: 'PowerFlex'
637637
}
638638
},
639+
{
640+
title: 'label.ontap.ip',
641+
key: 'ontapIP',
642+
required: true,
643+
placeHolder: 'message.error.input.value',
644+
display: {
645+
provider: 'NetApp ONTAP'
646+
}
647+
},
648+
{
649+
title: 'label.username',
650+
key: 'ontapUsername',
651+
required: true,
652+
placeHolder: 'message.error.input.value',
653+
display: {
654+
provider: 'NetApp ONTAP'
655+
}
656+
},
657+
{
658+
title: 'label.password',
659+
key: 'ontapPassword',
660+
required: true,
661+
placeHolder: 'message.error.input.value',
662+
password: true,
663+
display: {
664+
provider: 'NetApp ONTAP'
665+
}
666+
},
667+
{
668+
title: 'label.ontap.svm.name',
669+
key: 'ontapSvmName',
670+
required: true,
671+
placeHolder: 'message.error.input.value',
672+
display: {
673+
provider: 'NetApp ONTAP'
674+
}
675+
},
639676
{
640677
title: 'label.storage.tags',
641678
key: 'primaryStorageTags',
@@ -909,9 +946,9 @@ export default {
909946
},
910947
watch: {
911948
'prefillContent.provider' (newVal, oldVal) {
912-
if (['SolidFire', 'PowerFlex'].includes(newVal) && !['SolidFire', 'PowerFlex'].includes(oldVal)) {
949+
if (['SolidFire', 'PowerFlex', 'NetApp ONTAP'].includes(newVal) && !['SolidFire', 'PowerFlex', 'NetApp ONTAP'].includes(oldVal)) {
913950
this.$emit('fieldsChanged', { primaryStorageProtocol: undefined })
914-
} else if (!['SolidFire', 'PowerFlex'].includes(newVal) && ['SolidFire', 'PowerFlex'].includes(oldVal)) {
951+
} else if (!['SolidFire', 'PowerFlex', 'NetApp ONTAP'].includes(newVal) && ['SolidFire', 'PowerFlex', 'NetApp ONTAP'].includes(oldVal)) {
915952
this.$emit('fieldsChanged', { primaryStorageProtocol: undefined })
916953
}
917954
@@ -996,6 +1033,17 @@ export default {
9961033
this.primaryStorageScopes = scope
9971034
},
9981035
fetchProtocol () {
1036+
const provider = this.prefillContent?.provider || null
1037+
if (provider === 'NetApp ONTAP') {
1038+
this.primaryStorageProtocols = [
1039+
{ id: 'NFS3', description: 'NFS3' },
1040+
{ id: 'ISCSI', description: 'ISCSI' }
1041+
]
1042+
if (!['NFS3', 'ISCSI'].includes(this.prefillContent?.primaryStorageProtocol)) {
1043+
this.$emit('fieldsChanged', { primaryStorageProtocol: 'NFS3' })
1044+
}
1045+
return
1046+
}
9991047
const hypervisor = this.prefillContent?.hypervisor || null
10001048
const protocols = []
10011049
if (hypervisor === 'KVM') {

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ export default {
15841584
}
15851585
15861586
params.url = url
1587-
if (this.prefillContent.provider !== 'DefaultPrimary' && this.prefillContent.provider !== 'PowerFlex') {
1587+
if (this.prefillContent.provider !== 'DefaultPrimary' && this.prefillContent.provider !== 'PowerFlex' && this.prefillContent.provider !== 'NetApp ONTAP') {
15881588
if (this.prefillContent.managed) {
15891589
params.managed = true
15901590
} else {
@@ -1604,6 +1604,18 @@ export default {
16041604
params.url = this.powerflexURL(this.prefillContent.powerflexGateway, this.prefillContent.powerflexGatewayUsername,
16051605
this.prefillContent.powerflexGatewayPassword, this.prefillContent.powerflexStoragePool)
16061606
}
1607+
if (this.prefillContent.provider === 'NetApp ONTAP') {
1608+
params['details[0].storageIP'] = this.prefillContent.ontapIP
1609+
params['details[0].username'] = this.prefillContent.ontapUsername
1610+
params['details[0].password'] = btoa(this.prefillContent.ontapPassword)
1611+
params['details[0].svmName'] = this.prefillContent.ontapSvmName
1612+
params['details[0].protocol'] = this.prefillContent.primaryStorageProtocol
1613+
params.managed = true
1614+
params.url = this.ontapURL(this.prefillContent.ontapIP)
1615+
if (this.prefillContent.capacityBytes && this.prefillContent.capacityBytes.length > 0) {
1616+
params.capacityBytes = this.prefillContent.capacityBytes.split(',').join('')
1617+
}
1618+
}
16071619
16081620
params.tags = this.prefillContent?.primaryStorageTags || ''
16091621
@@ -2486,6 +2498,10 @@ export default {
24862498
var url = 'powerflex://' + encodeURIComponent(username) + ':' + encodeURIComponent(password) + '@' +
24872499
gateway + '/' + encodeURIComponent(pool)
24882500
return url
2501+
},
2502+
ontapURL (ontapIp) {
2503+
var url = 'https://' + ontapIp
2504+
return url
24892505
}
24902506
}
24912507
}

0 commit comments

Comments
 (0)