deprecate ubuntu_advantage config key from user-data in favor of ubuntu_pro
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Triaged
|
Undecided
|
Unassigned | ||
Xenial |
Incomplete
|
Undecided
|
Unassigned | ||
Bionic |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
* This backport supplements cloud-config user-data schema to allow customers to provide an `ubuntu_pro:` key in cloud-config user-data to auto-attach non-pro images to Ubuntu Pro at instance launch. This ubuntu_pro key support is provided in addition to the existing `ubuntu-advantage:` keys that are currently supported on Xenial/Bionic. This allows uniform configuration and tooling when launching instances across either ESM releases and active supported LTS such as Jammy and Noble.
* It also standardizes customer documentation for 'how to attach to Ubuntu Pro' to allow a single documented procedure and config that is applicable across ESM and active support LTS. It provides customers with the ability to launch any instance in Xenial and Bionic and automatically attach or modify Ubuntu Pro services using the same #cloud-config user-data which can also be used on all active supported LTSes such as Jammy and Noble.
* There are additional motivations to migrate away from ubuntu-advantage and ubuntu_advantage references in all Canonical products as the product name Ubuntu Advantage has been replaced with Ubuntu Pro, so aligning customer expectation with the proper product name reduces customer confusion and documentation concerns.
* Without this backport to unify cloud-config schema for Pro-related functionality, users wishing to attach Xenial, Bionic and Jammy/Noble VMs with cloud-config user-data have to provide separate user-data for each release. Like the following:
- Xenial or Bionic token attach and limit services enabled to esm-infra
#cloud-config
ubuntu-advantage:
token: <your_token>
enable: [esm-infra]
-- or --
#cloud-config
ubuntu_advantage:
token: <your_token>
enable: [esm-infra]
- Focal, Jammy and Noble
#cloud-config
ubuntu_pro:
token: <your_token>
enable: [esm-infra]
* This uploaded fixes this feature gap by addition supplemental cloud-config schema support for ubuntu_pro: key while also retaining support for previous ubuntu-advantage and ubuntu_advantage schema.
[ Test Plan ]
SRU verification manual testing to perform:
- SRU behavior verification:
1. Assert ubuntu_pro key is ignored on released xenial cloud-init
2. Assert ubuntu_pro key is honored on -proposed cloud-init. (pro detach/cloud-init clean)
3. Assert ubuntu-advantage key is honored on -proposed cloud-init (pro detach/cloud-init clean)
4. Assert ubuntu-advantage key debug logs about deprecation in /var/log/
```
#!/bin/bash
set -ex
RELEASE=$1
UA_TOKEN=$2
VM_NAME=
lxc init ubuntu-
lxc config device add $VM_NAME config disk source=
WAIT_CMD=
wait_for_
sleep 5
while ! lxc exec $VM_NAME -- $WAIT_CMD; do
echo 'waiting...'
sleep 5
done
}
if [ $RELEASE = "xenial" ]; then
lxc config set $VM_NAME cloud-init.
#cloud-config
packages:
- ubuntu-
- linux-image-
runcmd:
- mount -t 9p config /mnt
- cd /mnt
- ./install.sh
- cd /
- umount /mnt
- systemctl start lxd-agent # XXX: causes a reboot
EOF
else
lxc config set $VM_NAME cloud-init.
#cloud-config
packages:
- ubuntu-
runcmd:
- mount -t 9p config /mnt
- cd /mnt
- ./install.sh
- cd /
- umount /mnt
- systemctl start lxd-agent # XXX: causes a reboot
EOF
fi
lxc start --console $VM_NAME || true # hit enter on prompt
echo "-- confirm cloud-init boot complete"
wait_for_cloud_init
echo "-- setup ubuntu_pro attach user-data"
cat > ubuntu_pro.yaml << EOF
#cloud-config
ubuntu_pro:
token: $UA_TOKEN
EOF
echo "-- setup ubuntu-advantage attach user-data"
cat > ubuntu_adv.yaml << EOF
#cloud-config
ubuntu-advantage:
token: $UA_TOKEN
EOF
echo "-- setup ubuntu-advantage commands user-data"
cat > ubuntu_adv_cmd.yaml << EOF
#cloud-config
ubuntu-advantage:
commands:
00: [attach, $UA_TOKEN]
EOF
lxc config set $VM_NAME cloud-init.
lxc exec $VM_NAME -- cloud-init clean --logs --reboot || true
echo "-- confirm orig cloud-init ignores ubuntu_pro"
wait_for_cloud_init
lxc exec $VM_NAME -- pro status --format=json | jq .attached | grep "false" && echo "SUCCESS: expected ignored ubuntu_pro before upgrade" || echo "FAILURE: unexpected pro already attached"
echo "-- Proposed cloud-init honors ubuntu_pro key"
lxc exec $VM_NAME -- add-apt-repository ppa:chad.
lxc exec $VM_NAME -- apt-get update -y
lxc exec $VM_NAME -- apt-get install cloud-init -y
wait_for_cloud_init
lxc exec $VM_NAME -- cloud-init clean --logs --reboot || true
wait_for_cloud_init
lxc exec $VM_NAME -- pro status --format=json | jq .attached | grep "true" && echo "SUCCESS:ubuntu_pro key honored to properly attach after upgrade" || echo "FAILURE: pro did not properly attach with ubuntu_pro key"
echo "-- Proposed cloud-init still honors ubuntu-advantage key"
lxc exec $VM_NAME -- pro detach --assume-yes
lxc exec $VM_NAME -- rm -rf /var/lib/
sed -i 's/ubuntu_
lxc config set $VM_NAME cloud-init.
lxc exec $VM_NAME -- cloud-init clean --logs --reboot || true
sleep 10
wait_for_cloud_init
lxc exec $VM_NAME -- pro status --format=json | jq .attached | grep "true" && echo "SUCCESS: ubuntu pro properly attached with ubuntu-advantage key after upgrade" || echo "FAILURE: pro did not properly attach with ubuntu-advantage key"
echo "-- Proposed cloud-init logs debug deprecation messages"
lxc exec $VM_NAME -- grep ubuntu-adv /var/log/
if [ $RELEASE = "xenial" ]; then
echo "-- Proposed cloud-init still honors ubuntu-
lxc exec $VM_NAME -- pro detach --assume-yes
lxc exec $VM_NAME -- rm -rf /var/lib/
sed -i 's/ubuntu_
lxc config set $VM_NAME cloud-init.
lxc exec $VM_NAME -- cloud-init clean --logs --reboot || true
sleep 10
wait_for_cloud_init
lxc exec $VM_NAME -- pro status --format=json | jq .attached | grep "true" && echo "SUCCESS: ubuntu pro properly attached with ubuntu-
echo "-- Proposed cloud-init logs debug deprecation messages"
lxc exec $VM_NAME -- grep ubuntu-adv /var/log/
fi
[ Where problems could occur ]
* This changeset is limited to the cc_ubuntu_
* Problems could occur in the rename of cc_ubuntu_advantage -> cc_ubunt_pro module if there are customized /etc/cloud/
[ Other Info ]
[ Original description ]
In upstream cloud-init ubuntu_advantage user-data cloud-config key is deprecated in favor of ubuntu_pro to better align with current Ubuntu Pro product naming and to avoid confusion in howtos, tutorials or tooling when interacting with Ubuntu Pro offerings.
In an effort to standardize product naming across all Ubuntu supported releases, we will target a backport of this key deprecation to Xenial and Bionic to ensure Ubuntu Pro's releases covered by Extended Security Maintenance will also align with active Ubuntu Long Term Support(LTS) and interim release configuration keys.
This bug is an SRU process bug representing the intent to backport a limited scope of functionality related to the cc_ubuntu_advantage module for better Ubuntu Pro support ESM releases.
No other functional changes are intended beyond logged messages, user-data schema and config-key deprecation.
Changed in cloud-init (Ubuntu): | |
status: | New → Triaged |
description: | updated |
description: | updated |
Changed in cloud-init (Ubuntu Bionic): | |
status: | Incomplete → New |
Isn't this missing SRU documentation? How do you propose to test this change - for example that use of an "old" cloud-config still works as expected?
Is it correct to treat this as a "deprecation" in Bionic, given that what cloud-init originally supported in Bionic should remain supported until Bionic EOLs? The matter of "deprecation" seems separate to me vs. adding an ubuntu_pro key for unification across all releases, which makes sense to do.