`zpool status` called even if not installed in a container

Bug #2055219 reported by Simon Déziel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

It seems that cloud-init tries to use `zpool status <pool>` whenever `/dev/zfs` exists. This can causes some bogus warnings if the zpool command it not available despite that `/dev/zfs` existing.

Here is how to reproduce:

```
lxc launch ubuntu-daily:22.04 v1 --vm
sleep 30
lxc exec v1 -- apt-get update
lxc exec v1 -- apt-get install -y linux-image-virtual-hwe-22.04
lxc restart v1
sleep 30
lxc exec v1 -- lxd init --auto --storage-backend=zfs
lxc exec v1 -- lxc launch ubuntu-minimal-daily:22.04 c1
lxc exec v1 -- lxc exec c1 -- cloud-init status --long --wait
```

This will output:

```
.........................
status: done
extended_status: degraded done
boot_status_code: enabled-by-generator
last_update: Tue, 27 Feb 2024 20:59:35 +0000
detail:
DataSourceLXD
errors: []
recoverable_errors:
WARNING:
 - Unable to get zpool status of default: Unexpected error while running command. Command: ['zpool', 'status', 'default'] Exit code: - Reason: [Errno 2] No such file or directory: b'zpool' Stdout: - Stderr: -
```

This `cloud-init status` returns 0 when running inside a 22.04 instance but would return 2 when inside a 24.04 instance. See https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2048522 that changes how warnings influence the return code depending on the OS version.

Revision history for this message
Simon Déziel (sdeziel) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 24.1~7g54599148-0ubuntu1

---------------
cloud-init (24.1~7g54599148-0ubuntu1) noble; urgency=medium

  * d/cloud-init.templates: enable WSL datasource by default.
  * Restore upstream ChangeLog without any merges.
    We have been merging an upstream ChangeLog spelling difference
    downstream for no good reason.
  * Upstream snapshot based on upstream/main at 54599148.
    - Bugs fixed in this snapshot: (LP: #2055081, #2055219)

 -- James Falcon <email address hidden> Tue, 27 Feb 2024 17:42:55 -0600

Changed in cloud-init (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.