canonical / canonical/cloud-init

[enhancement]: ds-identify: Add a new policy mode to start cloud-init directly with DataSourceNone

Open
#6,895 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

### Problem

When `ds-identify` is configured with `notfound=enabled` and no datasource is detected, it generates the following configuration:

```yaml
# /run/cloud-init/cloud.cfg
di_report:
datasource_list: [ ]
# reporting not found result. notfound=disabled.
```

In the cases where `datasource_list` contains multiple datasources and `ds-identify` reports that no datasource was found, `cloud-init` starts its normal datasource discovery process. It scans the datasources specified in `datasource_list`, which can take a significant amount of time, before eventually falling back to `DataSourceNone`.

### Proposed Enhancement

Introduce a new policy mode, for example:

```text
notfound=enabled-ds-none
```

When this mode is configured and `ds-identify` does not find any datasource, it would instruct `cloud-init` to start directly with `DataSourceNone` instead of performing the full datasource discovery process.

### Benefits

- Reduces boot time on systems where a datasource may or may not be present.

### Possible Implementation

When `ds-identify` reaches a "no datasource found" result under the new policy mode, it could generate a configuration like `datasource_list: [ None ]`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.