Fix: AWS AMI builds for Ubuntu and CentOS Stream 9
This commit addresses multiple issues preventing successful AMI builds
on AWS for Ubuntu 20.04, 22.04, 24.04, and CentOS Stream 9.
- **Fixed source AMI filters**: Updated to use canonical owner ID (
099720109477)
instead of aws-marketplace for Ubuntu images
- **Removed product code filtering**: Product codes are not applicable for
canonical Ubuntu AMIs
- **Updated AMI name patterns**: Aligned with current Ubuntu naming conventions
- Ubuntu 20.04: ubuntu-*20.04*
- Ubuntu 22.04: ubuntu-*22.04*
- Ubuntu 24.04: ubuntu-*24.04*
- **Fixed version-specific conditionals**: Changed CentOS 8+ filters to
CentOS 8 only (version('8', '==')) to prevent incompatible packages
from being installed on Stream 9
- **Removed obsolete packages**: Excluded packages not available in
CentOS Stream 9 repositories:
- compat-openssl10* (not available in Stream 9)
- python36* packages (Stream 9 uses python3.9+)
- openssl11* packages
- **Enable SR-IOV networking**: Added `enable_ena_support = true` to
enable enhanced networking on all AMIs for better performance and
Jenkins EC2 plugin compatibility
- **Increased root volume size**: Changed from 8GB to 10GB to prevent
"No space left on device" errors during Jenkins builds
- **Standardized instance types**: Using t3.small for consistent builds
- **Improved metadata support**: Added IMDS v2 configuration
- **Added apt-get update**: Ensures package lists are current before
installing dependencies on Ubuntu
- **Fixed repository availability**: Prevents package installation failures
due to stale package lists
- ✅ Ubuntu 22.04 AMI: ami-
049dc0c4ecd9335ae (verified working in Jenkins)
- ✅ CentOS Stream 9 AMI: ami-
0541c45aeac2e4a04 (build successful)
- ✅ Disk space issue resolved (10GB root volume)
- ✅ Jenkins JClouds plugin can provision instances
- Minor pip dependency conflicts in Jenkins builds (non-blocking, UNSTABLE status)
- Ansible role fixes need to be submitted separately to ansible/roles repo
- Resolves AWS AMI provisioning failures
- Fixes "Invalid Image Id" errors in Jenkins EC2 plugin
- Fixes "No space left on device" errors during builds
Change-Id: I250622af42847c6078cd6f76eb9068ae70c72a91
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>