cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
745
Views
0
Helpful
34
Replies

ansible attach vnic template to lan connectivity policy

roxyfoxtrotter
Level 1
Level 1

I have following lan connectivity policy and want to know how to attach a vnic template to it

 

cisco.intersight.intersight_rest_api:
        <<: *api_info_fc
        resource_path: /vnic/EthIfs
        query_params:
           $filter: "Name eq '{{ name_of_fc_vnic_0 }}'"
        api_body: {
             "Name": "{{ name_of_fc_vnic_0 }}",
             "MacAddressType": "POOL",
             "MacPool": "{{ mac_pool_fi_a_details.api_response.Moid }}",
             "Placement": {
                "SwitchId": "A",
                "AutoPciLink": true,
                "AutoSlotId": true,
             },
             "Cdn": {
                "Source": "vnic"
             },
             "FailoverEnabled": false,
             "FabricEthNetworkGroupPolicy": [ "{{ management_network_group_policy.api_response.Moid }}" ],
             "FabricEthNetworkControlPolicy": "{{ ethernet_network_control_policy.api_response.Moid }}",
             "EthQosPolicy": "{{ ethernet_qos_policy.api_response.Moid }}",
             "EthAdapterPolicy": "{{ ethernet_adapter_vmware_policy.api_response.Moid }}",
             "StaticMacAddress": "",
             "LanConnectivityPolicy": "{{ fc_lan_connectivity_policy.api_response.Moid }}",
             "Order": 0
         }
34 Replies 34

my lan connectivity included creating vnics. Then i have another playbook that created vnic templates. do i need to create another playbook to attach the vnic to the vnic template for last step?

where should i be looking under developer tools?

 

Picture1.png

I've added an example of attaching an existing vNIC to a template at https://github.com/CiscoDevNet/intersight-ansible/blob/main/playbooks/intersight_attach_vnic_template.yml  The bulk/Requests API is used for attach, and you can filter in a developer console on bulk to see any actions that use that resource.

Hi Thanks. Can the SlotId be set to auto? or does it need an order number? 

AutoSlodId can be set to true in the Placement dictionary.

Review Cisco Networking for a $25 gift card