Skip to content

rename windows template fails when tpm is enabled #766

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

Open
gstorme opened this issue May 18, 2025 · 0 comments
Open

rename windows template fails when tpm is enabled #766

gstorme opened this issue May 18, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@gstorme
Copy link

gstorme commented May 18, 2025

SUMMARY

Trying to rename a template with Windows as guest OS.
This fails with Cannot edit Template. TPM device is required by the guest OS.
I'm not changing anything related to TPM, I only want to rename the template.

COMPONENT NAME

ovirt_template

STEPS TO REPRODUCE
- name: Lookup id for latest template
  ovirt.ovirt.ovirt_template_info:
    auth: "{{ ovirt_auth }}"
    pattern: name=windows2025*_latest
  register: result

- name: Rename latest template to previous
  ovirt.ovirt.ovirt_template:
    auth: "{{ ovirt_auth }}"
    id: "{{ result.ovirt_templates[0].id }}"
    name: windows2025-template_previous
EXPECTED RESULTS

Template windows2025-template_latest is renamed to windows2025-template_previous

ACTUAL RESULTS
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_ovirt.ovirt.ovirt_template_payload_twnd0vo1/ansible_ovirt.ovirt.ovirt_template_payload.zip/ansible_collections/ovirt/ovirt/plugins/modules/ovirt_template.py", line 1056, in main
  File "/tmp/ansible_ovirt.ovirt.ovirt_template_payload_twnd0vo1/ansible_ovirt.ovirt.ovirt_template_payload.zip/ansible_collections/ovirt/ovirt/plugins/module_utils/ovirt.py", line 648, in create
    updated_entity = entity_service.update(
                     ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gregory/.local/lib/python3.11/site-packages/ovirtsdk4/services.py", line 29215, in update
    return self._internal_update(template, headers, query, wait)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gregory/.local/lib/python3.11/site-packages/ovirtsdk4/service.py", line 253, in _internal_update
    return future.wait() if wait else future
           ^^^^^^^^^^^^^
  File "/home/gregory/.local/lib/python3.11/site-packages/ovirtsdk4/service.py", line 55, in wait
    return self._code(response)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/gregory/.local/lib/python3.11/site-packages/ovirtsdk4/service.py", line 250, in callback
    self._check_fault(response)
  File "/home/gregory/.local/lib/python3.11/site-packages/ovirtsdk4/service.py", line 132, in _check_fault
    self._raise_error(response, body)
  File "/home/gregory/.local/lib/python3.11/site-packages/ovirtsdk4/service.py", line 118, in _raise_error
    raise error
ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot edit Template. TPM device is required by the guest OS.]". HTTP response code is 409.
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_partial_import": null,
            "ballooning_enabled": null,
            "bios_type": null,
            "boot_menu": null,
            "clone_name": null,
            "clone_permissions": null,
            "cloud_init": null,
            "cloud_init_nics": [],
            "cluster": null,
            "cluster_mappings": [],
            "cpu_profile": null,
            "description": null,
            "domain_mappings": [],
            "exclusive": null,
            "export_domain": null,
            "fetch_nested": false,
            "id": "8d95ec46-285f-4a66-aa24-e59c50dcdd8c",
            "image_disk": null,
            "image_provider": null,
            "io_threads": null,
            "kvm": null,
            "memory": null,
            "memory_guaranteed": null,
            "memory_max": null,
            "name": "windows2025-template_previous",
            "nested_attributes": [],
            "nics": [],
            "operating_system": null,
            "poll_interval": 3,
            "role_mappings": [],
            "seal": null,
            "smartcard_enabled": null,
            "soundcard_enabled": null,
            "sso": null,
            "state": "present",
            "storage_domain": null,
            "sysprep": null,
            "template_image_disk_name": null,
            "timeout": 180,
            "timezone": null,
            "usb_support": null,
            "version": null,
            "vm": null,
            "vnic_profile_mappings": [],
            "wait": true
        }
    },
    "msg": "Fault reason is \"Operation Failed\". Fault detail is \"[Cannot edit Template. TPM device is required by the guest OS.]\". HTTP response code is 409."
}
@gstorme gstorme added the bug Something isn't working label May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant