Skip to content
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

Undefined property is_connected of class vm_nic detected #90

Closed
mwarner1 opened this issue Dec 16, 2019 · 7 comments
Closed

Undefined property is_connected of class vm_nic detected #90

mwarner1 opened this issue Dec 16, 2019 · 7 comments

Comments

@mwarner1
Copy link

The Terraform Nutanix provider is sending is_connected as part of the "nic_list" stanza, but at least with REST API version 3.1, this is not allowed. Manually sending the Terraform-generated JSON after deleting the is_connected succeeds.

Expected behavior
VM should be provisioned.

Logs
Debug output attached
logs.txt

Versions (please complete the following information):

  • OS that is executing Terraform: Mac OS X 10.15.1
  • Terraform 0.12.18
  • Nutanix Cluster (Prism Element / AOS) AOS euphrates-5.9.2.4-stable
  • Nutanix Prism Central 5.10.6
  • Terraform provider version provider.nutanix v1.0.2

Additional context
None

@PacoDw
Copy link
Contributor

PacoDw commented Apr 22, 2020

Hello, @mwarner1. The VM resource has had changes, so could check/test if the same error persists on the master branch?
Also, if so, could you share your TF configuration omitting sensitive data?

If you have another comment or concern, just let me know, thank you so much

@coderGo93
Copy link
Contributor

Hi, @mwarner1 , I tested with a similar config you shared in log, it didn't appear some error, I mean it worked for me, like @PacoDw said, is because VM had changes and maybe it fixed that, could you please check if it's working for you on master?

@mwarner1
Copy link
Author

Unfortunately I no longer have access to that environment so I cannot test it.

@coderGo93
Copy link
Contributor

Thank you for your reply @mwarner1 , I see, can you share the config file without sensitive data? So I can be sure if I tested with a similar config like yours or test it for you and can this ticket can be closed?

@coderGo93
Copy link
Contributor

Hello @mwarner1 , this is the config file I used to test, not sure if it's similar when you tried.

data "nutanix_clusters" "clusters" {}
		locals {
			cluster1 = [
				for cluster in data.nutanix_clusters.clusters.entities :
				cluster.metadata.uuid if cluster.service_list[0] != "PRISM_CENTRAL"
			][0]
		}

		resource "nutanix_subnet" "sub" {
			cluster_uuid = "${local.cluster1}"

			# General Information for subnet
			name        = "terraform-vm-with-subnet-%[1]d"
			description = "Description of my unit test VLAN"
			vlan_id     = %[1]d
			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 = "11.250.140.200"
			}
			dhcp_domain_name_server_list = ["8.8.8.8", "4.2.2.2"]
			dhcp_domain_search_list      = ["terraform.nutanix.com", "terraform.test.com"]
			ip_config_pool_list_ranges   = ["11.250.140.20 11.250.140.100"]
		}

		resource "nutanix_image" "cirros-034-disk" {
			name        = "test-image-%[1]d"
			source_uri  = "http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img"
			description = "heres a tiny linux image, not an iso, but a real disk!"
		}

		resource "nutanix_virtual_machine" "vm3" {
			name = "test-vm-%[1]d"

			categories {
				name  = "Environment"
				value = "Staging"
			}

			cluster_uuid         = "${local.cluster1}"
			num_vcpus_per_socket = 1
			num_sockets          = 1
			memory_size_mib      = 186

			disk_list {
				data_source_reference = {
					kind = "image"
					uuid = "${nutanix_image.cirros-034-disk.id}"
				}
			}

			nic_list {
				subnet_uuid = "${nutanix_subnet.sub.id}"
			}
		}

		output "ip_address" {
			value = "${lookup(nutanix_virtual_machine.vm3.nic_list_status.0.ip_endpoint_list[0], "ip")}"
		}

@mwarner1
Copy link
Author

mwarner1 commented Jun 1, 2020 via email

@coderGo93
Copy link
Contributor

Hello @mwarner1 , thanks for the config, I made test with similar config and it worked for me, I'll close this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants