-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add support for serial consoles #436
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as i did it i am not against it 😄 this should be ok for all host afaik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test at least once with CentOS, fix the travis build and merge.
Thanks a lot, I can't count the number of times this can save us time!
There are two ways to do this, through a kernel parameter or through a systemd service. For the moment i'm doing it the easy way, through the service, but on the long term the kernel parameter approach could give us access to the VM earlier during the boot process. Yes, I will test CentOS as well and consider what Travis has to say. |
To anyone interested, the magic kernel parameter is |
I don't know why, the deployment fails with:
is this linked to some other change of you, or do I miss something, @MalloZup? Does it ring a bell? |
That failure is because sumaform has the variabile wait_for_lease enabled true. This variable basicaly make a for loop over 5 min and wait for ip of the domain(in bridge or not bridge network ) .this is the failure. So in your case the client had pb getting the ip. Can you reproduce it always ? In maybe your client, the os. Image has pb with that kernel arg.it can be the diff img |
@MalloZup I'm not even using the kernel arg, I'm trying with systemd. I'll try to run without this patch and see if I get an IP. It could be sumaform is trying to use the system console that is now on another tty. @moio, does that hypothesis sound realistic? I suppose I just have the standard images. I use a fresh sumaform and my usual |
terraform-provider-libvirt gets the VM's IP address(es) via the QEMU guest agent (typically after they have been assigned by the DHCP). I have just checked and yes, the communication with the guest agent uses a serial console, so that sounds like the culprit |
I might have the solution. The problem might be that qemu-agent is detecting the serial console and tries to use it, but there's no login on it yet. I will use the kernel parameter approach. With that one, you get a longin prompt very early. |
@Bischoff i think i tested only with the ubuntu and there was no problem i could log in with the qemu-agent |
but take care that the ubuntu tf has other consoles, this would be your problem imho ( i would try it ou) |
As i said, I already tried it out with the other consoles, and it did not help. In this PR I address only the serial console feature, but feel free to add other consoles to solve ubuntu problems. |
There is some progress: I can now see the kernel booting in my However the boot is broken, I probably need some more kernel arguments 😸 . |
It does not work, I was not able to make "Direct kernel boot" feature work. However, I don't think that's the good strategy. I realized that the good strategy is to add Which means image rebuilding. Given my past experience with that, I will stop at this point. |
@Bischoff what is the 2nd parameter mean? |
@MalloZup The baud rate. This was at the origin on serial telephone lines. As this is now virtualized, you can take the highest speed. Any will to make images, Dario ⛑️ ? |
@Bischoff i am still on Ubunt patch waiting on review there, i might help once i have finised. Is really making images the only solution ? 📛 |
@Bischoff JFYI kernel parameters can be specified in Terraform, as search for "params" |
@moio as you might see above, dario already gave the pointer, it's what I tried and it does not work. You will see the corresponding code in this PR. Furthermore, it's bad because:
The correct solution is really to put it into the image. |
OK. Do we want to keep this PR open then? This sounds like we want to change all images, and at that point, I wonder if it would make sense to switch to JeOS/upstream + cloud init for most of them. |
The switch to jeos will take more time. E.g JeOs need to be resized root partition is to small. I would do first ubuntu the jeos |
It's independant problems, no? I would keep it open. |
The second sentence was a remark, but the question was relative to the quote. Quoting again:
|
@moio we still need the If you create an image that listens on the console, I will refactor this by pruning the unneeded parts. So yes, please keep it open. |
What changes are needed exactly on which images? |
@moio Add |
OpenSUSE images rebuilt, SLE images are building (to be ready at 10am), CentOS images within the day. Please rebase, test and merge - let me know if something does not work as expected. |
Thanks so much @moio !!! |
so it does not work |
Right, there was a problem with OBS publishing, now fixed. I tested both SLES and openSUSE and they do the right thing now. New CentOS images will be provided via the sumaform-images project and they are ready, including console support. Only problem is a slight incompatibility of GitHub Releases with terraform-provider-libvirt, solved in this PR currently pending: dmacvicar/terraform-provider-libvirt#472 Plan:
In future, we will not have hosting problems any more as GitHub releases are publicly available. Moreover, maintenance of Packer images will be easier as all needed software is containerized, so reproducing the build is not machine dependent any more. |
All clear, thanks Silvio for your help on this long-awaited feature of using virsh console 😃 . |
(extracted from #432 from @MalloZup )
This PR adds a serial console to our VMs. It enables:
virsh console
to connect to a VM, especially when network is unavailable