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

Unable to upload local .iso with vsphere_content_library_item #1664

Closed
4 tasks done
juanvalino opened this issue Jun 2, 2022 · 3 comments · Fixed by #1665
Closed
4 tasks done

Unable to upload local .iso with vsphere_content_library_item #1664

juanvalino opened this issue Jun 2, 2022 · 3 comments · Fixed by #1665
Assignees
Labels
acknowledged Status: Issue or Pull Request Acknowledged area/content-library Area: Content Library bug Type: Bug community/contribution Community: Contribution Help Wanted confirmed Issue: Confirmed
Milestone

Comments

@juanvalino
Copy link
Contributor

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform

v1.2.1

Terraform Provider

v2.1.1

VMware vSphere

v.7.0.3

Description

Provided does not upload content library items when file_url points to a local path because it tries to parse the iso as a OVF file. The same iso file passed with file_url containing an HTTP url is uploaded correctly.

Affected Resources

resource/vsphere_content_library_item

Terraform Configuration

provider "vsphere" {
  user = var.user
  password= var.password
  vsphere_server=  var.vsphere_server
}

data "vsphere_content_library" "iso_library" {
  name = var.iso_library
}

resource "vsphere_content_library_item" "test_iso" {
  name        = "Test"
  description = "Test"
  file_url    = "/tmp/test.iso"
  library_id  = data.vsphere_content_library.iso_library.id
  type        = "iso"
}

Debug Output

data.vsphere_content_library.iso_library: Reading...
data.vsphere_content_library.iso_library: Read complete after 1s [id=<library_id>]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated
with the following symbols:
  + create

Terraform will perform the following actions:

  # vsphere_content_library_item.test_iso will be created
  + resource "vsphere_content_library_item" "test_iso" {
      + description = "Test"
      + file_url    = "/tmp/test.iso"
      + id          = (known after apply)
      + library_id  = "<library_id>"
      + name        = "Test"
      + type        = "iso"
    }

Plan: 1 to add, 0 to change, 0 to destroy.
vsphere_content_library_item.test_iso: Creating...
╷
│ Error: failed to parse ovf: failed to parse ovf: XML syntax error on line 62: illegal character code U+0000
│ 
│   with vsphere_content_library_item.test_iso,
│   on main.tf line 11, in resource "vsphere_content_library_item" "test_iso":
│   11: resource "vsphere_content_library_item" "test_iso" {
│ 
╵

Panic Output

No response

Expected Behavior

The local iso should be uploaded to content library.

Actual Behavior

The provider tries to parse the iso as a OVF file when you use a local path in file_url. The same iso file passed with file_url containing an HTTP url is uploaded correctly.

Steps to Reproduce

Apply the code snippet provided previosly.

Environment Details

No response

Screenshots

No response

References

No response

@juanvalino juanvalino added bug Type: Bug needs-triage Status: Issue Needs Triage labels Jun 2, 2022
@github-actions github-actions bot removed the bug Type: Bug label Jun 2, 2022
@github-actions
Copy link

github-actions bot commented Jun 2, 2022

Hello,   juanvalino ! 🖐

Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.

If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.

@juanvalino juanvalino changed the title Unable to load local iso with vsphere_content_library_item Unable to upload local iso with vsphere_content_library_item Jun 2, 2022
juanvalino added a commit to juanvalino/terraform-provider-vsphere that referenced this issue Jun 2, 2022
@tenthirtyam tenthirtyam added bug Type: Bug area/content-library Area: Content Library acknowledged Status: Issue or Pull Request Acknowledged community/contribution Community: Contribution Help Wanted labels Jun 2, 2022
@tenthirtyam tenthirtyam added this to the v2.2.0 milestone Jun 2, 2022
@tenthirtyam tenthirtyam changed the title Unable to upload local iso with vsphere_content_library_item Unable to upload local .iso with vsphere_content_library_item Jun 2, 2022
@tenthirtyam tenthirtyam removed the needs-triage Status: Issue Needs Triage label Jun 9, 2022
@tenthirtyam tenthirtyam modified the milestone: v2.2.0 Jun 14, 2022
@tenthirtyam tenthirtyam added the confirmed Issue: Confirmed label Jun 15, 2022
appilon pushed a commit that referenced this issue Jun 15, 2022
@github-actions
Copy link

This functionality has been released in v2.2.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
acknowledged Status: Issue or Pull Request Acknowledged area/content-library Area: Content Library bug Type: Bug community/contribution Community: Contribution Help Wanted confirmed Issue: Confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants