Skip to content

Cloud Images are missing packages required by cloud-init #134

@Jackenmen

Description

@Jackenmen

I tried creating a local VM using QEMU and providing it with cloud-init user-data on startup with the OL8.9 and OL9.3 qcow images from here: https://yum.oracle.com/oracle-linux-templates.html

During testing, I noticed that:

  • partition isn't grown automatically even though the growpart module runs:
    • cause: cloud-utils-growpart package is missing
    • relevant error message from /var/log/cloud-init.log:
      2024-03-30 05:47:27,489 - modules.py[DEBUG]: Running module growpart (<module 'cloudinit.config.cc_growpart' from '/usr/lib/python3.9/site-packages/cloudinit/config/cc_growpart.py'>) with frequency always
      2024-03-30 05:47:27,489 - handlers.py[DEBUG]: start: init-local/config-growpart: running config-growpart with frequency always
      2024-03-30 05:47:27,489 - helpers.py[DEBUG]: Running config-growpart using lock (<cloudinit.helpers.DummyLock object at 0x7fa7a2d486d0>)
      2024-03-30 05:47:27,489 - cc_growpart.py[DEBUG]: No 'growpart' entry in cfg.  Using default: {'mode': 'auto', 'devices': ['/'], 'ignore_growroot_disabled': False}
      2024-03-30 05:47:27,489 - subp.py[DEBUG]: Running command ['growpart', '--help'] with allowed return codes [0] (shell=False, capture=True)
      2024-03-30 05:47:27,490 - subp.py[DEBUG]: Running command ['gpart', 'help'] with allowed return codes [0, 1] (shell=False, capture=True)
      2024-03-30 05:47:27,491 - cc_growpart.py[DEBUG]: growpart unable to find resizer for 'auto': No resizers available
      2024-03-30 05:47:27,491 - handlers.py[DEBUG]: finish: init-local/config-growpart: SUCCESS: config-growpart ran successfully
      
  • cloud-init collect-logs command does not work
    • cause: tar package is missing
    • relevant error message:
      Traceback (most recent call last):
        File "/usr/lib/python3.9/site-packages/cloudinit/subp.py", line 291, in subp
          sp = subprocess.Popen(
        File "/usr/lib64/python3.9/subprocess.py", line 951, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/usr/lib64/python3.9/subprocess.py", line 1837, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: b'tar'
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "/bin/cloud-init", line 33, in <module>
          sys.exit(load_entry_point('cloud-init==23.1.1', 'console_scripts', 'cloud-init')())
        File "/usr/lib/python3.9/site-packages/cloudinit/cmd/main.py", line 1086, in main
          retval = util.log_time(
        File "/usr/lib/python3.9/site-packages/cloudinit/util.py", line 2757, in log_time
          ret = func(*args, **kwargs)
        File "/usr/lib/python3.9/site-packages/cloudinit/cmd/devel/logs.py", line 278, in handle_collect_logs_args
          return collect_logs(args.tarfile, args.userdata, args.verbosity)
        File "/usr/lib/python3.9/site-packages/cloudinit/cmd/devel/logs.py", line 271, in collect_logs
          subp(["tar", "czvf", tarfile, log_dir.replace(tmp_dir + "/", "")])
        File "/usr/lib/python3.9/site-packages/cloudinit/subp.py", line 304, in subp
          raise ProcessExecutionError(
      cloudinit.subp.ProcessExecutionError: Unexpected error while running command.
      Command: ['tar', 'czvf', '/home/vm/cloud-init.tar.gz', 'cloud-init-logs-2024-03-30']
      Exit code: -
      Reason: [Errno 2] No such file or directory: b'tar'
      Stdout: -
      Stderr: -
      

While the cloud-init collect-logs issue is not critical since it can be worked around by looking at /var/log/cloud-init.log (or installing the tar package if the reason you're looking into those logs isn't due to faulty networking) but the growpart issue seems more serious since it normally would be done automatically during the boot process. There could be some other dependencies missing that I haven't noticed too but I haven't really looked into it further.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions