From b2b051630e3d4150a5d324e7e33f5c59dab4ae37 Mon Sep 17 00:00:00 2001 From: Nicolas Vinuesa Date: Tue, 20 Aug 2024 15:10:19 +0200 Subject: [PATCH] fix(ec2): add storage tag for 23.10+ aws cloud images After 23.10, cloud images have changed their volume type on AWS (https://documentation.ubuntu.com/aws/en/latest/aws-how-to/instances/find-ubuntu-images). This patch adds the new storage tag (`ssd-gp3` on simplestreams) to the image filtering method on ec2 provider, thus fixing the bug preventing deploying noble images on aws. --- provider/ec2/environ.go | 7 ++++--- provider/ec2/image_test.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/provider/ec2/environ.go b/provider/ec2/environ.go index 08ed6f12b99..fe27c06371b 100644 --- a/provider/ec2/environ.go +++ b/provider/ec2/environ.go @@ -530,8 +530,9 @@ func (e *environ) Region() (simplestreams.CloudSpec, error) { } const ( - ebsStorage = "ebs" - ssdStorage = "ssd" + ebsStorage = "ebs" + ssdGP3Storage = "ssd-gp3" + ssdStorage = "ssd" ) // DistributeInstances implements the state.InstanceDistributor policy. @@ -639,7 +640,7 @@ func (e *environ) StartInstance( Base: args.InstanceConfig.Base, Arch: arch, Constraints: args.Constraints, - Storage: []string{ssdStorage, ebsStorage}, + Storage: []string{ssdStorage, ebsStorage, ssdGP3Storage}, }, ) if err != nil { diff --git a/provider/ec2/image_test.go b/provider/ec2/image_test.go index 16229645887..7f90ca7e8ce 100644 --- a/provider/ec2/image_test.go +++ b/provider/ec2/image_test.go @@ -220,7 +220,7 @@ func (s *specSuite) TestFindInstanceSpec(c *gc.C) { test.storage) stor := test.storage if len(stor) == 0 { - stor = []string{ssdStorage, ebsStorage} + stor = []string{ssdStorage, ebsStorage, ssdGP3Storage} } // We need to filter the image metadata to the test's // arches and series; the provisioner and bootstrap