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

Checksum is not considered while uploading image from local using nutanix_image resource #469

Closed
bhati-pradeep opened this issue Jun 23, 2022 · 0 comments · Fixed by #481
Assignees

Comments

@bhati-pradeep
Copy link
Collaborator

Nutanix Cluster Information

PC Version: pc.2022.4

Terraform Version

Terraform v1.1.9
on darwin_amd64
provider registry.terraform.io/nutanix/nutanix v1.5.0

Affected Resource(s)

  • nutanix_image

Terraform Configuration Files

resource "nutanix_image" "image1" {
  name = "check-from-terraform"
  image_type = "ISO_IMAGE"
  source_path = "<local-file-path>"
  checksum = {
      checksum_algorithm = "SHA_1"
      checksum_value = "37e7e3ceacfc6ac20c451fe34ce2c9ec1ef5d6be"
  }
}

output "image1" {
    value = resource.nutanix_image.name
}

Expected Behavior

When we use source_path,

  1. Incase of wrong checksum, post image upload it should fail with wrong checksum error.
  2. Incase of correct checksum, the output of resource must contain the checksum details.
  3. Checksum shouldn't be allowed to update.

Actual Behaviour

When we use source_path,

  1. Incase of wrong checksum, image creation and upload goes fine.
  2. Incase of correct checksum, the output of resource doesn't contain the checksum details.
  3. Checksum is allowed to update.

Steps to Reproduce

  1. terraform apply with above script

Important Factors

Image create using source_uri is working fine.

​RCA for upload image issue:
Incase of image upload from local, checksum in image create is not honoured from PC side. During upload we can set below headers for sending checksum.

X-Nutanix-Checksum-Type: SHA_1/SHA_256
X-Nutanix-Checksum-Bytes: <string>

References

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

Successfully merging a pull request may close this issue.

2 participants