cisco.intersight.intersight_san_connectivity_policy module – Manage SAN Connectivity Policies and vHBAs for Cisco Intersight

Note

This module is part of the cisco.intersight collection (version 2.7.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_san_connectivity_policy.

Synopsis

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

  • Manage individual vHBAs (virtual Host Bus Adapters) within SAN Connectivity policies.

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

  • SAN Connectivity policies define storage 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"

description

aliases: descr

string

The user-defined description for the SAN Connectivity Policy.

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

name

string / required

The name assigned to the SAN 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

The mode used for placement of vHBAs on network adapters.

custom requires manual placement specification for each vHBA.

auto automatically distributes vHBAs between adapters during profile deployment.

Only applicable for fiattached target platform.

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_wwnn_address

string

The WWNN address for the server node must be in hexadecimal format xx:xx:xx:xx:xx:xx:xx:xx.

Allowed ranges are 20:00:00:00:00:00:00:00 to 20:FF:FF:FF:FF:FF:FF:FF or from 50:00:00:00:00:00:00:00 to 5F:FF:FF:FF:FF:FF:FF:FF.

To ensure uniqueness of WWN’s in the SAN fabric, you are strongly encouraged to use the WWN prefix - 20:00:00:25:B5:xx:xx:xx.

Required when wwnn_address_type is static and target platform is fiattached.

Only applicable for fiattached 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 SAN Connectivity policy is intended.

standalone for standalone servers.

fiattached for fabric interconnect attached servers.

unified for unified edge servers.

Choices:

  • "standalone" ← (default)

  • "fiattached"

  • "unified"

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)

vhbas

list / elements=dictionary

List of vHBAs to be created and attached to the SAN Connectivity policy.

Each vHBA will be configured with the specified fibre channel policies.

Configuration options vary based on target_platform.

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 vHBA on either of the PCI Links.

If disabled, pci_link_assignment_mode must be specified.

Only applicable for FIAttached target platform.

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 vHBAs.

If enabled and the server has multiple VICs, the vHBA is deployed on the first VIC.

If disabled, slot_id must be specified.

Only applicable for FIAttached target platform.

Choices:

  • false

  • true ← (default)

fibre_channel_adapter_policy

string

Name of the Fibre Channel Adapter Policy.

Required when vHBA state is present.

fibre_channel_network_policy

string

Name of the Fibre Channel Network Policy.

Required when vHBA state is present.

fibre_channel_qos_policy

string

Name of the Fibre Channel QoS Policy.

Required when vHBA state is present.

fibre_channel_zone_policies

list / elements=string

List of Fibre Channel Zone Policy names.

Relationship to the FC Zone policy to configure Zones on the switch.

Optional field for FIAttached target platform.

name

string / required

Name of the virtual fibre channel interface.

Must be unique within the SAN Connectivity policy.

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 Standalone and UnifiedEdgeServer, this is used directly.

For FIAttached, 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 vHBAs across available PCI links.

Required when auto_pci_link is false.

Only applicable for fiattached target platform.

Choices:

  • "custom"

  • "load-balanced"

pci_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

persistent_lun_bindings

boolean

Enables retention of LUN ID associations in memory until they are manually cleared.

Choices:

  • false ← (default)

  • true

pin_group_name

string

Pingroup name associated to vHBA for static pinning.

SCP deploy will resolve pingroup name and fetches the corresponding uplink port/port channel to pin the vHBA traffic.

Optional field for FIAttached target platform.

slot_id

string

PCIe Slot where the VIC adapter is installed.

Supported values are (1-15) and MLOM.

Required for Standalone and UnifiedEdgeServer when vHBA state is present and auto_slot_id is false.

Required for FIAttached when vHBA state is present and auto_slot_id is false.

state

string

Whether to create/update or delete the vHBA.

Choices:

  • "present" ← (default)

  • "absent"

static_wwpn_address

string

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

Allowed ranges are 20:00:00:00:00:00:00:00 to 20:FF:FF:FF:FF:FF:FF:FF or from 50:00:00:00:00:00:00:00 to 5F:FF:FF:FF:FF:FF:FF:FF.

