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

docs: hyper-v: added documentation for using Flatcar with Hyper-V #315

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

ader1990
Copy link
Contributor

@ader1990 ader1990 commented Apr 5, 2024

Add the Hyper-V VM documentation:

  • how to create a VM
  • how to provision a VM via config drive or Ignition
  • example of a more advanced TPM LUKS2 encryption scenario, with autologin and password set

See: flatcar/Flatcar#1009

@ader1990 ader1990 changed the title Add hyperv docs [Draft] Add hyperv docs Apr 5, 2024
@ader1990 ader1990 marked this pull request as draft April 5, 2024 13:55
@ader1990 ader1990 self-assigned this Apr 5, 2024
@ader1990
Copy link
Contributor Author

ader1990 commented Apr 8, 2024

@jepio Should I also add the Generation 1 info with the .vhd examples?


## Logging in

TBD. Use a butane script, as the LIS drivers and tools are not part of Flatcar.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jepio the Hyper-V implementation, as Flatcar does not have the LIS drivers, does not have the communication channel guest services to set the IP to be visible from the Hyper-V host. I was thinking to add an auto login instead in the flatcar ignition and a password based userdata for configdrive, would that be okay?

I suppose adding the LIS drivers to Flatcar would be a bigger endeavour with low usability, as there are no Gentoo upstream packages and it needs to be done from scratch, also requiring dracut/bootengine changes.

Copy link
Member

Choose a reason for hiding this comment

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

flatcar.autologin should be fine, and adding LIS drivers would also be desirable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added flatar.autologin. The LIS drivers are included already in the kernel, just the services need to be added for the guest to host communication. But I cannot add them in the ignition config as those are binaries, they need to be added in the flatcar/scripts hyper-oem implementation.

@jepio
Copy link
Member

jepio commented Apr 8, 2024

@jepio Should I also add the Generation 1 info with the .vhd examples?

I would give a Gen 1 example with the vhdx as well :)

"units": [
{
"contents": "[Unit]\nConditionFirstBoot=true\nOnFailure=emergency.target\nOnFailureJobMode=isolate\n[Service]\nType=oneshot\nRemainAfterExit=yes\nExecStart=systemd-cryptenroll --tpm2-device=auto --unlock-key-file=/etc/luks/rootencrypted --wipe-slot=0 /dev/disk/by-partlabel/ROOT\nExecStart=rm /etc/luks/rootencrypted\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
Copy link
Member

Choose a reason for hiding this comment

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

Instead of having plain Ignition here we can link to the config section of the new page introduced in #317

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do. I'll add a base autologin ignition example and then ref the TPM example as a more complex scenario.

Copy link
Member

Choose a reason for hiding this comment

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

or do you prefer to adapt the hyperv oem config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can create something similar to https://github.com/flatcar/scripts/tree/main/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure, where I can add the required guest services for communication (the so-called integration services). https://wiki.gentoo.org/wiki/Hyper-V#Linux_guest_support See: https://github.com/LIS/lis-pipeline/blob/master/scripts/package_building/deps-lis/rpm/lis-daemon.spec#L2

But I will update this document in another PR after the feature is implemented in flatcar/scripts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of having plain Ignition here we can link to the config section of the new page introduced in #317

Will add the link once #317 gets merged

Copy link
Member

Choose a reason for hiding this comment

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

A link to the Windows binaries would be good here, too: https://github.com/coreos/butane/releases/tag/v0.20.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pothos I added the link to the butane releases and also the Ignition metadata is now in butane format + added too the transformation command.

@ader1990 ader1990 marked this pull request as ready for review April 8, 2024 17:12
@ader1990 ader1990 changed the title [Draft] Add hyperv docs docs: hyper-v: added documentation for using Flatcar with Hyper-V Apr 8, 2024
Copy link
Collaborator

@tormath1 tormath1 left a comment

Choose a reason for hiding this comment

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

I think as a flatcar-maintainers member, you should be able to push your changes directly in a branch linked to this repository (rather than using a fork) - it should make the CI happy and render a preview of the documentation.

content/docs/latest/installing/vms/hyper-v.md Outdated Show resolved Hide resolved
content/docs/latest/installing/vms/hyper-v.md Show resolved Hide resolved
@ader1990
Copy link
Contributor Author

ader1990 commented Apr 9, 2024

I think as a flatcar-maintainers member, you should be able to push your changes directly in a branch linked to this repository (rather than using a fork) - it should make the CI happy and render a preview of the documentation.

Sorry, now it is too late to change as the PR conversation will be lost. Will do that next time.

pothos
pothos previously approved these changes Apr 11, 2024
jepio
jepio previously approved these changes Apr 11, 2024
Copy link
Member

@jepio jepio left a comment

Choose a reason for hiding this comment

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

pasted some comments which i think are worth addressing and then OK to merge

@ader1990 ader1990 dismissed stale reviews from jepio and pothos via a6d3282 April 12, 2024 15:10
@ader1990 ader1990 force-pushed the add-hyperv-docs branch 4 times, most recently from 094740a to d3a5332 Compare April 12, 2024 15:26
* added basic installation requirements
* added powershell script to create a Gen 1 and Gen 2 VM
* added powershell script to create and use a configdrive
* added a butane config with advanced features like auto-login, password set and TPM cryptenroll

Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
Copy link
Collaborator

@tormath1 tormath1 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks! You can hold this PR until the release is actually done (by today or tomorrow).

@ader1990
Copy link
Contributor Author

LGTM. Thanks! You can hold this PR until the release is actually done (by today or tomorrow).

Thank you, will merge after the new release and after I check everything works as expected with the new VHDX.

@ader1990 ader1990 merged commit 904b9bc into flatcar:master Apr 16, 2024
1 of 2 checks passed
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

4 participants