Skip to content

include name of file(s) or file UUID in exported attributes when creating content library item #2609

@pgsmith123

Description

@pgsmith123

Code of Conduct

  • I have read and agree to the project's Code of Conduct.
  • 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.

Description

When creating a content library item the files have a UUID appended to the file name that is not fetchable anywhere I can find which prevents using the file programmatically.

Use Case(s)

I'm attempting to import a Ubuntu cloud image VMDK into a content library then create a VM using the VMDK.

Potential Configuration

resource "vsphere_content_library_item" "item" {
name = var.item_name
type = "vmdk"
file_url = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.vmdk"
library_id = data.vsphere_content_library.main_templates.id
}

resource "vsphere_virtual_machine" "ubuntu_server_22_04_lts_current_az2" {
name = "ubuntu_server_22_04_lts_current_az2"
resource_pool_id = data.vsphere_compute_cluster.az2-drs02.resource_pool_id
datastore_id = data.vsphere_datastore.GOLD-AZ2-DRS02-DS01.id
num_cpus = var.template_vcpu
memory = var.template_memory
cpu_hot_add_enabled = true
memory_hot_add_enabled = true
guest_id = var.ubuntu_guest_os_type
scsi_type = var.template_scsi_type
folder = "Templates"
wait_for_guest_net_routable = false
wait_for_guest_ip_timeout = 0
wait_for_guest_net_timeout = 0
network_interface {
network_id = data.vsphere_network.az2.id
adapter_type = var.template_adapter_type
}
disk {
label = "Hard Disk 1"
datastore_id = data.vsphere_datastore.GOLD-AZ2-DRS02-DS01.id
attach = true
path = "contentlib-${vsphere_content_library.library.id}/${vsphere_content_library_item.item.id}/${var.item_name}_${vsphere_content_library_item.item.guid}.vmdk"
}
}

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions