Public bug reported:

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.

** Affects: cloud-init (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2055219

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

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to