AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1277162
Accepted
timss
timss
Asked: 2020-09-24 04:25:40 +0800 CST2020-09-24 04:25:40 +0800 CST 2020-09-24 04:25:40 +0800 CST

在 20.04 自动安装期间,Netplan 应用在 udevadm 上失败

  • 772

在执行新的 Subiquity 服务器自动安装程序的网络部分期间,它会失败并返回非零代码 on netplan apply,然后它会udevadm settle -t 0一遍又一遍地运行,返回退出代码 1 直到它最终放弃。

来自一份/var/crash报告:

# date/time removed for readability
DEBUG subiquitycore.netplan:111 config for ens2f0 = {}
DEBUG subiquitycore.netplan:111 config for ens2f0 = {}
DEBUG subiquitycore.netplan:135 config for bond0 = 
    {'dhcp4': True, 'interfaces': ['ens2f0', 'ens2f1'], 'parameters': {'lacp-rate': 'slow', 'mode': '802.3ad', 'transmit-hash-policy', 'layer2'}}
DEBUG subiquitycore.utils:74 arun_command called: ['netplan', 'apply']
DEBUG subiquitycore.utils:48 run_command called: ['udevadm', 'settle', '-t', '0']
DEBUG subiquitycore.utils:61 ['udevadm', 'settle', '-t', '0'] exited with code 1
DEBUG subiquitycore.controller.network:196 waiting 0.1 to let udev event queue settle
<repeating udevadm settle commands issued>

(相关)自动安装配置:

#cloud-config
autoinstall:
  version: 1

  # double network due to a bug
  # see https://ubuntu.com/server/docs/install/autoinstall-reference#network
  network:
    network:
      version: 2
      ethernets:
        ens2f0: {}
        ens2f1: {}
      bonds:
        bond0:
          dhcp4: true
          interfaces:
            - ens2f0
            - ens2f1
          parameters:
            mode: 802.3ad
            lacp-rate: slow
            transmit-hash-policy: layer2

这会生成以下 Netplan 配置 ( /etc/netplan/00-installer-config.yaml):

# This is network config written by 'subiquity'
network:
  bonds:
    bond0:
      dhcp4: true
      parameters:
        mode: 802.3ad
        lacp-rate: slow
        transmit-hash-policy: layer2
  ethernets:
    ens2f0: {}
    ens2f1: {}
  version: 2

