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

machine: Save machine serial console by default #21150

Closed
wants to merge 1 commit into from

Conversation

cgwalters
Copy link
Contributor

Motivated by making it easier to debug problems; I specifically want to make this change for MacOS in the future with applehv too. But I just know how to do it with qemu today.

There's a new podman machine get-console verb that is hidden until:

  • It's implemented on all platforms
  • We bikeshed naming and functionality...for example it may make sense in theory to support the equivalent of virsh console which is interactive.

For now, this is just a debugging aid for us.

None

@cgwalters
Copy link
Contributor Author

I've tested this on Linux/amd64 and MacOS/aarch64 (qemu)...but the main goal was to debug applehv, so going to try implementing it there next.

@baude
Copy link
Member

baude commented Jan 3, 2024

/approve

Copy link
Contributor

openshift-ci bot commented Jan 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: baude, cgwalters

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 3, 2024
@@ -463,6 +463,10 @@ func (m *MacMachine) Set(name string, opts machine.SetOptions) ([]error, error)
}
}

func (m *MacMachine) GetConsole() error {
return fmt.Errorf("not implemented")
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what is better here .. this or just using build tags to conditionally add the command. we have done both in the past. hopefully folks weigh in their preference.

@baude
Copy link
Member

baude commented Jan 3, 2024

@cgwalters lgtm generally ... i think our various linters and the like will require to make some more changes to the docs, etc because you added a command. i can help you through that if the feedback from the tooling is not clear. i'll check this PR in the morning.

@cgwalters
Copy link
Contributor Author

@baude (and others interested) please xref coreos/fedora-coreos-config#2785 - I think to make this really work for early kernel on MacOS we're going to need to change the kernel config and the default kargs.

Also see a lot of similar discussion in lima-vm/lima#1659

Comment on lines 1091 to 1093
if _, err := io.Copy(os.Stdout, f); err != nil {
return err
}
Copy link
Member

Choose a reason for hiding this comment

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

should we copy stdin to it as well to make it interactive or does this not work? Although I guess there in no point because we are unable to login as a user without a static password.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, the other console PR will help enable that.


var (
getConsoleCmd = &cobra.Command{
Use: "get-console [NAME]",
Copy link
Member

Choose a reason for hiding this comment

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

I would just name it console.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For what it's worth, there is e.g. aws ec2 get-console-output to be clear that it just fetches. Hmm. Thinking about this a bit more if we were to make a non-SSH way to login, I think it'd be podman machine login.

(There's a whole sub-thread here of whether we should actually enable podman machine exec...)

@dustymabe
Copy link
Contributor

nice!

Motivated by making it easier to debug problems like
the applehv issues we're seeing today.  This is also
easy to do with qemu.

However note that in practice this really
wants coreos/fedora-coreos-config#2785
so that we can get the full console from the first
boot on applehv.

For now, this is just a debugging aid for us.

Signed-off-by: Colin Walters <[email protected]>
@mheon
Copy link
Member

mheon commented Jan 8, 2024

LGTM once CI is happy

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2024
@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rhatdan
Copy link
Member

rhatdan commented Feb 12, 2024

@cgwalters still working on this one?

@cgwalters
Copy link
Contributor Author

Not recently, probably going to focus more on https://gitlab.com/germag/osc/ then we'll figure out how to epically merge some code with that in here.

@cgwalters
Copy link
Contributor Author

We'll circle back and do more here like this later.

@cgwalters cgwalters closed this Feb 12, 2024
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label May 13, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants