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

feat(xo-server/createVm): create VTPM if template requests it #7436

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

julien-f
Copy link
Member

@julien-f julien-f commented Mar 5, 2024

Description

See https://team.vates.fr/vates/pl/d3mb7wb5fiy57pmp44wnusatce (private page)

Should fix https://www.youtube.com/watch?v=MqHuNu4hjJo

Checklist

  • Commit
    • Title follows commit conventions
    • Reference the relevant issue (Fixes #007, See xoa-support#42, See https://...)
    • If bug fix, add Introduced by
  • Changelog
    • If visible by XOA users, add changelog entry
    • Update "Packages to release" in CHANGELOG.unreleased.md
  • PR
    • If UI changes, add screenshots
    • If not finished or not tested, open as Draft

@julien-f julien-f requested a review from fbeauchamp March 5, 2024 09:59
@julien-f julien-f requested a review from fbeauchamp March 5, 2024 10:44
@julien-f julien-f requested a review from fbeauchamp March 6, 2024 10:43
@fbeauchamp fbeauchamp merged commit 2e002de into master Mar 6, 2024
1 check passed
@fbeauchamp fbeauchamp deleted the auto-vtpm branch March 6, 2024 10:52
Comment on lines +216 to +219
if (vm.platform.vtpm === 'true') {
await this.VTPM_create({ VM: vm.$ref })
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

What about the existing widget in the VM creation page's advanced settings? It looks like this bypasses it. So users creating a new Windows 11 VM and opening the advanced settings before hitting "Create" would see the widget is off, like no vTPM would be created, when in fact a vTPM will still be created.

I also found out something else about how XAPI behaves regarding vTPMs. On XOA latest (so without this commit), I created a VM from the Windows 11 templates, but without enabling vTPM. This created no vTPM, as expected. But as soon as I started the VM, a vTPM was created by XAPI. I believe they did this based on vm.platform.vtpm.

Consequently, I believe the best behaviour would be, at VM creation, to make the widget status automatically match the template's platform.vtpm field, and change what this widget does: if set to true, by users, define platform.vtpm as true and create the vTPM (or let XAPI create it at first boot, as you prefer. Creating it avoids the situation where users set it to true but don't start the VM immediately and might notice there's no vTPM yet), and if set to false by user, make sure vm.platform.vtpm is set to false too so that XAPI doesn't create one at first boot.

Copy link
Member Author

Choose a reason for hiding this comment

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

This should have been the case but it was broken.

This should now be fixed: 009c0ea

julien-f added a commit that referenced this pull request Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants