cloud-init:收到错误:没有此类功能检查

cloud-init:收到错误:没有此类功能检查

我有这个配置

disk_setup:
  /dev/vdb:
    table_type: gpt,
    layout: true

fs_setup:
- label: repo
  filesystem: ext4
  device: /dev/vdb1
  partition: auto

这是我得到的错误,

2022-06-10 17:30:32,273 - util.py[WARNING]: Failed partitioning operation
No such function check_partition_gpt,_layout to call!
2022-06-10 17:30:32,274 - util.py[DEBUG]: Failed partitioning operation
No such function check_partition_gpt,_layout to call!
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", line 441, in get_dyn_func
    return globals()[func_name](*func_args)
KeyError: 'check_partition_gpt,_layout'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", line 148, in handle
    util.log_time(logfunc=LOG.debug,
  File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2472, in log_time
    ret = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", line 821, in mkpart
    if check_partition_layout(table_type, device, layout):
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", line 547, in check_partition_layout
    found_layout = get_dyn_func(
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", line 446, in get_dyn_func
    raise Exception("No such function %s to call!" % func_name) from e
Exception: No such function check_partition_gpt,_layout to call!

我该如何解决上述错误?


在我的日志文件的顶部,我有

  • Cloud-init v. 21.4-0ubuntu1~20.04.1 于 2022 年 6 月 10 日星期五 17:30:22 +0000 运行“init-local”。上升8.53秒。

答案1

gpt,应该是一个简单的错字gpt

改变:

disk_setup:
  /dev/vdb:
    table_type: gpt,
    layout: true

到:

disk_setup:
  /dev/vdb:
    table_type: gpt
    layout: true

所以没有这样的函数调用是因为这就是cloud-init从选项中调度的方式。

相关内容