我还尝试了一个更简单的 netplan 配置,在一个端口 ( ens2f0) 上只有一个静态地址,甚至在任何接口匹配eth*或en*(在本例中ens2f0为ens2f1

我的理论是,有一个模块或其他东西在 udev 中创建了一个未处理甚至可能不相关的事件,但是我将如何调试呢?

此外,即使正确配置了相关设备和接口,如果udev中存在此类未处理的事件,Netplan也不会继续进行下去,这不是很大的侵略性吗?


设置:
Ubuntu 20.04 每日构建 20200923(尝试 20.04.1 和初始 LTS 版本)
Netplan 0.99-ubuntuu3~20.04.2
Systemd 245.4-4ubuntu3.2

Supermicro X11DDW-L
Mellanox ConnectX-5 (PCI-E)
BIOS/旧版启动(由于 UEFI 中此 NIC/主板之间不兼容)

udev netplan 20.04 curtin subiquity
  • 1 1 个回答
  • 731 Views

1 个回答

  • Voted
  1. Best Answer
    timss
    2020-09-26T07:15:15+08:002020-09-26T07:15:15+08:00

    这实际上是由于我 的自动安装程序配置的存储 部分中的错误,而不是由于 Netplan 本身。

    我的服务器有 2 个磁盘,我想在软件 RAID 中使用 mdadm. 由于我使用的是 BIOS 引导和 gpt 分区表,因此我按照 curtin 文档中的建议在每个驱动器上为 grub 创建了一个 1MB 的未格式化分区。

    如果 curtin 的主机系统已使用 UEFI 引导,则 curtin 会将 grub 安装到 esp 分区。如果系统安装介质是使用 MBR 引导的,grub 将安装到磁盘的 MBR 上。但是,在带有 gpt 分区表的磁盘上,在 MBR 之后没有足够的空间供 grub 存储其第二阶段 core.img,因此需要一个带有bios_grub标志的未格式化小分区。此分区应放在磁盘的开头,大小应为 1MB。它不应包含文件系统或安装在系统的任何位置。

    但是除此之外,我错误地认为我还必须为这些 1MB 分区创建一个 RAID,这是没有必要的。在 syslog(标识符)中找到了让我忽略的错误消息,curtin_log.<pid>而在常规 subiquity 日志(/var/log/installer和 /var/crash)中没有提到。它也可以在/var/log/curtin我以前不知道的 curtin 自己的日志 ( ) 中看到。

    # /var/log/curtin/install.log
    # wrapped for readability
    An error occured handling 'md0-bios-boot': ProcessExecutionError - 
        Unexpected error while running command.
    Command: ['mdadm', '--create', '/dev/md0', '--run',
        '--metadata=default', '--homehost=ubuntu-server', '--level=raid1',
        '--raid-devices=2', '/dev/sda1', '/dev/sdb1']
    Exit code: 1
    Reason: -
    Stdout: ''
    Stderr: mdadm: no free space left on /dev/sda1
            mdadm: no free space left on /dev/sdb1
            mdadm: create aborted
    
    finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: configuring raid: md0-bios-boot
    <some more noise from curtin>
    

    这似乎触发了未处理的 udev 事件以及 udevadm settle返回退出代码 1、停止 Netplan 和安装程序的原因。奇怪的是,来自 curtin 的退出代码 1mdadm在到达 Netplan 之前还不足以使其崩溃。


    删除我的存储配置的这一部分解决了这个问题,

    - id: md0-bios-boot
      type: raid
      preserve: false
      raidlevel: 1
      devices:
        - sda-bios-boot
        - sdb-bios-boot
      name: md0
      ptable: gpt
    

    完整的存储配置:

    storage:
      config:
        - id: disk-sda
          type: disk
          preserve: false
          ptable: gpt
          wipe: superblock
          grub_device: true
          path: /dev/sda
    
        - id: disk-sdb
          type: disk
          preserve: false
          ptable: gpt
          wipe: superblock
          grub_device: true
          path: /dev/sdb
    
        - id: sda-bios-boot
          type: partition
          preserve: false
          device: disk-sda
          number: 1
          size: 1MB
          flag: bios_grub
    
        - id: sdb-bios-boot
          type: partition
          preserve: false
          device: disk-sdb
          number: 1
          size: 1MB
          flag: bios_grub
    
        # NOTE: part that had to be removed
        - id: md0-bios-boot
          type: raid
          preserve: false
          raidlevel: 1
          devices:
            - sda-bios-boot
            - sdb-bios-boot
          name: md0
          ptable: gpt
    
        - id: sda-root
          type: partition
          preserve: false
          device: disk-sda
          number: 2
          size: -1
    
        - id: sdb-root
          type: partition
          preserve: false
          device: disk-sdb
          number: 2
          size: -1
    
        - id: md1-os
          type: raid
          preserve: false
          raidlevel: 1
          devices:
            - sda-root
            - sdb-root
          name: md1
          ptable: gpt
    
        - id: md1-os-rootfs
          type: format
          preserve: false
          volume: md1-os
          fstype: ext4
    
        - id: mount-rootfs
          type: mount
          device: md1-os-rootfs
          path: /
    
    • 0

相关问题

  • 自动热插拔安装如何工作?

  • 重建意外删除 /dev

  • 如何在可移动驱动器上设置可执行权限?

  • 配置 udev 以更改 USB HID 设备的权限?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve