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

proxmox_kvm: support for tpmstate0 parameter #6533

Merged
merged 19 commits into from
May 29, 2023

Conversation

J4RF
Copy link
Contributor

@J4RF J4RF commented May 18, 2023

SUMMARY

Adds the tpmstate0 parameter, which is a hash containing two options (storage and version) to configure the TPM state disk. The TPM (Trusted Platform Module) is required for Windows 11 installations.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

proxmox_kvm

ADDITIONAL INFORMATION

Before

changed: [localhost] => {
    "changed": true,
    "devices": {
        "sata0": "STOR1:253/vm-253-disk-1.qcow2",
        "sata1": "local:iso/Win11_22H2_English_x64v1_UEFI.iso"
    },
    "invocation": {
        "module_args": {
            "acpi": null,
            "agent": "True",
            "api_host": "pve1.domain.com",
            "api_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "api_token_id": null,
            "api_token_secret": null,
            "api_user": "root@pam",
            "archive": null,
            "args": null,
            "autostart": true,
            "balloon": 8192,
            "bios": "ovmf",
            "boot": "cdn",
            "bootdisk": "sata0",
            "cicustom": null,
            "cipassword": null,
            "citype": null,
            "ciuser": null,
            "clone": null,
            "cores": 4,
            "cpu": "host",
            "cpulimit": null,
            "cpuunits": null,
            "delete": null,
            "description": null,
            "digest": null,
            "efidisk0": {
                "efitype": "4m",
                "format": "qcow2",
                "pre_enrolled_keys": true
            },
            "force": null,
            "format": null,
            "freeze": null,
            "full": true,
            "hostpci": null,
            "hotplug": null,
            "hugepages": null,
            "ide": null,
            "ipconfig": null,
            "keyboard": null,
            "kvm": true,
            "localtime": null,
            "lock": null,
            "machine": "q35",
            "memory": 8192,
            "migrate": false,
            "migrate_downtime": null,
            "migrate_speed": null,
            "name": "rdp.testautom8",
            "net": {
                "net0": "e1000,bridge=vmbr0,firewall=1"
            },
            "newid": null,
            "node": "pve1",
            "numa": null,
            "numa_enabled": null,
            "onboot": true,
            "ostype": "win11",
            "parallel": null,
            "pool": "rdp",
            "protection": null,
            "proxmox_default_behavior": "no_defaults",
            "reboot": null,
            "revert": null,
            "sata": {
                "sata0": "STOR1:420,format=qcow2",
                "sata1": "local:iso/Win11_22H2_English_x64v1_UEFI.iso,media=cdrom"
            },
            "scsi": null,
            "scsihw": "virtio-scsi-single",
            "serial": null,
            "shares": null,
            "skiplock": null,
            "smbios": null,
            "snapname": null,
            "sockets": null,
            "sshkeys": null,
            "startdate": null,
            "startup": null,
            "state": "present",
            "storage": null,
            "tablet": null,
            "tags": null,
            "target": null,
            "tdf": null,
            "template": null,
            "timeout": 300,
            "update": false,
            "validate_certs": false,
            "vcpus": null,
            "vga": null,
            "virtio": null,
            "vmid": null,
            "watchdog": null
        }
    },
    "mac": {
        "net0": "72:FF:2E:5B:26:BD"
    },
    "msg": "VM rdp.testautom8 with vmid 253 deployed",
    "vmid": 253
}

After

changed: [localhost] => {
    "changed": true,
    "devices": {
        "sata0": "STOR1:253/vm-253-disk-1.qcow2",
        "sata1": "local:iso/Win11_22H2_English_x64v1_UEFI.iso"
    },
    "invocation": {
        "module_args": {
            "acpi": null,
            "agent": "True",
            "api_host": "pve1.domain.com",
            "api_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "api_token_id": null,
            "api_token_secret": null,
            "api_user": "root@pam",
            "archive": null,
            "args": null,
            "autostart": true,
            "balloon": 8192,
            "bios": "ovmf",
            "boot": "cdn",
            "bootdisk": "sata0",
            "cicustom": null,
            "cipassword": null,
            "citype": null,
            "ciuser": null,
            "clone": null,
            "cores": 4,
            "cpu": "host",
            "cpulimit": null,
            "cpuunits": null,
            "delete": null,
            "description": null,
            "digest": null,
            "efidisk0": {
                "efitype": "4m",
                "format": "qcow2",
                "pre_enrolled_keys": true
            },
            "force": null,
            "format": null,
            "freeze": null,
            "full": true,
            "hostpci": null,
            "hotplug": null,
            "hugepages": null,
            "ide": null,
            "ipconfig": null,
            "keyboard": null,
            "kvm": true,
            "localtime": null,
            "lock": null,
            "machine": "q35",
            "memory": 8192,
            "migrate": false,
            "migrate_downtime": null,
            "migrate_speed": null,
            "name": "rdp.testautom8",
            "net": {
                "net0": "e1000,bridge=vmbr0,firewall=1"
            },
            "newid": null,
            "node": "pve1",
            "numa": null,
            "numa_enabled": null,
            "onboot": true,
            "ostype": "win11",
            "parallel": null,
            "pool": "rdp",
            "protection": null,
            "proxmox_default_behavior": "no_defaults",
            "reboot": null,
            "revert": null,
            "sata": {
                "sata0": "STOR1:420,format=qcow2",
                "sata1": "local:iso/Win11_22H2_English_x64v1_UEFI.iso,media=cdrom"
            },
            "scsi": null,
            "scsihw": "virtio-scsi-single",
            "serial": null,
            "shares": null,
            "skiplock": null,
            "smbios": null,
            "snapname": null,
            "sockets": null,
            "sshkeys": null,
            "startdate": null,
            "startup": null,
            "state": "present",
            "storage": null,
            "tablet": null,
            "tags": null,
            "target": null,
            "tdf": null,
            "template": null,
            "timeout": 300,
            "tpmstate0": {
                "storage": "STOR1",
                "version": "2.0"
            },
            "update": false,
            "validate_certs": false,
            "vcpus": null,
            "vga": null,
            "virtio": null,
            "vmid": null,
            "watchdog": null
        }
    },
    "mac": {
        "net0": "26:B9:C9:35:AF:74"
    },
    "msg": "VM rdp.testautom8 with vmid 253 deployed",
    "vmid": 253
}

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type) labels May 18, 2023
@J4RF
Copy link
Contributor Author

J4RF commented May 18, 2023

just wanted to point out that I went ahead and made a couple of assumptions around versioning, please see these two commits in case I did anything wrong (which is likely):

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-7 labels May 19, 2023
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I've added some first comments.

@ansibullbot ansibullbot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI labels May 24, 2023
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label May 24, 2023
@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label May 24, 2023
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label May 24, 2023
J4RF and others added 2 commits May 26, 2023 10:18
Co-authored-by: Felix Fontein <[email protected]>
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels May 26, 2023
@felixfontein felixfontein merged commit 01f21b1 into ansible-collections:main May 29, 2023
@patchback
Copy link

patchback bot commented May 29, 2023

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/01f21b1d4613b4bd49334641750e32da32148a79/pr-6533

Backported as #6600

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label May 29, 2023
patchback bot pushed a commit that referenced this pull request May 29, 2023
* proxmox_kvm: added support for tmpstate

adds hash of options for a TPM state disk, which is required for Windows 11 installations

* updated wrong version in docs

* bump version 7.1.0 -> 7.1.1

* fixed parameter name typo

* updated to pass sanity; assumed version_added to be next major (7.2.0)

* replaced 'tpmstate' with 'tpmstate0'; added suboptions to kvm_args

* fixed line too long

* use get() instead of pop() to preserve verbose invocation.module_args

* update comment to include tpmstate0

* added changelog fragment

* Revert "bump version 7.1.0 -> 7.1.1"

This reverts commit 772ed98.

* Include PR link in changelog fragment

Co-authored-by: Felix Fontein <[email protected]>

* Corrected version_added

Co-authored-by: Felix Fontein <[email protected]>

* corrected semantic markup for option name

Co-authored-by: Felix Fontein <[email protected]>

* set suboptions of tpmstate0 to required

* set default for tpmstate0.version (2.0)

* fixed typo

Co-authored-by: Felix Fontein <[email protected]>

* wrapped default version string in quotes

Co-authored-by: Felix Fontein <[email protected]>

* Improve changelog formatting.

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 01f21b1)
@felixfontein
Copy link
Collaborator

@J4RF thanks for your contribution!

@J4RF J4RF deleted the patch-1 branch May 29, 2023 17:57
felixfontein pushed a commit that referenced this pull request May 30, 2023
…ate0 parameter (#6600)

proxmox_kvm: support for tpmstate0 parameter (#6533)

* proxmox_kvm: added support for tmpstate

adds hash of options for a TPM state disk, which is required for Windows 11 installations

* updated wrong version in docs

* bump version 7.1.0 -> 7.1.1

* fixed parameter name typo

* updated to pass sanity; assumed version_added to be next major (7.2.0)

* replaced 'tpmstate' with 'tpmstate0'; added suboptions to kvm_args

* fixed line too long

* use get() instead of pop() to preserve verbose invocation.module_args

* update comment to include tpmstate0

* added changelog fragment

* Revert "bump version 7.1.0 -> 7.1.1"

This reverts commit 772ed98.

* Include PR link in changelog fragment

Co-authored-by: Felix Fontein <[email protected]>

* Corrected version_added

Co-authored-by: Felix Fontein <[email protected]>

* corrected semantic markup for option name

Co-authored-by: Felix Fontein <[email protected]>

* set suboptions of tpmstate0 to required

* set default for tpmstate0.version (2.0)

* fixed typo

Co-authored-by: Felix Fontein <[email protected]>

* wrapped default version string in quotes

Co-authored-by: Felix Fontein <[email protected]>

* Improve changelog formatting.

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 01f21b1)

Co-authored-by: Jeff Turner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants