[INSTRM-449] ansible grub role need to be fixed Created: 16/Aug/18  Updated: 14/Mar/23  Resolved: 14/Mar/23

Status: Won't Fix
Project: Instrument control development
Component/s: ics_ansible
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: kyono Assignee: yuki.moritani
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Shimono-san,

As we ran ansible for a rga1-vm replacement server, we had issue on grub config.
Even though problem itself was fixed with Kiana and Yoshida-san's support, could you review and update grub-uuid role on pfs ansible?
[Ref]
https://github.com/Subaru-PFS/ics_ansible/blob/master/roles/grub-uuid/tasks/main.yml

Eiji



 Comments   
Comment by shimono [ 20/Aug/18 ]

originally, I thought it is due that role does not check condition, but task has a line of
> when: "'UUID=' not in ansible_cmdline.root"
so, this role will not run when grub is already configured by uuid.

do you have detailed information on trouble? like how configuration was modified wrongly.
or provide output of setup (like "ansible all -m setup -i <inventory> -l <target> -k -K")

Comment by kyono [ 21/Aug/18 ]

>so, this role will not run when grub is already configured by uuid.
>do you have detailed information on trouble? like how configuration was modified wrongly.
>
After we ran ansible, it was configured as root=/dev/sda6 and failed to boot OS.
[e.g]
linux /vmlinuz-4.9.0-8-amd64 root=/dev/sda6 ro quiet
It was complaining something like it cannot mount root file system.

With Kiaina and Yoshida-san's help, we checked block id of /dev/sda6 and updated grub config to use uuid instead of /dev/sda6 which sounds like how it should be...

>grub-uuid issue is on r710?What is the RAID on the server PERC 6/iR? H700?
>
Yes, it is on R710. RAID is PERC6/i.

For "ansible all -m setup -i <inventory> -l <target> -k -K" output, I may update it to Jira tomorrow... Sorry for delay.

Comment by shimono [ 24/Aug/18 ]

I have not secured actual condition, but it seems cmdline will get device name but not uuid on some hardware condition.

stretch% cat /proc/cmdline (VM)
BOOT_IMAGE=/vmlinuz-4.9.0-7-amd64 root=UUID=70e2fc98-73f6-4c4d-a39e-769d917619e3 ro quiet
stretch% ssh pfs@dlb7-vm cat /proc/cmdline (HP DL360)
BOOT_IMAGE=/vmlinuz-4.9.0-7-amd64 root=UUID=fec6d2bd-a2c5-4275-a423-77662e1b0647 ro quiet
stretch% ssh pfs@rca4-vm cat /proc/cmdline (Dell R410)
BOOT_IMAGE=/vmlinuz-4.9.0-3-amd64 root=/dev/sda6 ro quiet

Comment by shimono [ 24/Aug/18 ]

again, could not reproduce with test environment at IPMU. using rca4-vm as above.
it correctly configured grub (/etc/default/grub and /boot/grub/grub.cfg) and booted up.

what was the actual configuration of grub? on recovery process you should be checked on grub boot window, to fix them. also information which shall be provided for investigation, like configuration files, system configuration (/proc) outputs are almost missing.

Comment by kyono [ 31/Aug/18 ]

Sorry for delayed response. As of now,

[/proc/cmdline]

pfs@rfa3-vm:~$ cat /proc/cmdline

BOOT_IMAGE=/vmlinuz-4.9.0-8-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro quiet

 

 

[/etc/default/grub]

pfs@rfa3-vm:~$ cat /etc/default/grub

  1. If you change this file, run 'update-grub' afterwards to update
  1. /boot/grub/grub.cfg.
  1. For full documentation of the options in this file, see:
  1.   info -f grub -n 'Simple configuration'

 

GRUB_DEFAULT=0

GRUB_TIMEOUT=5

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

GRUB_CMDLINE_LINUX=""

 

  1. Uncomment to enable BadRAM filtering, modify to suit your needs
  1. This works with Linux (no patch required) and with any kernel that obtains
  1. the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)

#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

 

  1. Uncomment to disable graphical terminal (grub-pc only)

#GRUB_TERMINAL=console

 

  1. The resolution used on graphical terminal
  1. note that you can use only modes which your graphic card supports via VBE
  1. you can see them in real GRUB with the command `vbeinfo'

#GRUB_GFXMODE=640x480

 

  1. Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux

#GRUB_DISABLE_LINUX_UUID=true

 

  1. Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY="true"

 

  1. Uncomment to get a beep at grub start

#GRUB_INIT_TUNE="480 440 1"

 

  1. /dev/sda6

GRUB_DEVICE_UUID="43069cc7-f63c-46e6-9b91-1da32fb43798"

 

 

[/boot/grub/grub.cfg]

pfs@rfa3-vm:~$ cat /boot/grub/grub.cfg

#

  1. DO NOT EDIT THIS FILE

#

  1. It is automatically generated by grub-mkconfig using templates
  1. from /etc/grub.d and settings from /etc/default/grub

#

 

      1. BEGIN /etc/grub.d/00_header ###

if [ -s $prefix/grubenv ]; then

  set have_grubenv=true

  load_env

fi

if [ "${next_entry}" ] ; then

   set default="${next_entry}"

   set next_entry=

   save_env next_entry

   set boot_once=true

else

   set default="0"

fi

 

if [ x"${feature_menuentry_id}" = xy ]; then

  menuentry_id_option="--id"

else

  menuentry_id_option=""

fi

 

export menuentry_id_option

 

if [ "${prev_saved_entry}" ]; then

  set saved_entry="${prev_saved_entry}"

  save_env saved_entry

  set prev_saved_entry=

  save_env prev_saved_entry

  set boot_once=true

fi

 

function savedefault {

  if [ -z "${boot_once}" ]; then

    saved_entry="${chosen}"

    save_env saved_entry

  fi

}

function load_video

{   if [ x$feature_all_video_module = xy ]; then     insmod all_video   else     insmod efi_gop     insmod efi_uga     insmod ieee1275_fb     insmod vbe     insmod vga     insmod video_bochs     insmod video_cirrus   fi }

 

if [ x$feature_default_font_path = xy ] ; then

   font=unicode

else

insmod part_msdos

insmod xfs

if [ x$feature_platform_search_hint = xy ]; then

  search --no-floppy --fs-uuid --set=root  43069cc7-f63c-46e6-9b91-1da32fb43798

else

  search --no-floppy --fs-uuid --set=root 43069cc7-f63c-46e6-9b91-1da32fb43798

fi

    font="/usr/share/grub/unicode.pf2"

fi

 

if loadfont $font ; then

  set gfxmode=auto

  load_video

  insmod gfxterm

fi

terminal_output gfxterm

if [ "${recordfail}" = 1 ] ; then

  set timeout=30

else

  if [ x$feature_timeout_style = xy ] ; then

    set timeout_style=menu

    set timeout=5

  # Fallback normal timeout code in case the timeout_style feature is

  # unavailable.

  else

    set timeout=5

  fi

fi

      1. END /etc/grub.d/00_header ###

 

      1. BEGIN /etc/grub.d/05_debian_theme ###

set menu_color_normal=cyan/blue

set menu_color_highlight=white/blue

      1. END /etc/grub.d/05_debian_theme ###

 

      1. BEGIN /etc/grub.d/10_linux ###

function gfxmode {

set gfxpayload="${1}"

}

set linux_gfx_mode=

export linux_gfx_mode

menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ load_video insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi echo 'Loading Linux 4.9.0-8-amd64 ...' linux /vmlinuz-4.9.0-8-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro  quiet echo 'Loading initial ramdisk ...' initrd /initrd.img-4.9.0-8-amd64 }

submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-43069cc7-f63c-46e6-9b91-1da32fb43798' {

menuentry 'Debian GNU/Linux, with Linux 4.9.0-8-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.0-8-amd64-advanced-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ load_video insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi echo 'Loading Linux 4.9.0-8-amd64 ...' linux /vmlinuz-4.9.0-8-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro  quiet echo 'Loading initial ramdisk ...' initrd /initrd.img-4.9.0-8-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-8-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.0-8-amd64-recovery-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ load_video insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi echo 'Loading Linux 4.9.0-8-amd64 ...' linux /vmlinuz-4.9.0-8-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro single echo 'Loading initial ramdisk ...' initrd /initrd.img-4.9.0-8-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-7-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.0-7-amd64-advanced-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ load_video insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi echo 'Loading Linux 4.9.0-7-amd64 ...' linux /vmlinuz-4.9.0-7-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro  quiet echo 'Loading initial ramdisk ...' initrd /initrd.img-4.9.0-7-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-7-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.0-7-amd64-recovery-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ load_video insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi echo 'Loading Linux 4.9.0-7-amd64 ...' linux /vmlinuz-4.9.0-7-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro single echo 'Loading initial ramdisk ...' initrd /initrd.img-4.9.0-7-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-3-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.0-3-amd64-advanced-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ load_video insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi echo 'Loading Linux 4.9.0-3-amd64 ...' linux /vmlinuz-4.9.0-3-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro  quiet echo 'Loading initial ramdisk ...' initrd /initrd.img-4.9.0-3-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-3-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.0-3-amd64-recovery-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ load_video insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi echo 'Loading Linux 4.9.0-3-amd64 ...' linux /vmlinuz-4.9.0-3-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro single echo 'Loading initial ramdisk ...' initrd /initrd.img-4.9.0-3-amd64 }

}

 

      1. END /etc/grub.d/10_linux ###

 

      1. BEGIN /etc/grub.d/20_linux_xen ###

 

      1. END /etc/grub.d/20_linux_xen ###

 

      1. BEGIN /etc/grub.d/30_os-prober ###

menuentry 'Debian GNU/Linux 9 (stretch) (on /dev/sda6)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi linux /vmlinuz-4.9.0-8-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro quiet initrd /initrd.img-4.9.0-8-amd64 }

submenu 'Advanced options for Debian GNU/Linux 9 (stretch) (on /dev/sda6)' $menuentry_id_option 'osprober-gnulinux-advanced-43069cc7-f63c-46e6-9b91-1da32fb43798' {

menuentry 'Debian GNU/Linux (on /dev/sda6)' -class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux/vmlinuz-4.9.0-8-amd64--43069cc7-f63c-46e6-9b91-1da32fb43798'

{ insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi linux /vmlinuz-4.9.0-8-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro quiet initrd /initrd.img-4.9.0-8-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-8-amd64 (on /dev/sda6)' -class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux/vmlinuz-4.9.0-8-amd64--43069cc7-f63c-46e6-9b91-1da32fb43798' { insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi linux /vmlinuz-4.9.0-8-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro quiet initrd /initrd.img-4.9.0-8-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-8-amd64 (recovery mode) (on /dev/sda6)' -class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux/vmlinuz-4.9.0-8-amd64-root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro single-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi linux /vmlinuz-4.9.0-8-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro single initrd /initrd.img-4.9.0-8-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-7-amd64 (on /dev/sda6)' -class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux/vmlinuz-4.9.0-7-amd64--43069cc7-f63c-46e6-9b91-1da32fb43798'

{ insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi linux /vmlinuz-4.9.0-7-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro quiet initrd /initrd.img-4.9.0-7-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-7-amd64 (recovery mode) (on /dev/sda6)' -class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux/vmlinuz-4.9.0-7-amd64-root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro single-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi linux /vmlinuz-4.9.0-7-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro single initrd /initrd.img-4.9.0-7-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-3-amd64 (on /dev/sda6)' -class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux/vmlinuz-4.9.0-3-amd64--43069cc7-f63c-46e6-9b91-1da32fb43798'

{ insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi linux /vmlinuz-4.9.0-3-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro quiet initrd /initrd.img-4.9.0-3-amd64 }

menuentry 'Debian GNU/Linux, with Linux 4.9.0-3-amd64 (recovery mode) (on /dev/sda6)' -class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux/vmlinuz-4.9.0-3-amd64-root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro single-43069cc7-f63c-46e6-9b91-1da32fb43798'

{ insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b44f5cb6-8727-452f-b736-7c6957571fea else   search --no-floppy --fs-uuid --set=root b44f5cb6-8727-452f-b736-7c6957571fea fi linux /vmlinuz-4.9.0-3-amd64 root=UUID=43069cc7-f63c-46e6-9b91-1da32fb43798 ro single initrd /initrd.img-4.9.0-3-amd64 }

}

 

      1. END /etc/grub.d/30_os-prober ###

 

      1. BEGIN /etc/grub.d/30_uefi-firmware ###
      1. END /etc/grub.d/30_uefi-firmware ###

 

      1. BEGIN /etc/grub.d/40_custom ###
  1. This file provides an easy way to add custom menu entries.  Simply type the
  1. menu entries you want to add after this comment.  Be careful not to change
  1. the 'exec tail' line above.
      1. END /etc/grub.d/40_custom ###

 

      1. BEGIN /etc/grub.d/41_custom ###

if [ -f  ${config_directory}/custom.cfg ]; then

  source ${config_directory}/custom.cfg

elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then

  source $prefix/custom.cfg;

fi

      1. END /etc/grub.d/41_custom ###
Comment by yuki.moritani [ 14/Mar/23 ]

No demand now.

Generated at Sat Feb 10 16:25:07 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.