To ensure uniqueness of WWN’s in the SAN fabric, you are strongly encouraged to use the WWN prefix - 20:00:00:25:B5:xx:xx:xx.

Required when wwpn_address_type is static and target platform is fiattached.

Only applicable for fiattached target platform.

switch_id

string

The fabric port to which the vHBA will be associated.

Only applicable for fiattached target platform.

Choices:

  • "a" ← (default)

  • "b"

integer

Adapter port on which the virtual interface will be created.

Only applicable for Standalone and UnifiedEdgeServer platforms.

Choices:

  • 0 ← (default)

  • 1

  • 2

  • 3

vhba_type

string

vHBA Type configuration for SAN Connectivity Policy.

This configuration is supported only on Cisco VIC 14XX series and higher series of adapters.

Required when vHBA state is present.

Choices:

  • "fc-initiator"

  • "fc-nvme-initiator"

  • "fc-nvme-target"

  • "fc-target"

wwpn_address_type

string

Type of WWPN address assignment.

pool to use a WWPN pool.

static to manually assign a static WWPN address.

Only applicable for fiattached target platform.

Choices:

  • "pool" ← (default)

  • "static"

wwpn_pool

string

The WWPN pool used for assigning the WWPN address to the vHBA.

Required when wwpn_address_type is pool and target platform is fiattached.

Only applicable for fiattached target platform.

wwnn_address_type

string

Type of WWNN address assignment.

pool to use a WWNN pool.

static to manually assign a static WWNN address.

Only applicable when target_platform is fiattached.

Choices:

  • "pool" ← (default)

  • "static"

wwnn_pool

string

The WWNN pool that is assigned for WWNN address assignment.

Required when wwnn_address_type is pool and target platform is fiattached.

Only applicable for fiattached target platform.

Examples

- name: Create a SAN Connectivity Policy for Standalone servers
  cisco.intersight.intersight_san_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "standalone-san-policy"
    description: "SAN connectivity policy for standalone servers"
    target_platform: "standalone"
    tags:
      - Key: "Environment"
        Value: "Production"
      - Key: "Site"
        Value: "DataCenter-A"
    vhbas:
      - name: "vhba0"
        vhba_type: "fc-initiator"
        slot_id: "1"
        pci_link: 0
        uplink_port: 0
        pci_order: 0
        persistent_lun_bindings: false
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
      - name: "vhba1"
        vhba_type: "fc-nvme-initiator"
        slot_id: "4"
        pci_link: 0
        uplink_port: 2
        pci_order: 5
        persistent_lun_bindings: true
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
    state: present

- name: Create a SAN Connectivity Policy with auto placement
  cisco.intersight.intersight_san_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "auto-placement-san-policy"
    description: "SAN policy with automatic vHBA placement"
    target_platform: "fiattached"
    placement_mode: "auto"
    wwnn_address_type: "pool"
    wwnn_pool: "default-wwnn-pool"
    vhbas:
      - name: "vhba-auto-1"
        vhba_type: "fc-initiator"
        wwpn_address_type: "pool"
        wwpn_pool: "default-wwpn-pool"
        switch_id: "a"
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
      - name: "vhba-auto-2"
        vhba_type: "fc-initiator"
        wwpn_address_type: "pool"
        wwpn_pool: "default-wwpn-pool"
        switch_id: "b"
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
    state: present

- name: Create a SAN Connectivity Policy for FI-Attached servers with WWNN pool
  cisco.intersight.intersight_san_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fi-attached-san-policy"
    description: "SAN connectivity policy for FI-attached servers"
    target_platform: "fiattached"
    placement_mode: "custom"
    wwnn_address_type: "pool"
    wwnn_pool: "default-wwnn-pool"
    tags:
      - Key: "Environment"
        Value: "Production"
    vhbas:
      - name: "vhba-a"
        vhba_type: "fc-initiator"
        wwpn_address_type: "pool"
        wwpn_pool: "default-wwpn-pool"
        switch_id: "a"
        auto_slot_id: true
        auto_pci_link: true
        pci_order: 0
        persistent_lun_bindings: false
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
        fibre_channel_zone_policies:
          - "fc-zone-policy-1"
      - name: "vhba-b"
        vhba_type: "fc-initiator"
        wwpn_address_type: "pool"
        wwpn_pool: "default-wwpn-pool"
        switch_id: "b"
        auto_slot_id: true
        auto_pci_link: true
        pci_order: 1
        persistent_lun_bindings: false
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
        fibre_channel_zone_policies:
          - "fc-zone-policy-1"
    state: present

- name: Create a SAN Connectivity Policy for FI-Attached with static WWPN
  cisco.intersight.intersight_san_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fi-attached-static-san-policy"
    description: "SAN connectivity policy with static addresses"
    target_platform: "fiattached"
    placement_mode: "custom"
    wwnn_address_type: "pool"
    wwnn_pool: "default-wwnn-pool"
    vhbas:
      - name: "vhba-static"
        vhba_type: "fc-target"
        wwpn_address_type: "static"
        static_wwpn_address: "50:00:00:00:00:00:00:00"
        switch_id: "b"
        auto_slot_id: false
        slot_id: "2"
        auto_pci_link: false
        pci_link_assignment_mode: "load-balanced"
        pci_order: 1
        persistent_lun_bindings: true
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
        fibre_channel_zone_policies:
          - "fc-zone-policy-1"
    state: present

- name: Create a SAN Connectivity Policy for FI-Attached with advanced placement
  cisco.intersight.intersight_san_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fi-attached-advanced-placement"
    description: "SAN connectivity with custom placement"
    target_platform: "fiattached"
    placement_mode: "custom"
    wwnn_address_type: "static"
    static_wwnn_address: "20:00:00:25:B5:00:00:01"
    vhbas:
      - name: "vhba-custom"
        vhba_type: "fc-initiator"
        wwpn_address_type: "pool"
        wwpn_pool: "wwpn-pool"
        switch_id: "a"
        auto_slot_id: false
        slot_id: "MLOM"
        auto_pci_link: false
        pci_link_assignment_mode: "custom"
        pci_link: 1
        pci_order: 3
        persistent_lun_bindings: false
        pin_group_name: "pingroup-a"
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
    state: present

- name: Create a SAN Connectivity Policy for Unified Edge Server
  cisco.intersight.intersight_san_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "unified-edge-san-policy"
    description: "SAN connectivity policy for unified edge servers"
    target_platform: "unified"
    vhbas:
      - name: "vhba-edge"
        vhba_type: "fc-initiator"
        slot_id: "1"
        pci_link: 0
        uplink_port: 0
        pci_order: 0
        persistent_lun_bindings: false
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
    state: present

- name: Update SAN connectivity policy - manage vHBA states
  cisco.intersight.intersight_san_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "mixed-vhba-states-policy"
    description: "Policy demonstrating vHBA state management"
    target_platform: "standalone"
    vhbas:
      - name: "vhba0"
        vhba_type: "fc-initiator"
        slot_id: "1"
        pci_link: 0
        uplink_port: 0
        pci_order: 0
        persistent_lun_bindings: false
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
        state: present
      - name: "vhba-old"
        state: absent
      - name: "vhba-new"
        vhba_type: "fc-nvme-initiator"
        slot_id: "3"
        pci_link: 0
        uplink_port: 1
        pci_order: 1
        persistent_lun_bindings: true
        fibre_channel_network_policy: "fc-network-policy"
        fibre_channel_qos_policy: "fc-qos-policy"
        fibre_channel_adapter_policy: "fc-adapter-policy"
        state: present
    state: present

- name: Delete a SAN Connectivity Policy
  cisco.intersight.intersight_san_connectivity_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "old-san-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": "fi-attached-san-policy", "ObjectType": "vnic.SanConnectivityPolicy", "Tags": [{"Key": "Environment", "Value": "Production"}], "TargetPlatform": "FIAttached", "WwnnAddressType": "POOL", "vHBAs": [{"Name": "vhba-a", "ObjectType": "vnic.FcIf", "Order": 0, "Placement": {"AutoPciLink": true, "AutoSlotId": true, "SwitchId": "A"}, "Type": "fc-initiator"}]}}

Authors

  • Ron Gershburg (@rgershbu)