Giter Club home page Giter Club logo

Comments (1)

alexfeig avatar alexfeig commented on July 27, 2024

Hi, I just had this happen to me with UplinkHostSwitchProfile as well, so I tested to check if NiocProfile or LldpHostSwitchProfile would fail, and they did.

Error:

<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /Users/alexf/.ansible/tmp/ansible-tmp-1565116543.08-219395642106366/ > /dev/null 2>&1 && sleep 0'
failed: [localhost] (item={u'host_switches': [{u'pnics': [{u'uplink_name': u'uplink-1', u'device_name': u'vmnic1'}], u'host_switch_name': u'overlay-nvds', u'host_switch_profiles': [{u'type': u'UplinkHostSwitchProfile', u'name': u'nsx-edge-single-nic-uplink-profile'}, {u'type': u'NiocProfile', u'name': u'nsx-default-nioc-hostswitch-profile'}, {u'type': u'LldpHostSwitchProfile', u'name': u'LLDP [Send Packet Enabled]'}], u'ip_assignment_spec': {u'resource_type': u'StaticIpPoolSpec', u'ip_pool_name': u'tep-pool'}}, {u'pnics': [{u'uplink_name': u'uplink-1', u'device_name': u'vmnic0'}], u'host_switch_name': u'overlay-nvds', u'host_switch_profiles': [{u'type': u'UplinkHostSwitchProfile', u'name': u'nsx-edge-single-nic-uplink-profile'}, {u'type': u'NiocProfile', u'name': u'nsx-default-nioc-hostswitch-profile'}, {u'type': u'LldpHostSwitchProfile', u'name': u'LLDP [Send Packet Enabled]'}], u'ip_assignment_spec': {u'resource_type': u'AssignedByDhcp'}, u'vmk_install_migration': [{u'destination_network': u'a222ef22-3bff-42c2-9aff-1c91b3878fdc', u'device_name': u'vmk0'}]}], u'display_name': u'tn-profile', u'transport_zone_endpoints': [{u'transport_zone_name': u'overlay-tz'}, {u'transport_zone_name': u'vlan-tz'}]}) => {
    "ansible_loop_var": "item", 
    "changed": false, 
    "invocation": {
        "module_args": {
            "description": null, 
            "display_name": "tn_profile", 
            "host_switch_spec": {
                "host_switches": [
                    {
                        "host_switch_name": "overlay-nvds", 
                        "ip_assignment_spec": {
                            "ip_pool_name": "tep-pool", 
                            "resource_type": "StaticIpPoolSpec"
                        }, 
                        "pnics": [
                            {
                                "device_name": "vmnic1", 
                                "uplink_name": "uplink-1"
                            }
                        ]
                    }, 
                    {
                        "host_switch_name": "overlay-nvds", 
                        "host_switch_profiles": [
                            {
                                "name": "nsx-edge-single-nic-uplink-profile", 
                                "type": "UplinkHostSwitchProfile"
                            }, 
                            {
                                "name": "nsx-default-nioc-hostswitch-profile", 
                                "type": "NiocProfile"
                            }, 
                            {
                                "name": "LLDP [Send Packet Enabled]", 
                                "type": "LldpHostSwitchProfile"
                            }
                        ], 
                        "ip_assignment_spec": {
                            "resource_type": "AssignedByDhcp"
                        }, 
                        "pnics": [
                            {
                                "device_name": "vmnic0", 
                                "uplink_name": "uplink-1"
                            }
                        ], 
                        "vmk_install_migration": [
                            {
                                "destination_network": "a222ef22-3bff-42c2-9aff-1c91b3878fdc", 
                                "device_name": "vmk0"
                            }
                        ]
                    }
                ], 
                "resource_type": "StandardHostSwitchSpec"
            }, 
            "hostname": "192.168.50.156", 
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "port": 443, 
            "resource_type": "TransportNodeProfile", 
            "state": "present", 
            "transport_zone_endpoints": [
                {
                    "transport_zone_name": "overlay-tz"
                }, 
                {
                    "transport_zone_name": "vlan-tz"
                }
            ], 
            "username": "admin", 
            "validate_certs": false
        }
    }, 
    "item": {
        "display_name": "tn-profile", 
        "host_switches": [
            {
                "host_switch_name": "overlay-nvds", 
                "host_switch_profiles": [
                    {
                        "name": "nsx-edge-single-nic-uplink-profile", 
                        "type": "UplinkHostSwitchProfile"
                    }, 
                    {
                        "name": "nsx-default-nioc-hostswitch-profile", 
                        "type": "NiocProfile"
                    }, 
                    {
                        "name": "LLDP [Send Packet Enabled]", 
                        "type": "LldpHostSwitchProfile"
                    }
                ], 
                "ip_assignment_spec": {
                    "ip_pool_name": "tep-pool", 
                    "resource_type": "StaticIpPoolSpec"
                }, 
                "pnics": [
                    {
                        "device_name": "vmnic1", 
                        "uplink_name": "uplink-1"
                    }
                ]
            }, 
            {
                "host_switch_name": "overlay-nvds", 
                "host_switch_profiles": [
                    {
                        "name": "nsx-edge-single-nic-uplink-profile", 
                        "type": "UplinkHostSwitchProfile"
                    }, 
                    {
                        "name": "nsx-default-nioc-hostswitch-profile", 
                        "type": "NiocProfile"
                    }, 
                    {
                        "name": "LLDP [Send Packet Enabled]", 
                        "type": "LldpHostSwitchProfile"
                    }
                ], 
                "ip_assignment_spec": {
                    "resource_type": "AssignedByDhcp"
                }, 
                "pnics": [
                    {
                        "device_name": "vmnic0", 
                        "uplink_name": "uplink-1"
                    }
                ], 
                "vmk_install_migration": [
                    {
                        "destination_network": "a222ef22-3bff-42c2-9aff-1c91b3878fdc", 
                        "device_name": "vmk0"
                    }
                ]
            }
        ], 
        "transport_zone_endpoints": [
            {
                "transport_zone_name": "overlay-tz"
            }, 
            {
                "transport_zone_name": "vlan-tz"
            }
        ]
    }, 
    "msg": "No id exist with display name nsx-edge-single-nic-uplink-profile"
}

