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

Customization of the guest operating system for Ubuntu 24.04 template #2277

Closed
3 of 4 tasks
lazerbeakravage opened this issue Oct 4, 2024 · 7 comments
Closed
3 of 4 tasks
Labels
bug Type: Bug question/provider Question: Provider

Comments

@lazerbeakravage
Copy link

lazerbeakravage commented Oct 4, 2024

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

1.9.7

Terraform Provider

2.8.3, 2.9.2

VMware vSphere

8.0.3 (24262322)

Description

When trying to clone a Ubuntu 24.04.1 template built in packer v1.11.2, I receive the error "Error: error sending customization spec: Customization of the guest operating system is not supported due to the given reason: ".

When I remove the customize block, it the vm deploys successfully. I have tried v2.8.3 and 2.9.2 of the provider

Template details:
GuestId : ubuntu64Guest
HardwareVersion : vmx-19

Affected Resources or Data Sources

resource "vsphere_virtual_machine"

Terraform Configuration

  clone {
    template_uuid = data.vsphere_virtual_machine.template.id
    customize {
      network_interface {}
      linux_options {
        host_name = "testvm"
        domain    = var.vm_domain
      }
    }
  }

Debug Output

2024-10-04T11:07:20.116-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] applyDeviceChange: Device list after changes: ide-200,ide-201,ps2-300,pci-100,sio-400,keyboard-600,pointing-700,video-500,vmci-12000,pvscsi-1000,ahci-15000,disk-1000-0,et
hernet--7: timestamp=2024-10-04T11:07:20.114-0400
2024-10-04T11:07:20.116-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] CdromPostCloneOperation: Post-clone final resource list:: timestamp=2024-10-04T11:07:20.114-0400
2024-10-04T11:07:20.116-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] CdromPostCloneOperation: Device list at end of operation: ide-200,ide-201,ps2-300,pci-100,sio-400,keyboard-600,pointing-700,video-500,vmci-12000,pvscsi-1000,ahci-15000,di
sk-1000-0,ethernet--7: timestamp=2024-10-04T11:07:20.114-0400
2024-10-04T11:07:20.116-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] CdromPostCloneOperation: Device config operations from post-clone: (remove: *types.VirtualCdrom at key 16000): timestamp=2024-10-04T11:07:20.114-0400
2024-10-04T11:07:20.116-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] CdromPostCloneOperation: Operation complete, returning updated spec: timestamp=2024-10-04T11:07:20.114-0400
2024-10-04T11:07:20.116-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] vsphere_virtual_machine (ID = 423a7a04-f14c-ec65-fdb0-ab560f9ab4d8): Final device list: ide-200,ide-201,ps2-300,pci-100,sio-400,keyboard-600,pointing-700,video-500,vmci-1
2000,pvscsi-1000,ahci-15000,disk-1000-0,ethernet--7: timestamp=2024-10-04T11:07:20.115-0400
2024-10-04T11:07:20.116-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] vsphere_virtual_machine (ID = 423a7a04-f14c-ec65-fdb0-ab560f9ab4d8): Final device change cfgSpec: (edit: *types.VirtualDisk at key 2000),(add: *types.VirtualVmxnet3 at ke
y -201),(remove: *types.VirtualVmxnet3 at key 4000),(remove: *types.VirtualCdrom at key 16000): timestamp=2024-10-04T11:07:20.115-0400
2024-10-04T11:07:20.117-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Reconfiguring virtual machine "/Datacenter/vm/testvm": timestamp=2024-10-04T11:07:20.115-0400
2024-10-04T11:07:20.617-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Fetching properties for VM "/Datacenter/vm/testvm": timestamp=2024-10-04T11:07:20.617-0400
2024-10-04T11:07:20.629-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Fetching properties for VM "/Datacenter/vm/testvm": timestamp=2024-10-04T11:07:20.629-0400
2024-10-04T11:07:20.640-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Fetching configuration options for VM "/Datacenter/vm/testvm": timestamp=2024-10-04T11:07:20.639-0400
vsphere_virtual_machine.vm["testvm"]: Still creating... [10s elapsed]
2024-10-04T11:07:20.765-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Found current hardware version: 19: timestamp=2024-10-04T11:07:20.765-0400
2024-10-04T11:07:20.766-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Looking for OS family for guest ID "ubuntu64Guest": timestamp=2024-10-04T11:07:20.765-0400
2024-10-04T11:07:20.843-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] OSFamily: family for "ubuntu64Guest" is "linuxGuest": timestamp=2024-10-04T11:07:20.843-0400
2024-10-04T11:07:20.844-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Sending customization spec to virtual machine "/Datacenter/vm/testvm": timestamp=2024-10-04T11:07:20.844-0400
2024-10-04T11:07:20.886-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] vsphere_virtual_machine (ID = 423a7a04-f14c-ec65-fdb0-ab560f9ab4d8): Performing delete: timestamp=2024-10-04T11:07:20.886-0400
2024-10-04T11:07:20.886-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Locating virtual machine with UUID "423a7a04-f14c-ec65-fdb0-ab560f9ab4d8": timestamp=2024-10-04T11:07:20.886-0400
2024-10-04T11:07:20.887-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Using SearchIndex to look up UUID "423a7a04-f14c-ec65-fdb0-ab560f9ab4d8": timestamp=2024-10-04T11:07:20.886-0400
2024-10-04T11:07:20.908-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] VM "/Datacenter/vm/testvm" found for UUID "423a7a04-f14c-ec65-fdb0-ab560f9ab4d8": timestamp=2024-10-04T11:07:20.908-0400
2024-10-04T11:07:20.909-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Fetching properties for VM "/Datacenter/vm/testvm": timestamp=2024-10-04T11:07:20.908-0400
2024-10-04T11:07:20.922-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] DiskDestroyOperation: Beginning destroy: timestamp=2024-10-04T11:07:20.921-0400
2024-10-04T11:07:20.922-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] DiskDestroyOperation: Detaching devices with keep_on_remove enabled: timestamp=2024-10-04T11:07:20.922-0400
2024-10-04T11:07:20.922-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] DiskDestroyOperation: Device config operations from destroy:: timestamp=2024-10-04T11:07:20.922-0400
2024-10-04T11:07:20.922-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:20 [DEBUG] Deleting virtual machine "/Datacenter/vm/testvm": timestamp=2024-10-04T11:07:20.922-0400
2024-10-04T11:07:21.069-0400 [INFO]  provider.terraform-provider-vsphere_v2.9.2_x5: 2024/10/04 11:07:21 [DEBUG] vsphere_virtual_machine (ID = <new resource>): Delete complete: timestamp=2024-10-04T11:07:21.068-0400
2024-10-04T11:07:21.069-0400 [ERROR] provider.terraform-provider-vsphere_v2.9.2_x5: Response contains error diagnostic: diagnostic_summary="error sending customization spec: Customization of the guest operating system is not supported due to the given reason: " tf_req_id=e6fb388f-c
96f-d30a-9938-1b0923534e11 tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_detail="" diagnostic_severity=ERROR tf_proto_version=5.6 tf_provider_addr=provider tf_resource_type=
vsphere_virtual_machine timestamp=2024-10-04T11:07:21.069-0400
2024-10-04T11:07:21.108-0400 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2024-10-04T11:07:21.108-0400 [ERROR] vertex "vsphere_virtual_machine.vm[\"testvm\"]" error: error sending customization spec: Customization of the guest operating system is not supported due to the given reason:
╷
│ Error: error sending customization spec: Customization of the guest operating system is not supported due to the given reason: 
│
│   with vsphere_virtual_machine.vm["testvm"],
│   on main.tf line 43, in resource "vsphere_virtual_machine" "vm":
│   43: resource "vsphere_virtual_machine" "vm" {
│
╵
2024-10-04T11:07:21.121-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-04T11:07:21.127-0400 [INFO]  provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/hashicorp/vsphere/2.9.2/linux_amd64/terraform-provider-vsphere_v2.9.2_x5 id=96977
2024-10-04T11:07:21.127-0400 [DEBUG] provider: plugin exited

Panic Output

No response

Expected Behavior

The vm should deploy successfully

Actual Behavior

The vm gets clone but then immediately exits with an error
Error: error sending customization spec: Customization of the guest operating system is not supported due to the given reason:

Steps to Reproduce

  • Create a Ubuntu 24.04.1 template in packer
  • Apply the terraform code.

Environment Details

No response

Screenshots

No response

References

No response

@lazerbeakravage lazerbeakravage added bug Type: Bug needs-triage Status: Issue Needs Triage labels Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

Hello, lazerbeakravage! 🖐

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.

@tenthirtyam
Copy link
Collaborator

Is cloud-init disabled in the image you created? If not, you need to customize with cloud-init.

@tenthirtyam tenthirtyam added question/provider Question: Provider and removed needs-triage Status: Issue Needs Triage labels Oct 4, 2024
@lazerbeakravage
Copy link
Author

I converted the template to a vm and yes, it is disabled.

admin@testvm:~$ sudo cloud-init status
status: disabled

@tenthirtyam
Copy link
Collaborator

What's the error in the Task seen in vSphere?

@lazerbeakravage
Copy link
Author

lazerbeakravage commented Oct 4, 2024

Task Name
 Customize virtual machine guest OS
Status

Customization of the guest operating system is not supported due to the given reason:
Tools is not installed in the GuestOS. Please install the latest version of open-vm-tools or VMware Tools to enable GuestCustomization.

Initiator
 [email protected]
Target
 testvm Navigates to Virtual machine
Server
 vsphere.domain.local Navigates to vCenter server
Error stack:
 Tools is not installed in the GuestOS. Please install the latest version of open-vm-tools or VMware Tools to enable GuestCustomization.
Related events:
Date Time	Description
10/04/2024, 11:07:20 AM	Task: Customize virtual machine guest OS

open-vm-tools is installed and enabled

admin@testvm:~$ sudo systemctl status open-vm-tools
● open-vm-tools.service - Service for virtual machines hosted on VMware
     Loaded: loaded (/usr/lib/systemd/system/open-vm-tools.service; enabled; preset: enabled)
     Active: active (running) since Fri 2024-10-04 16:04:08 EDT; 57s ago
       Docs: http://open-vm-tools.sourceforge.net/about.php
   Main PID: 746 (vmtoolsd)
      Tasks: 4 (limit: 2218)
     Memory: 5.7M (peak: 7.9M)
        CPU: 526ms
     CGroup: /system.slice/open-vm-tools.service
             └─746 /usr/bin/vmtoolsd

Oct 04 16:04:08 ubuntu-packer systemd[1]: Started open-vm-tools.service - Service for virtual machines hosted on VMware.

@lazerbeakravage
Copy link
Author

lazerbeakravage commented Oct 7, 2024

Found this and it allowed me to customize my ubuntu template

On further Investigation I found that open-vm-tools does not work until the VM is powered on atleast once.

Copy link

github-actions bot commented Nov 7, 2024

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 Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug question/provider Question: Provider
Projects
None yet
Development

No branches or pull requests

2 participants