Comments (4)
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.
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.
- 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.
Thank you, indeed documentation should be fixed
from terraform-provider-nsxt.
Related Issues (20)
- Cannot add virtual_server condition based on Client SSL
- Possibility to configure DHCP relay on tier1-gateway interface level
- Can not find VM with the ID xxxxxxxxx HOT 13
- Incomplete documentation on how to configure static IP for TEP interfaces HOT 3
- nsx_edge_transport_node deploy failures (crash on syslog port + root object absent) HOT 1
- SNI certificates fail to be configured on the remote resource for nsxt_policy_lb_virtual_server HOT 3
- Add possibility to pass pre negociated token for authentification
- data nsxt_policy_vm fails to find VM in large (1k+) VM environment HOT 1
- Add the ability to create pollicy groups that are of the "IP Address Only" type.
- nsx_edge_transport_node deploy failure (root object absent) HOT 6
- nsxt_policy_tier0_inter_vrf_routing bgp_route_leaking in_filter and out_filter HOT 2
- nsxt_policy_project short_id is not marked ForceNew HOT 6
- Beta resource nsxt_policy_security_policy_rule misses certain configuration changes made outside of Terraform HOT 1
- visibility not set on creation of nsxt_policy_ip_block HOT 5
- Apply security policy to Antrea Container Clusters HOT 2
- MIssing resources for policy loadbalancers (profiles and monitors) HOT 3
- nsxt_policy_group member_type policy evolve HOT 2
- Custom Context Profiles with custom attributes HOT 2
- Add 'nat_type' in resource 'nsxt_policy_nat_rule' (INTERNAL, USER, DEFAULT) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-nsxt.