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

terraform apply fails when creating a VM with vdisks in a non-default selfservice container where the container uuid is specified. #471

Open
smandar-git opened this issue Jun 28, 2022 · 2 comments

Comments

@smandar-git
Copy link

Nutanix Cluster Information

Terraform Version v1.2.3

Affected Resource(s)

VM not created if vdisk target is to be in a custom container ( non-default)

  • nutanix_XXXXX

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
terraform {
  required_providers {
    nutanix = {
      source  = "nutanix/nutanix"
      version = "1.5.0"
    }
  }
}

data "nutanix_cluster" "cluster" {
  name = var.cluster_name
}
data "nutanix_subnet" "subnet" {
  #subnet_name = var.subnet_name
   subnet_id = var.subnet_uuid
}

provider "nutanix" {
  username     = var.user
  password     = var.password
  endpoint     = var.endpoint
  insecure     = true
  session_auth = false
  wait_timeout = 60
  port         = var.https_port
}

#resource "nutanix_image" "image" {
 # name        = "Arch Linux"
  #description = "Arch-Linux-x86_64-basic-20210401.18564"
  #source_uri  = "https://mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-basic-20210415.20050.qcow2"
#}

resource "nutanix_virtual_machine" "testvm1" {
  name                 = "testvm1"
  cluster_uuid         =  var.cluster_uuid
  num_vcpus_per_socket = "2"
  num_sockets          = "1"
  memory_size_mib      = 1024

  #disk_list {
    #data_source_reference = {
     # kind = "image"
      #uuid = nutanix_image.image.id
    #}
  #}

  disk_list {
   storage_config {
      storage_container_reference {
      kind = "storage_container"
      uuid = var.storage_container_uuid
                              }
                 }
            }
  
  # disk_list {
  #   #disk_size_bytes = 10 * 1024 * 1024 * 1024
  #   disk_size_mib  = 1024000
  #   device_properties {
  #    device_type = "DISK"
  #     disk_address = {
  #     "adapter_type" = "SCSI"
  #     "device_index" = "1"
  #    }
  #  }
  # }
  nic_list {
    subnet_uuid = var.subnet_uuid
  }
}

# please use a service like Dropbox and share a link to the ZIP file.

Debug Output

Panic Output

Expected Behavior

VM must have ben created

Actual Behavior

VM creation failed

Steps to Reproduce

try creating VM with a container specified with its UUID
  1. terraform apply

Important Factors

  • #0000 <!---Github Issue number --->
@abhimutant abhimutant self-assigned this Jul 18, 2022
@abhimutant abhimutant removed the 1.7 label Mar 15, 2023
@abhimutant
Copy link
Collaborator

Hi, Still are you facing this issue ?

@mvelascojr
Copy link

Hi, i have a similar issue the terraform provider only creates the vm on "SelfServiceContainer" even if i specify another storage_container. Should i create another issue ?

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

No branches or pull requests

3 participants