-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to obtain Private_IP as a Output #17
Comments
We have the same problem. Please! |
Hello @pbaezab and @joncak, did you assign the IP in the ip_endpoint_list argument? Can I have your configuration when you created the VM? Here is the configuration getting the IP as output. data "nutanix_clusters" "clusters" {}
resource "nutanix_subnet" "sub" {
# What cluster will this VLAN live on?
cluster_reference = {
kind = "cluster"
uuid = "${data.nutanix_clusters.clusters.entities.0.metadata.uuid}"
}
# General Information for subnet
name = "acctest-managed"
description = "Description of my unit test VLAN"
vlan_id = 200
subnet_type = "VLAN"
# Provision a Managed L3 Network
# This bit is only needed if you intend to turn on AHV's IPAM
subnet_ip = "10.250.140.0"
default_gateway_ip = "10.250.140.1"
prefix_length = 24
dhcp_options {
boot_file_name = "bootfile"
domain_name = "nutanix"
tftp_server_name = "10.250.140.200"
}
dhcp_domain_name_server_list = ["8.8.8.8", "4.2.2.2"]
dhcp_domain_search_list = ["terraform.nutanix.com", "terraform.unit.test.com"]
}
resource "nutanix_image" "test" {
name = "Ubuntu-%d"
description = "Ubuntu mini ISO"
source_uri = "http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/mini.iso"
}
resource "nutanix_virtual_machine" "vm" {
count = 1
name = "test-nutanix-vm-${count.index + 1}"
description = "testing vm"
num_vcpus_per_socket = 1
num_sockets = 1
memory_size_mib = 2048
cluster_reference = {
kind = "cluster"
uuid = "${data.nutanix_clusters.clusters.entities.0.metadata.uuid}"
}
nic_list = [{
subnet_reference = {
kind = "subnet"
uuid = "${nutanix_subnet.sub.id}"
}
//Add this parameter to sed the static IP
ip_endpoint_list = {
ip = "10.250.140.${88+count.index}"
type = "ASSIGNED"
}
}]
disk_list = [{
data_source_reference = [{
kind = "image"
uuid = "${nutanix_image.test.id}"
}]
device_properties = [{
device_type = "DISK"
}]
disk_size_mib = 5000
}]
}
output "ip_addressV1" {
value = "${element(nutanix_virtual_machine.vm.*.nic_list.0.ip_endpoint_list.0.ip, 0)}"
} Thanks! |
You can also use this as output: output "ip_address" {
value = "${lookup(nutanix_virtual_machine.vm.nic_list.0.ip_endpoint_list[0], "ip")}"
} |
Hello @marinsalinas, today I get the IP. But provider no waiting for this, then I get IP in second run plan. Thanks. |
Hello @pbaezab, I've added a "wait for IP" function in order to ensure that one IP is got at least in the GetVM request. Can you validate with the new changes on #40? |
@marinsalinas the provider now works fine. Thanks. |
Hi @marinsalinas when we tried to create multiples vm and declare the output with the wildcard the terraform return error in the plan
This is the declaration of the output.
|
Hi @joncak are you using the latest binary from master? |
To due to a inactivity of this issue we will close this ticket, if you still having similar issues like this, plz open a new one. |
Hi, we're unable to get the private IP from the Created VM, the nutanix api its returning the correct value but terraform its getting zero values.
Terraform Version
Terraform Configuration Files
Terraform Debug Output
Nutanix API Response
The text was updated successfully, but these errors were encountered: