canonical / canonical/cloud-init
[bug]: CloudStack 'Unable to obtain DHCP lease on ens3' warning occurs even with valid lease
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
# Bug Report
When using CloudStack as the datasource, cloud-init shows `Unable to obtain a DHCP lease on ens3` warnings even though a valid DHCP lease already exists.
This does not prevent the instance from completing boot, but it appears in `cloud-init status -l` under `recoverable_errors` with `extended_status: degraded`.
## Steps to reproduce the problem
1. Launch a VM on CloudStack (Noble) with cloud-init 25.2 installed (you may need to install [this hotfix PPA](https://launchpad.net/~goldberl/+archive/ubuntu/cloud-init-25.2-cloudstack-hotfix-ppa))
2. Check the cloud-init status after boot and you will see the following errors:
```
ubuntu@cloudy-noble:~$ sudo cloud-init status -l
status: done
extended_status: degraded done
boot_status_code: enabled-by-generator
last_update: Thu, 01 Jan 1970 00:00:15 +0000
detail: DataSourceCloudStack
errors: []
recoverable_errors:
WARNING:
- Unable to obtain a DHCP lease on ens3
- Unable to obtain a DHCP lease on ens3
- Unable to obtain a DHCP lease on ens3
- Unable to obtain a DHCP lease on ens3
```
3. Check that a lease does exist despite the warnings
```
ubuntu@cloudy-noble:~$ sudo ls -l /var/lib/dhcpcd/
total 8
-rw-r----- 1 root root 42 Jan 6 21:19 duid
-rw-r----- 1 root root 325 Jan 6 21:21 ens3.lease
```
## Environment details
- cloud-init version: 25.2 ([hotfix PPA version](https://launchpad.net/~goldberl/+archive/ubuntu/cloud-init-25.2-cloudstack-hotfix-ppa))
- Operating System Distribution: Ubuntu Noble 24.04
- Cloud provider, platform or installer type: Apache CloudStack
Contributor guide
Assessment
This issue has not been assessed yet.