Task:

- name: Create Transport Node Profile
  nsxt_transport_node_profiles:
    hostname: "{{ nsx_ipaddress }}"
    username: "admin"
    password: "{{ nsx_password }}"
    validate_certs: False
    resource_type: TransportNodeProfile
    display_name: "tn_profile"
    host_switch_spec:
      resource_type: StandardHostSwitchSpec
      host_switches: "{{ item.host_switches }}"
    transport_zone_endpoints: "{{ item.transport_zone_endpoints }}"
    state: present
  with_items:
    - "{{ transport_node_profiles }}"

Variables:

{
    "transport_node_profiles": [{
        "display_name": "tn-profile",
        "host_switches": [{
                "host_switch_profiles": [{
                        "name": "nsx-edge-single-nic-uplink-profile",
                        "type": "UplinkHostSwitchProfile"
                    },
                    {
                        "name": "nsx-default-nioc-hostswitch-profile",
                        "type": "NiocProfile"
                    },
                    {
                        "name": "LLDP [Send Packet Enabled]",
                        "type": "LldpHostSwitchProfile"
                    }
                ],
                "host_switch_name": "overlay-nvds",
                "pnics": [{
                    "device_name": "vmnic1",
                    "uplink_name": "uplink-1"
                }],
                "ip_assignment_spec": {
                    "resource_type": "StaticIpPoolSpec",
                    "ip_pool_name": "tep-pool"
                }
            }, {
                "host_switch_profiles": [{
                        "name": "nsx-edge-single-nic-uplink-profile",
                        "type": "UplinkHostSwitchProfile"
                    },
                    {
                        "name": "nsx-default-nioc-hostswitch-profile",
                        "type": "NiocProfile"
                    },
                    {
                        "name": "LLDP [Send Packet Enabled]",
                        "type": "LldpHostSwitchProfile"
                    }
                ],
                "host_switch_name": "overlay-nvds",
                "pnics": [{
                    "device_name": "vmnic0",
                    "uplink_name": "uplink-1"
                }],
                "ip_assignment_spec": {
                    "resource_type": "AssignedByDhcp"
                },
                "vmk_install_migration" : [ {
                    "device_name" : "vmk0",
                    "destination_network" : "a222ef22-3bff-42c2-9aff-1c91b3878fdc"
                } ]
            }
        ],
        "transport_zone_endpoints": [{
                "transport_zone_name": "overlay-tz"
            },
            {
                "transport_zone_name": "vlan-tz"
            }
        ]
    }]
}

from ansible-for-nsxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.