nsxt_logical_ports – Create a Logical Port

New in version 2.7.

Synopsis

  • Creates a new logical switch port. The required parameters are the associated logical_switch_id and admin_state (UP or DOWN). Optional parameters are the attachment and switching_profile_ids. If you don’t specify switching_profile_ids, default switching profiles are assigned to the port. If you don’t specify an attachment, the switch port remains empty. To configure an attachment, you must specify an id, and optionally you can specify an attachment_type (VIF or LOGICALROUTER). The attachment_type is VIF by default.

Parameters

Parameter Choices/Defaults Comments
address_bindings
array of PacketAddressClassifier
Address bindings for logical port
admin_state
string / required
Represents Desired state of the logical port
attachment
dictionary
Logical port attachment
description
string
Description of the resource
display_name
string / required
Display name
extra_configs
array of ExtraConfig
This property could be used for vendor specific configuration in key value string pairs. Logical port setting will override logical switch setting if the same key was set on both logical switch and logical port.
hostname
string / required
Deployed NSX manager hostname.
ignore_address_bindings
array of PacketAddressClassifier
IP Discovery module uses various mechanisms to discover address bindings being used on each port. If a user would like to ignore any specific discovered address bindings or prevent the discovery of a particular set of discovered bindings, then those address bindings can be provided here. Currently IP range in CIDR format is not supported.
init_state
string
Set initial state when a new logical port is created. 'UNBLOCKED_VLAN' means new port will be unblocked on traffic in creation, also VLAN will be set with corresponding logical switch setting.
logical_switch_name
string / required
Name of logical Switch
password
string / required
The password to authenticate with the NSX manager.
state
- / required
    Choices:
  • present
  • absent
State can be either 'present' or 'absent'. 'present' is used to create or update resource. 'absent' is used to delete resource.
switching_profiles
list
List of Switching Profiles name and type
tags
string
Opaque identifiers meaningful to the API user
username
string / required
The username to authenticate with the NSX manager.

Examples

- name: Create a Logical Port
  nsxt_logical_ports:
      hostname: "10.192.167.137"
      username: "admin"
      password: "Admin!23Admin"
      validate_certs: False
      logical_switch_name: LS1
      attachment:
        attachment_type: VIF
        id: vif1
      admin_state: UP
      state: "present"

Status

  • This module is not guaranteed to have a backwards compatible interface. [preview]

  • This module is maintained by the Ansible Community. [community]

Authors

  • Rahul Raghuvanshi