Giter VIP home page Giter VIP logo

Comments (4)

shznkym avatar shznkym commented on August 11, 2024

curl -k -u 'admin:password' -X GET "https://192.168.68.120/api/v1/host-switch-profiles"

{
"results" : [ {
"teaming" : {
"policy" : "FAILOVER_ORDER",
"active_list" : [ {
"uplink_name" : "uplink-1",
"uplink_type" : "PNIC"
} ]
},
"named_teamings" : [ ],
"transport_vlan" : 0,
"overlay_encap" : "GENEVE",
"resource_type" : "UplinkHostSwitchProfile",
"id" : "325b48e7-3f9b-4aea-b8e2-de8f44aa003a",
"display_name" : "uplink-profile-edge",
"description" : "",
"tags" : [ ],
"_create_user" : "admin",
"_create_time" : 1714630750441,
"_last_modified_user" : "admin",
"_last_modified_time" : 1718008778264,
"_system_owned" : false,
"_protection" : "NOT_PROTECTED",
"_revision" : 4
}, {
"teaming" : {
"policy" : "FAILOVER_ORDER",
"active_list" : [ {
"uplink_name" : "uplink-1",
"uplink_type" : "PNIC"
} ],
"standby_list" : [ {
"uplink_name" : "uplink-2",
"uplink_type" : "PNIC"
} ]
},
"named_teamings" : [ ],
"transport_vlan" : 0,
"overlay_encap" : "GENEVE",
"resource_type" : "UplinkHostSwitchProfile",
"id" : "18717311-f4f5-4c3a-8958-158643182ab4",
"display_name" : "uplink-profile-esxi",
"description" : "",
"tags" : [ ],
"_create_user" : "admin",
"_create_time" : 1714627581116,
"_last_modified_user" : "admin",
"_last_modified_time" : 1718008815292,
"_system_owned" : false,
"_protection" : "NOT_PROTECTED",
"_revision" : 8
} ],
"result_count" : 2,
"sort_by" : "display_name",
"sort_ascending" : true
}%

from terraform-provider-nsxt.

annakhm avatar annakhm commented on August 11, 2024

Hi @shznkym, looks like you are trying to pull non-policy object api/v1/host-switch-profiles with policy API.
Corresponding policy object would reside under API policy/api/v1/host-switch-profiles.
Sorry for the duplication of APIs, this is indeed confusing, however this is what we have today. Eventually all APIs are expected to move to policy and non-policy ones will be deprecated and then removed.
Hope this helps

from terraform-provider-nsxt.

shznkym avatar shznkym commented on August 11, 2024
  • Variable Confirmation
XXXXX terraform % terraform state list
data.nsxt_compute_manager.vc1
data.nsxt_policy_ip_pool.ip-pool
data.nsxt_policy_transport_zone.overlaytz
data.nsxt_policy_transport_zone.vlantz
**data.nsxt_policy_uplink_host_switch_profile.uplink-profile**
data.vsphere_compute_cluster.compute_cluster1
data.vsphere_datacenter.dc
data.vsphere_datastore.datastore1
data.vsphere_host.host1
data.vsphere_network.network1
nsxt_edge_transport_node.edge3
snakayama@J7W7NLWFQD terraform % 

XXXXX terraform % terraform state show **data.nsxt_policy_uplink_host_switch_profile.uplink-profile**
# data.nsxt_policy_uplink_host_switch_profile.uplink-profile:
data "nsxt_policy_uplink_host_switch_profile" "uplink-profile" {
    description  = null
    display_name = "uplink-profile"
    id           = "da09c60c-69f4-4729-a63b-6e506866aabe"
    **path         = "/infra/host-switch-profiles/da09c60c-69f4-4729-a63b-6e506866aabe"**
}
XXXXX terraform % 
  • Configuration file that worked well
data **"nsxt_policy_uplink_host_switch_profile" "uplink-profile"** {
  display_name = "uplink-profile"
}

resource "nsxt_edge_transport_node" "edge3" {
  description  = "Terraform-deployed edge node"
  display_name = "edge3"
  standard_host_switch {
    ip_assignment {
      static_ip_pool = data.nsxt_policy_ip_pool.ip-pool.realized_id
    }
    transport_zone_endpoint {
      transport_zone          = data.nsxt_policy_transport_zone.vlantz.id
    }
    transport_zone_endpoint {
      transport_zone          = data.nsxt_policy_transport_zone.overlaytz.id
    }

    **host_switch_profile = [data.nsxt_policy_uplink_host_switch_profile.uplink-profile.path]**
    pnic {
      device_name = "fp-eth0"
      uplink_name = "uplink-1"
    }
  }
  • Comparison of documentation and settings

Document [It didn't work.]

> https://registry.terraform.io/providers/vmware/nsxt/latest/docs/resources/edge_transport_node
> 
> [host_switch_profile]
>  (Optional) Identifiers of host switch profiles to be associated with this host switch.

    **host_switch_profile = [nsxt_policy_uplink_host_switch_profile.hsw_profile1.id]**
    pnic {
      device_name = "fp-eth0"
      uplink_name = "uplink1"
    }

[It worked.]

    **host_switch_profile = [data.nsxt_policy_uplink_host_switch_profile.uplink-profile.path]**
    pnic {
      device_name = "fp-eth0"
      uplink_name = "uplink-1"
    }

=================

The host_switch_profile should be rewritten in the document, as it is correct to specify the [path], not the [id].

id = "da09c60c-69f4-4729-a63b-6e506866aabe"
path = "/infra/host-switch-profiles/da09c60c-69f4-4729-a63b-6e506866aabe

from terraform-provider-nsxt.

annakhm avatar annakhm commented on August 11, 2024

Thank you, indeed documentation should be fixed

from terraform-provider-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.