Bug 1302964 - "waagent --serialconsole" fails to locate the grub file on rhel7
Summary: "waagent --serialconsole" fails to locate the grub file on rhel7
Keywords:
Status: CLOSED DUPLICATE of bug 1360492
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: WALinuxAgent
Version: 7.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Yue Zhang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-29 07:19 UTC by Hu Zhang
Modified: 2019-02-26 20:57 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-09 08:41:03 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Hu Zhang 2016-01-29 07:19:28 UTC
Description of problem:
"waagent --serialconsole" fails to locate the grub configuration file on rhel7.
rhel6 uses grub, however rhel 7 uses grub2. So this command fails to append the serial console options.

Version-Release number of selected component (if applicable):
WALinuxAgent-2.0.16-1.el7

How reproducible:
Always

Steps to Reproduce:
1. waagent --serialconsole
2. Check the line "GRUB_CMDLINE_LINUX" in /etc/default/grub and the kernel options in /boot/grub2/grub.cfg. Nothing like "console=ttyS0 earlyprintk=ttyS0" is added to these files.

Actual results:


Expected results:
In /etc/default/grub, the options should be appended to the line "GRUB_CMDLINE_LINUX". And run grub2-mkconfig.
Or in /boot/grub2/grub.cfg the options should be appended to the kernel line.

Additional info:
For rhel7,
grubKernelBootOptionsFile = '/etc/default/grub'
grubKernelBootOptionsLine = 'GRUB_CMDLINE_LINUX='

Comment 1 mingzhan 2016-02-03 10:48:56 UTC
Hu
I believe the setting to add "console=ttyS0 earlyprintk=ttyS0" is NOT something to do by WALA, but it's the manual step during preparing RHEL Azure image.

See step 10 from this doc:

https://acom-sandbox.azurewebsites.net/en-us/documentation/articles/virtual-machines-linux-create-upload-vhd-redhat/?rnd=1#prepare-an-image-from-hyper-v-manager

so this bug is more like working as design.


Scott

Comment 2 mingzhan 2016-02-03 11:00:14 UTC
Liz
Feel free to comment if I'm wrong or anything missed

Scott

Comment 3 lizzha 2016-02-04 02:19:46 UTC
Yes, when we prepare the Azure image, we add "console=ttyS0 earlyprintk=ttyS0" to the grub files manually.

By running command "waagent --serialconsole", it is supposed to do the same thing. It's documented in WALinuxAgent Github:
  -serialconsole: Configures GRUB to mark ttyS0 (the first serial port) as
   the boot console. This ensures that kernel bootup logs are sent to the
   serial port and made available for debugging.

It's more like a nice to have feature, as it doesn't block any function. But I think we could make it fixed in the agent.

Comment 4 Wei Shi 2016-02-04 02:50:37 UTC
(In reply to lizzha from comment #3)
> Yes, when we prepare the Azure image, we add "console=ttyS0
> earlyprintk=ttyS0" to the grub files manually.
> 
> By running command "waagent --serialconsole", it is supposed to do the same
> thing. It's documented in WALinuxAgent Github:
>   -serialconsole: Configures GRUB to mark ttyS0 (the first serial port) as
>    the boot console. This ensures that kernel bootup logs are sent to the
>    serial port and made available for debugging.
> 
> It's more like a nice to have feature, as it doesn't block any function. But
> I think we could make it fixed in the agent.

Agree, this issue not affect on-demand vm image. Nice to fix it on WALA latest version to make WALA more robust.

Comment 5 mingzhan 2016-02-05 06:07:17 UTC
Liz
Make sense, thank you for comment. 
Wei
Thank you for pointing it out. We will fix this in next version. 
Given it's not a blocking bug for your test, can you please move on your test?

Comment 6 Wei Shi 2016-02-05 06:17:40 UTC
(In reply to mingzhan from comment #5)
> Liz
> Make sense, thank you for comment. 
> Wei
> Thank you for pointing it out. We will fix this in next version. 
> Given it's not a blocking bug for your test, can you please move on your
> test?

Sure, it is not a blocker.

Comment 8 Yuxin Sun 2016-08-09 08:41:03 UTC
This feature doesn't exist in WALinuxAgent-2.1.5. Close it.

*** This bug has been marked as a duplicate of bug 1360492 ***


Note You need to log in before you can comment on or make changes to this bug.