cisco.intersight.intersight_lan_connectivity_policy module – Manage LAN Connectivity Policies and vNICs for Cisco Intersight

Note

This module is part of the cisco.intersight collection (version 2.3.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cisco.intersight.

To use it in a playbook, specify: cisco.intersight.intersight_lan_connectivity_policy.

Synopsis

  • Create, update, and delete LAN Connectivity Policies on Cisco Intersight.

  • Manage individual vNICs within LAN Connectivity policies.

  • Supports both Standalone and FIAttached target platforms with different configuration options.

  • LAN Connectivity policies define network connectivity settings for server profiles.

  • For more information see Cisco Intersight.

Parameters

Parameter

Comments

api_key_id

string / required

Public API Key ID associated with the private key.

If not set, the value of the INTERSIGHT_API_KEY_ID environment variable is used.

api_private_key

path / required

Filename (absolute path) or string of PEM formatted private key data to be used for Intersight API authentication.

If a string is used, Ansible vault should be used to encrypt string data.

Ex. ansible-vault encrypt_string –vault-id tme@/Users/dsoper/Documents/vault_password_file ‘—–BEGIN EC PRIVATE KEY—–

<your private key data>

—–END EC PRIVATE KEY—–’

If not set, the value of the INTERSIGHT_API_PRIVATE_KEY environment variable is used.

api_uri

string

URI used to access the Intersight API.

If not set, the value of the INTERSIGHT_API_URI environment variable is used.

Default: "https://intersight.com/api/v1"

azure_qos_enabled

boolean

Enable Azure QoS for the LAN Connectivity policy.

Only applicable when target_platform is ‘attached’.

Choices:

  • false ← (default)

  • true

description

aliases: descr

string

The user-defined description for the LAN Connectivity Policy.

Description can contain letters(a-z, A-Z), numbers(0-9), hyphen(-), period(.), colon(:), or an underscore(_).

iqn_allocation_type

string

IQN allocation type for the LAN Connectivity policy.

Only applicable when target_platform is ‘attached’.

Choices:

  • "None" ← (default)

  • "Pool"

  • "Static"

iqn_pool_name

string

Relationship to the iSCSI Qualified Name Pool.

Required when iqn_allocation_type is ‘Pool’.

Only applicable for attached target platform.

name

string / required

The name assigned to the LAN Connectivity Policy.

Must be unique within the organization.

The name must be between 1 and 62 alphanumeric characters, allowing special characters :-_.

organization

string

The name of the Organization this resource is assigned to.

Policies created within a Custom Organization are applicable only to devices in the same Organization.

Use ‘default’ for the default organization.

Default: "default"

placement_mode

string

Placement mode for vNIC assignment.

Only applicable when target_platform is ‘attached’.

Choices:

  • "custom" ← (default)

  • "auto"

state

string

If present, will verify the resource is present and will create if needed.

If absent, will verify the resource is absent and will delete if needed.

Choices:

  • "present" ← (default)

  • "absent"

static_iqn_name

string

User provided static iSCSI Qualified Name (IQN) for use as initiator identifiers by iSCSI vNICs in a Fabric Interconnect domain.

Required when iqn_allocation_type is ‘Static’.

Only applicable for attached target platform.

tags

list / elements=dictionary

List of tags in Key:<user-defined key> Value:<user-defined value> format.

target_platform

string

The platform type for which the LAN Connectivity policy is intended.

standalone for standalone servers, attached for fabric interconnect attached servers.

Choices:

  • "standalone" ← (default)

  • "attached"

use_proxy

boolean

If no, it will not use a proxy, even if one is defined in an environment variable on the target hosts.

Choices:

  • false

  • true ← (default)

validate_certs

boolean

Boolean control for verifying the api_uri TLS certificate

Choices:

  • false

  • true ← (default)

vnics

list / elements=dictionary

List of vNICs to be created and attached to the LAN Connectivity policy.

Each vNIC will be configured with the specified network and adapter policies.

Required when state is present.

At least one vNIC must be specified for both Standalone and FIAttached platforms.

boolean

Enable or disable automatic assignment of the PCI Link in a dual-link adapter.

This option applies only to 13xx series VICs that support dual-link.

If enabled, the system determines the placement of the vNIC/vHBA on either of the PCI Links.

If disabled, pci_link_assignment_mode must be specified.

Only applicable for attached target platform when auto_vnic_placement_enabled is false.

Choices:

  • false

  • true ← (default)

auto_slot_id

boolean

Enable or disable automatic assignment of the VIC slot ID.

If enabled and the server has only one VIC, the same VIC is chosen for all the vNICs.

If enabled and the server has multiple VICs, the vNIC/vHBA are deployed on the first VIC.

If disabled, placement_slot_id must be specified.

Only applicable for attached target platform when auto_vnic_placement_enabled is false.

Choices:

  • false

  • true ← (default)

auto_vnic_placement_enabled

boolean

Enable automatic vNIC placement for FI-attached servers.

When enabled, the vNIC placement is simplified to only specify the switch ID.

When disabled, full placement control is available including order, auto_slot_id, and auto_pci_link.

Only applicable for attached target platform.

Choices:

  • false ← (default)

  • true

cdn_source

string

Source of the CDN. It can either be user specified or be the same as the vNIC name.

Choices:

  • "vnic" ← (default)

  • "user"

cdn_value

string

CDN value when cdn_source is ‘user’.

connection_type

string

Type of connection for the vNIC.

Choices:

  • "none" ← (default)

  • "usnic"

  • "vmq"

  • "sriov"

eth_adapter_policy_name

string

Relationship to the Ethernet Adapter Policy.

Required when vNIC state is ‘present’.

eth_network_policy_name

string

Relationship to the Ethernet Network Policy.

Required when vNIC state is ‘present’.

eth_qos_policy_name

string

Relationship to the Ethernet QoS Policy.

Required when vNIC state is ‘present’.

fabric_eth_network_control_policy_name

string

Relationship to the Fabric Ethernet Network Policy.

Required when target platform is attached and vNIC state is ‘present’.

Only applicable for attached target platform.

fabric_eth_network_group_policy_name

string

Relationship to the Fabric Ethernet Group Policy.

Required when target platform is attached and vNIC state is ‘present’.

Only applicable for attached target platform.

failover_enabled

boolean

Enables automatic vNIC failover to the secondary Fabric Interconnect if the primary path fails.

Failover applies only to Cisco VICs that are connected to a Fabric Interconnect cluster.

Only applicable for attached target platform.

Choices:

  • false ← (default)

  • true

iscsi_boot_policy_name

string

Relationship to the boot iSCSI Policy.

Only applicable for attached target platform.

mac_address_type

string

Type of MAC address assignment.

Only applicable for attached target platform.

Choices:

  • "pool" ← (default)

  • "static"

mac_pool_name

string

The MAC pool that is assigned.

Required when mac_address_type is ‘pool’ and target platform is attached.

Only applicable for attached target platform.

name

string / required

The name of the vNIC.

Must be unique within the LAN Connectivity policy.

order

integer

The order in which the virtual interface is brought up.

The order assigned to an interface should be unique for all the Ethernet and Fibre-Channel interfaces on each PCI link on a VIC adapter.

The order should start from zero with no overlaps.

The maximum value of PCI order is limited by the number of virtual interfaces (Ethernet and Fibre-Channel) on each PCI link on a VIC adapter.

All VIC adapters have a single PCI link except VIC 1340, VIC 1380 and VIC 1385 which have two.

Default: 0

integer

The PCI Link used as transport for the virtual interface.

PCI Link is only applicable for select Cisco UCS VIC 1300 models (UCSC-PCIE-C40Q-03, UCSB-MLOM-40G-03, UCSB-VIC-M83-8P) that support two PCI links.

The value, if specified, for any other VIC model will be ignored.

For attached required when pci_link_assignment_mode is ‘Custom’.

Choices:

  • 0 ← (default)

  • 1

string

PCI Link assignment mode when auto_pci_link is disabled.

Custom allows manual selection of PCI link via pci_link parameter.

Load-Balanced automatically distributes vNICs across available PCI links.

Required when auto_pci_link is false and auto_vnic_placement_enabled is false.

Only applicable for attached target platform.

Choices:

  • "Custom"

  • "Load-Balanced"

placement_slot_id

string

PCIe Slot where the VIC adapter is installed.

Supported values are (1-15) and MLOM.

Required when vNIC state is ‘present’.

sriov_settings

dictionary

SR-IOV settings when connection_type is ‘sriov’.

comp_count_per_vf

integer

Completion Queue Count per VF (1-16).

Default: 5

enabled

boolean

Enable SR-IOV.

Choices:

  • false

  • true ← (default)

int_count_per_vf

integer

Interrupt Count per VF (1-16).

Default: 8

rx_count_per_vf

integer

Receive Queue Count per VF (1-8).

Default: 4

tx_count_per_vf

integer

Transmit Queue Count per VF (1-8).

Default: 1

vf_count

integer

Number of Virtual Functions (1-64).

Default: 64

state

string

Whether to create/update or delete the vNIC.

Choices:

  • "present" ← (default)

  • "absent"

static_mac_address

string

The MAC address must be in hexadecimal format xx:xx:xx:xx:xx:xx.

To ensure uniqueness of MACs in the LAN fabric, you are strongly encouraged to use the following MAC prefix 00:25:B5:xx:xx:xx.

Required when mac_address_type is ‘static’ and target platform is attached.

Only applicable for attached target platform.

switch_id

string

The fabric port to which the vNICs will be associated.

Only applicable for attached target platform.

Choices:

  • "A" ← (default)

  • "B"

integer

Adapter port on which the virtual interface will be created.

Choices:

  • 0 ← (default)

  • 1

  • 2

  • 3

usnic_settings

dictionary

USNIC settings when connection_type is ‘usnic’.

Required when connection_type is ‘usnic’.

cos

integer

Class of Service to be used for traffic on the usNIC.

Choices:

  • 0

  • 1

  • 2

  • 3

  • 4

  • 5 ← (default)

  • 6

count

integer

Number of usNIC interfaces to be created.

When usNIC is enabled, the valid values are from 1 to 225.

When usNIC is disabled, the default value is 0.

Default: 0

usnic_adapter_policy_name

string

Ethernet Adapter policy to be associated with the usNICs.

Required when connection_type is ‘usnic’.

vmq_settings

dictionary

VMQ settings when connection_type is ‘vmq’.

enabled

boolean

Enable VMQ.

Choices:

  • false

  • true ← (default)

multi_queue_support

boolean

Enables Virtual Machine Multi-Queue feature on the virtual interface.

VMMQ allows configuration of multiple I/O queues for a single VM and thus distributes traffic across multiple CPU cores in a VM.

Choices:

  • false ← (default)

  • true

num_interrupts

integer

The number of interrupt resources to be allocated.

Recommended value is the number of CPU threads or logical processors available in the server.

Default: 16

num_sub_vnics

integer

Number of sub vNICs (0-64).

Only applicable when multi_queue_support is true.

Default: 64

num_vmqs

integer

The number of hardware Virtual Machine Queues to be allocated.

The number of VMQs per adapter must be one more than the maximum number of VM NICs.

Default: 4

vmmq_adapter_policy_name

string

Name of the VMMQ Adapter Policy.

Only applicable when multi_queue_support is true.

Examples

- name: Create a LAN Connectivity Policy for Standalone servers
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "standalone-lan-policy"
    description: "LAN connectivity policy for standalone servers"
    target_platform: "Standalone"
    tags:
      - Key: "Environment"
        Value: "Production"
      - Key: "Site"
        Value: "DataCenter-A"
    vnics:
      - name: "eth0"
        placement_slot_id: "1"
        pci_link: 0
        uplink_port: 0
        order: 0
        eth_network_policy_name: "default-network-policy"
        eth_qos_policy_name: "default-qos-policy"
        eth_adapter_policy_name: "default-adapter-policy"
        connection_type: "none"
      - name: "eth1"
        placement_slot_id: "2"
        pci_link: 0
        uplink_port: 1
        order: 1
        eth_network_policy_name: "vlan-network-policy"
        eth_qos_policy_name: "high-qos-policy"
        eth_adapter_policy_name: "performance-adapter-policy"
        connection_type: "none"
    state: present

- name: Create a LAN Connectivity Policy for FI-Attached servers
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fi-attached-lan-policy"
    description: "LAN connectivity policy for FI-attached servers"
    target_platform: "attached"
    azure_qos_enabled: true
    iqn_allocation_type: "Pool"
    iqn_pool_name: "default-iqn-pool"
    placement_mode: "custom"
    tags:
      - Key: "Environment"
        Value: "Production"
    vnics:
      - name: "vnic-fi-attached"
        order: 0
        cdn_source: "vnic"
        mac_address_type: "pool"
        mac_pool_name: "default-mac-pool"
        auto_slot_id: true
        auto_pci_link: true
        auto_vnic_placement_enabled: false
        switch_id: "A"
        failover_enabled: false
        fabric_eth_network_group_policy_name: "default-network-group"
        fabric_eth_network_control_policy_name: "default-network-control"
        eth_qos_policy_name: "default-qos-policy"
        eth_adapter_policy_name: "default-adapter-policy"
        connection_type: "none"
        state: present
    state: present

- name: Create a LAN Connectivity Policy with automatic vNIC placement
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fi-attached-auto-placement-policy"
    description: "LAN connectivity policy with automatic vNIC placement"
    target_platform: "attached"
    azure_qos_enabled: false
    iqn_allocation_type: "None"
    placement_mode: "auto"
    vnics:
      - name: "auto-placed-vnic"
        cdn_source: "vnic"
        mac_address_type: "pool"
        mac_pool_name: "default-mac-pool"
        auto_vnic_placement_enabled: true
        switch_id: "A"
        failover_enabled: false
        fabric_eth_network_group_policy_name: "default-network-group"
        fabric_eth_network_control_policy_name: "default-network-control"
        eth_qos_policy_name: "default-qos-policy"
        eth_adapter_policy_name: "default-adapter-policy"
        connection_type: "none"
        state: present
    state: present

- name: Create a LAN Connectivity Policy with advanced placement control
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fi-attached-advanced-placement-policy"
    description: "LAN connectivity policy with advanced placement control"
    target_platform: "attached"
    azure_qos_enabled: false
    iqn_allocation_type: "None"
    placement_mode: "custom"
    vnics:
      - name: "advanced-placed-vnic"
        order: 9
        cdn_source: "vnic"
        mac_address_type: "pool"
        mac_pool_name: "default-mac-pool"
        auto_slot_id: false
        placement_slot_id: "5"
        auto_pci_link: false
        pci_link_assignment_mode: "Custom"
        pci_link: 0
        auto_vnic_placement_enabled: false
        switch_id: "A"
        failover_enabled: false
        fabric_eth_network_group_policy_name: "default-network-group"
        fabric_eth_network_control_policy_name: "default-network-control"
        eth_qos_policy_name: "default-qos-policy"
        eth_adapter_policy_name: "default-adapter-policy"
        connection_type: "none"
        state: present
    state: present

- name: Create a LAN Connectivity Policy with load-balanced PCI assignment
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fi-attached-load-balanced-policy"
    description: "LAN connectivity policy with load-balanced PCI assignment"
    target_platform: "attached"
    azure_qos_enabled: false
    iqn_allocation_type: "None"
    placement_mode: "custom"
    vnics:
      - name: "load-balanced-vnic"
        order: 5
        cdn_source: "vnic"
        mac_address_type: "pool"
        mac_pool_name: "default-mac-pool"
        auto_slot_id: false
        placement_slot_id: "MLOM"
        auto_pci_link: false
        pci_link_assignment_mode: "Load-Balanced"
        auto_vnic_placement_enabled: false
        switch_id: "B"
        failover_enabled: true
        fabric_eth_network_group_policy_name: "default-network-group"
        fabric_eth_network_control_policy_name: "default-network-control"
        eth_qos_policy_name: "default-qos-policy"
        eth_adapter_policy_name: "default-adapter-policy"
        connection_type: "none"
        state: present
    state: present

- name: Create a LAN Connectivity Policy with USNIC vNIC
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "usnic-lan-policy"
    description: "Policy with USNIC configuration"
    target_platform: "Standalone"
    vnics:
      - name: "usnic-eth0"
        placement_slot_id: "4"
        pci_link: 0
        uplink_port: 0
        order: 0
        eth_network_policy_name: "hpc-network-policy"
        eth_qos_policy_name: "hpc-qos-policy"
        eth_adapter_policy_name: "hpc-adapter-policy"
        connection_type: "usnic"
        usnic_settings:
          count: 0
          cos: 5
          usnic_adapter_policy_name: "hpc-adapter-policy"
    state: present

- name: Create a LAN Connectivity Policy with VMQ vNIC
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "vmq-lan-policy"
    description: "Policy with VMQ configuration"
    target_platform: "Standalone"
    vnics:
      - name: "vmq-eth0"
        placement_slot_id: "10"
        pci_link: 0
        uplink_port: 2
        order: 0
        eth_network_policy_name: "vm-network-policy"
        eth_qos_policy_name: "vm-qos-policy"
        eth_adapter_policy_name: "vm-adapter-policy"
        connection_type: "vmq"
        vmq_settings:
          enabled: true
          multi_queue_support: false
          num_interrupts: 16
          num_vmqs: 4
    state: present

- name: Create a LAN Connectivity Policy with VMQ multi-queue support
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "vmq-multiqueue-lan-policy"
    description: "Policy with VMQ multi-queue configuration"
    target_platform: "Standalone"
    vnics:
      - name: "vmq-mq-eth0"
        placement_slot_id: "11"
        pci_link: 1
        uplink_port: 3
        order: 0
        eth_network_policy_name: "vm-network-policy"
        eth_qos_policy_name: "vm-qos-policy"
        eth_adapter_policy_name: "vm-adapter-policy"
        connection_type: "vmq"
        vmq_settings:
          enabled: true
          multi_queue_support: true
          num_sub_vnics: 64
          vmmq_adapter_policy_name: "vmmq-adapter-policy"
    state: present

- name: Create a LAN Connectivity Policy with SR-IOV vNIC
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "sriov-lan-policy"
    description: "Policy with SR-IOV configuration"
    target_platform: "Standalone"
    vnics:
      - name: "sriov-eth0"
        placement_slot_id: "14"
        pci_link: 0
        uplink_port: 1
        order: 0
        eth_network_policy_name: "sriov-network-policy"
        eth_qos_policy_name: "sriov-qos-policy"
        eth_adapter_policy_name: "sriov-adapter-policy"
        connection_type: "sriov"
        sriov_settings:
          enabled: true
          vf_count: 64
          rx_count_per_vf: 4
          tx_count_per_vf: 1
          comp_count_per_vf: 5
          int_count_per_vf: 8
    state: present

- name: Create a LAN Connectivity Policy with custom CDN values
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "custom-cdn-lan-policy"
    description: "Policy with custom CDN values"
    target_platform: "Standalone"
    vnics:
      - name: "mgmt-nic"
        placement_slot_id: "1"
        pci_link: 0
        uplink_port: 0
        order: 0
        cdn_source: "user"
        cdn_value: "Management-NIC"
        eth_network_policy_name: "mgmt-network-policy"
        eth_qos_policy_name: "mgmt-qos-policy"
        eth_adapter_policy_name: "mgmt-adapter-policy"
        connection_type: "none"
    state: present

- name: Update LAN connectivity policy - manage vNIC states
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "mixed-vnic-states-policy"
    description: "Policy demonstrating vNIC state management"
    target_platform: "Standalone"
    vnics:
      - name: "eth0"
        placement_slot_id: "1"
        pci_link: 0
        uplink_port: 0
        order: 0
        eth_network_policy_name: "production-network"
        eth_qos_policy_name: "standard-qos"
        eth_adapter_policy_name: "standard-adapter"
        connection_type: "none"
        state: present
      - name: "eth1-old"
        state: absent
      - name: "eth2-new"
        placement_slot_id: "3"
        pci_link: 0
        uplink_port: 1
        order: 1
        eth_network_policy_name: "production-network"
        eth_qos_policy_name: "standard-qos"
        eth_adapter_policy_name: "standard-adapter"
        connection_type: "vmq"
        vmq_settings:
          enabled: true
          multi_queue_support: false
          num_interrupts: 16
          num_vmqs: 4
        state: present
    state: present

- name: Delete a LAN Connectivity Policy
  cisco.intersight.intersight_lan_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "old-lan-policy"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

api_response

dictionary

The API response output returned by the specified resource.

Returned: always

Sample: {"api_response": {"Name": "test-lan-policy", "ObjectType": "vnic.LanConnectivityPolicy", "Tags": [{"Key": "Environment", "Value": "Production"}], "TargetPlatform": "Standalone", "vNICs": [{"Name": "eth0", "ObjectType": "vnic.EthIf", "Order": 0, "Placement": {"Id": "1"}}]}}

Authors

  • Ron Gershburg (@rgershbu)