Update ubuntu cloud info
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apport |
Fix Released
|
Medium
|
Unassigned | ||
apport (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Lunar |
New
|
Undecided
|
Unassigned | ||
cloud-init (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned | ||
Lunar |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
Apport reported bug add invalid bug tags such as `uec-images` which no longer has meaning or `ec2-images` on openstack. Since cloud-init is installed in all these images and detects the correct datasource, leverage cloud-init's instance-data.json or cloud-id
[ Test Plan ]
1. Launch LXD container for each series
2. upgrade to cloud-init from -proposed.
3. Execute apport-bug cloud-init and view report to assess that correct tags are present for LXD datasource.
4. replace /run/cloud-
verification scriptlet (attached):
#!/bin/bash
set -ex
cat > setup_proposed.sh <<EOF
#/bin/bash
mirror=http://
echo deb \$mirror \$(lsb_release -sc)-proposed main | tee /etc/apt/
apt-get update -q
apt-get install -qy cloud-init
EOF
cat > openstack.json <<EOF
{
"ds" : {},
"v1": {
"cloud_id": "openstack",
"machine": "CloudArchitect
"platform": "openstack",
"region": null,
}
}
EOF
cat > ec2.json << EOF
{
"ds": {
"imageId": "ami-123",
"instanceType": "m1.tiny",
"region": "us-east-1"
},
"v1": {
"cloud_name": "aws",
"distro": "ubuntu",
"distro_
"distro_
"instance_id": "i-06b5687b4d7b
"machine": "x86_64",
"platform": "ec2",
"python_
"region": "us-east-2",
"variant": "ubuntu"
}
}
EOF
for release in focal jammy kinetic lunar; do
VM=sru-$release
lxc launch ubuntu-
while ! lxc exec $VM -- cloud-init status --wait --long; do
sleep 5
done
echo --- 1. Generate current apport report, selecting Openstack as cloud.
echo --- step through prompts and select 'K' to keep report
echo --- VERSION OF APPORT ---
lxc exec $VM -- apport-bug --version
lxc exec $VM -- apport-bug cloud-init
APPORT_FILE=$(lxc exec $VM ls /tmp | grep apport)
lxc file pull $VM/tmp/
lxc exec $VM rm /tmp/$APPORT_FILE
lxc file push setup_proposed.sh $VM/
lxc exec $VM -- bash /setup_proposed.sh | grep cloud-init
lxc file push openstack.json $VM/run/
echo --- 2. Generate -proposed apport report which sources openstack instance-data.json, selecting Openstack as cloud.
lxc exec $VM -- apport-bug cloud-init
APPORT_FILE=$(lxc exec $VM ls /tmp | grep apport)
lxc file pull $VM/tmp/
lxc exec $VM rm /tmp/$APPORT_FILE
echo --- 3. Generate -proposed apport report which sources ec2 instance-data, selecting Ec2 as cloud.
lxc file push ec2.json $VM/run/
lxc exec $VM -- apport-bug cloud-init
APPORT_FILE=$(lxc exec $VM ls /tmp | grep apport)
lxc file pull $VM/tmp/
lxc exec $VM rm /tmp/$APPORT_FILE
# redact logs lines for easy diffs
for file in `ls apport*`; do
sed -i '1,/logs.tgz/!d' $file
done
echo --- 4. Inspect diff tags of orig to openstack-proposed report
diff -urN apport-$VM.orig apport-
echo --- 5. Inspect diff tags of openstack-proposed to ec2-proposed report
diff -urN apport-
done
[ Where problems could occur ]
apport-bug could traceback on poor logic preventing simple bug filing at apport CLI. It could omit tags if unable to process cloud-init/
[ Other Info ]
[Original description]
Issues:
- Using the presence of cloud-init to flag an image as a cloud image is incorrect now that ubuntu-server includes cloud-init (and ubuntu-core images)
- Using the presence of EC2 metadata source is incorrect as many non-EC2 clouds provide EC2 metadata. Thus we have bugs like bug #1722946 that are tagged as an 'ec2-images' bug which are clearly on openstack
- Marking all bugs that have cloud-init but no EC2 metadata source as an 'uec-images' bug uses a name that no longer has meaning.
Solution:
- If cloud-init is present, check for /etc/cloud/
- If cloud-init is present, check for the presence of /run/cloud-
I have filed bug #1724626 to ask cloud-init development to surface more information from ds-identify to help ID the cloud so that we can better tag/annotate the bug. There may also be some info we can get to indicate the image ID on more clouds than just AWS. At a minimum I would like to see dsidentify make the EC2 platform it found available for consumers in cloud.cfg. This would allow us to identify AWS EC2 from look-alike datasources so that we can tag a bug as ec2-images for bug really on AWS and add EC2 specific fields to the description/
description: | updated |
tags: | added: cloud-images |
tags: | added: id-59e78c0740facf10f025ddef |
tags: | added: fr-266 |
Changed in apport: | |
status: | Fix Committed → Fix Released |
description: | updated |
description: | updated |
Changed in cloud-init (Ubuntu Lunar): | |
status: | New → Fix Committed |
description: | updated |
cloud-init can collect relevant logs with 'cloud-init collect-logs'
that is what we tell people to run (and what gets done with 'ubuntu-bug cloud-init').
I know that is not exactly what you're after.