← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1976564] [NEW] cloud-config: cloud_dir setting not honored globalling by cloud-init

 

Public bug reported:

Changes to /etc/cloud/cloud.cfg system_info: paths: cloud_dir setting is
not honored globally in cloud-init. Some paths continue to hardcode
/var/lib/cloud paths to certain operations.


Affects cloud-init version 22.2


[Test Plan]

cat > 95-custom-cloud-dir.cfg <<EOF
system_info:
   paths:
      cloud_dir: /new-cloud-dir
EOF 
lxc launch ubuntu-daily:kinetic dev-k
lxc file push  95-custom-cloud-dir.cfg dev-k/etc/cloud/cloud.cfg.d/
lx exec dev-x -- rm -rf /var/lib/cloud
lxc exec dev-k -- cloud-init clean --logs --reboot
lxc exec dev-k -- cloud-init status --wait --long

# Expect not logs talking about using /var/lib/cloud
lxc exec dev-k -- grep /var/lib /var/log/cloud-init.log
2022-06-01 23:18:07,234 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpqwldn_op) - w: [644] 486 bytes/chars
2022-06-01 23:18:08,642 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpy7wm60kf) - w: [644] 512 bytes/chars
2022-06-01 23:18:13,156 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpvw2y443q) - w: [644] 540 bytes/chars
2022-06-01 23:18:13,996 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpdzbb4lu7) - w: [644] 567 bytes/chars
2022-06-01 23:18:13,996 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/result.json (via temporary file /var/lib/cloud/data/tmpecr955s_) - w: [644] 64 bytes/chars
2022-06-01 23:18:13,996 - util.py[DEBUG]: Creating symbolic link from '/run/cloud-init/result.json' => '../../var/lib/cloud/data/result.json'


# Expect to find no files in /var/lib/cloud
lxc exec dev-x find /var/lib/cloud
/var/lib/cloud
/var/lib/cloud/data
/var/lib/cloud/data/status.json


[ Possible hardcoded paths to resolve]
- cloudinit/util.py:fetch_ssl_details
- cloudinit/sources/DataSourceBigstep.py
- cloudinit/sources/DataSourceAzure.py
- cloudinit/cmd/main.py:status_wrapper
- cloudinit/cmd/devel/logs.py

-

** Affects: cloud-init
     Importance: High
         Status: Triaged

** Changed in: cloud-init
       Status: New => Triaged

** Changed in: cloud-init
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1976564

Title:
  cloud-config: cloud_dir setting not honored globalling by cloud-init

Status in cloud-init:
  Triaged

Bug description:
  Changes to /etc/cloud/cloud.cfg system_info: paths: cloud_dir setting
  is not honored globally in cloud-init. Some paths continue to hardcode
  /var/lib/cloud paths to certain operations.

  
  Affects cloud-init version 22.2


  [Test Plan]

  cat > 95-custom-cloud-dir.cfg <<EOF
  system_info:
     paths:
        cloud_dir: /new-cloud-dir
  EOF 
  lxc launch ubuntu-daily:kinetic dev-k
  lxc file push  95-custom-cloud-dir.cfg dev-k/etc/cloud/cloud.cfg.d/
  lx exec dev-x -- rm -rf /var/lib/cloud
  lxc exec dev-k -- cloud-init clean --logs --reboot
  lxc exec dev-k -- cloud-init status --wait --long

  # Expect not logs talking about using /var/lib/cloud
  lxc exec dev-k -- grep /var/lib /var/log/cloud-init.log
  2022-06-01 23:18:07,234 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpqwldn_op) - w: [644] 486 bytes/chars
  2022-06-01 23:18:08,642 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpy7wm60kf) - w: [644] 512 bytes/chars
  2022-06-01 23:18:13,156 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpvw2y443q) - w: [644] 540 bytes/chars
  2022-06-01 23:18:13,996 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpdzbb4lu7) - w: [644] 567 bytes/chars
  2022-06-01 23:18:13,996 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/result.json (via temporary file /var/lib/cloud/data/tmpecr955s_) - w: [644] 64 bytes/chars
  2022-06-01 23:18:13,996 - util.py[DEBUG]: Creating symbolic link from '/run/cloud-init/result.json' => '../../var/lib/cloud/data/result.json'

  
  # Expect to find no files in /var/lib/cloud
  lxc exec dev-x find /var/lib/cloud
  /var/lib/cloud
  /var/lib/cloud/data
  /var/lib/cloud/data/status.json


  [ Possible hardcoded paths to resolve]
  - cloudinit/util.py:fetch_ssl_details
  - cloudinit/sources/DataSourceBigstep.py
  - cloudinit/sources/DataSourceAzure.py
  - cloudinit/cmd/main.py:status_wrapper
  - cloudinit/cmd/devel/logs.py

  -

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1976564/+subscriptions



Follow ups