# ACI mso\_schema\_template\_bd : not valid VRF association

**URL:** <https://forum.ansible.com/t/aci-mso-schema-template-bd-not-valid-vrf-association/31635>\
**Category:** Ansible Project\
**Created:** [November 11, 2019, 4:05pm UTC](https://forum.ansible.com/t/aci-mso-schema-template-bd-not-valid-vrf-association/31635 "2019-11-11T16:05:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Albert\_Short](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Albert\_Short](https://forum.ansible.com/u/Albert_Short)\
**Post date:** [November 11, 2019, 4:05pm UTC](https://forum.ansible.com/t/aci-mso-schema-template-bd-not-valid-vrf-association/31635/1 "2019-11-11T16:05:43Z")

</div>

All,

using the [**mso\_schema\_template\_bd**](https://docs.ansible.com/ansible/latest/modules/mso_schema_template_bd_module.html#mso-schema-template-bd-module) module I have come across the following issue:

**Setting the scene:**  
VRF has been create in Schema X, with template X associated to tenant USER

BD has been created in Schema1, with template 1 associated to tenant USER  
BD in schema 1 references VRF in Schema X, a valid deployment in MSO, proven to work.

**My issue:**  
The module only allows to reference the BD schema & template (1), so the playbook will always fail because I can’t work out how to reference another schema & template (X)

Any work around or fix identified yet?

- name: Add a new BD  
mso\_schema\_template\_bd:

# host: “{{ ansible\_host }}”

# username: admin

# password: \*\*\*\*

host: “{{ ansible\_host }}”  
username: “{{ ansible\_user1 }}”  
password: “{{ ansible\_password1 }}”  
validate\_certs: false

# Module specific variables

schema: sch-{{tenant\_name}}-legacy  
template: tmpl-{{tenant\_name}}-{{site}}{{site\_id}}-legacy  
bd: bd-{{site}}{{site\_id}}-{{item}}  
subnets:

- description: “”  
ip: 11.11.12.1/24  
no\_default\_gateway: no  
scope: public  
shared: no  
vrf:  
name: v00-aci [this VRF resides in a different Schema & template]  
state: present  
with\_items:
- “{{ entry[site\_id][‘vlan\_id’] }}”  
delegate\_to: localhost

data:

- op: replace  
path: /templates/tmpl-user-sc1-legacy/bds/bd-sc1-11  
value:  
displayName: bd-sc1-11  
intersiteBumTrafficAllow: true  
l2Stretch: true  
l2UnknownUnicast: proxy  
name: bd-sc1-11  
optimizeWanBandwidth: true  
subnets:
- description: ‘’  
ip: 11.11.12.1/24  
noDefaultGateway: false  
scope: public  
shared: false  
vrfRef:  
schemaId: 5dc285e5100000d3005d1b9f  
templateName: tmpl-user-sc1-legacy  
vrfName: v00-aci  
info:  
**body: ‘{“code”:142,“message”:“Invalid Reference: BD ‘‘bd-sc1-11’’ is not associated to a valid VRF”}’**  
connection: close  
content-language: en  
content-length: ‘91’  
content-type: application/json  
date: Mon, 11 Nov 2019 15:53:52 GMT  
msg: ‘HTTP Error 400: Bad Request’  
server: nginx  
status: 400  
strict-transport-security: max-age=31536000; includeSubDomains  
url: https:///api/v1/schemas/5dc285e5100000d3005d1b9f  
item: 11  
**msg: ‘MSO Error 142: Invalid Reference: BD ‘‘bd-sc1-11’’ is not associated to a valid VRF’**  
payload:  
code: 142  
**message: ‘Invalid Reference: BD ‘‘bd-sc1-11’’ is not associated to a valid VRF’**

---

<div class="post-metadata">

**Author:** ![Albert\_Short](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Albert\_Short](https://forum.ansible.com/u/Albert_Short)\
**Post date:** [November 11, 2019, 4:10pm UTC](https://forum.ansible.com/t/aci-mso-schema-template-bd-not-valid-vrf-association/31635/2 "2019-11-11T16:10:50Z")

</div>

![](https://us1.discourse-cdn.com/ansible/original/2X/d/d6c7c22b25169f0038a1a836f15311f8ac0f60a6.png)
