terraform-provider-nutanix icon indicating copy to clipboard operation
terraform-provider-nutanix copied to clipboard

Storage Container issue when using image to create VM disk

Open wanghm opened this issue 4 years ago • 2 comments

Nutanix Cluster Information

Please provide the version of:

  • Nutanix Cluster (Prism Element / AOS 5.17.1.3)
  • Nutanix Prism Central (pc.2020.9.0.1)

Terraform Version

Terraform v0.14.2

  • provider registry.terraform.io/hashicorp/aws v3.21.0
  • provider registry.terraform.io/hashicorp/template v2.2.0
  • provider registry.terraform.io/nutanix/nutanix v1.1.1

Affected Resource(s)

  • nutanix_virtual_machine

Terraform Configuration Files

  // partial code
  disk_list {
    data_source_reference = {
      kind = "image"
      uuid = data.nutanix_image.myImage.id
    }

    device_properties {
      disk_address = {
        device_index = 0
        adapter_type = "SCSI"
      }

      device_type = "DISK"
    }
    storage_config {
      storage_container_reference {
        kind = "storage_container"
        uuid = "c88ad2db-b523-49f0-ae50-32db209c4df3"
      }
    }

  }

https://github.com/wanghm/nutanix_terraform_demo1/blob/master/vms.tf

Description

In the disk configuration, specify a storage container rather than SelfServiceContainer when using image, the disk will be created in SelefServiceContainer without error. This caused difference between code and the deployed infrastructure.

When try plan again, terraform detected changing of container (from SelfServiceContainer to the container specified in the code). Try apply, will get error.

  "message": "Can't change storage container post disk creation.",
  "reason": "ACTION_NOT_SUPPORTED"

Debug Output

https://gist.github.com/wanghm/efa503d5de115417f6dbebc9f0a7db35

wanghm avatar Dec 19 '20 03:12 wanghm

@wanghm same issue over here.

our Infrastructure:

Nutanix Cluster (Prism Element / AOS 5.15.4 LTS)
Nutanix Prism Central (pc.2021.1.0.1)

Terraform Version

Terraform v0.14.8

  • provider registry.terraform.io/hashicorp/template v2.2.0
  • provider registry.terraform.io/nutanix/nutanix v1.2.0

zisuu avatar Mar 22 '21 06:03 zisuu

maybe same topic? https://next.nutanix.com/how-it-works-22/prism-api-v3-image-upload-define-storage-container-37329

zisuu avatar Apr 27 '21 05:04 zisuu