Skip to content

Commit a6bd287

Browse files
committed
libcloud: update aws-winli creation to use billing code
The Windows License Included (winli) AMI creation logic was reworked in coreos assembler [1] to append the winli billing code to an already-created RHCOS AMI, instead of creating an AMI based on a modified Windows instance. Update the winli build closure to use the new imageupload-aws option. We no longer need to discover and use the latest windows server 2022 AMI ID. [1]: coreos/coreos-assembler#4237
1 parent 8dd4b5f commit a6bd287

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

libcloud.groovy

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,31 +66,6 @@ def replicate_to_clouds(pipecfg, basearch, buildID, stream) {
6666
touch ${aws_image_path}
6767
""")
6868

69-
// Discover the latest Windows Server AMI to use as the winli-builder instance.
70-
// The AMI rotates frequently with Windows updates and is not persistant in AWS
71-
// for very long, so we need to find the most recent AMI ID.
72-
// Windows Server 2022 was selected here because the Windows Server 2025 AMI does
73-
// not allow legacy bios. WS2022 has an EOL date of 2026-10-13.
74-
// https://learn.microsoft.com/en-us/lifecycle/products/windows-server-2022
75-
// If WS2022 becomes inaccessible in the future and we still need BIOS for our
76-
// winli images then we can just use one of our own previously created winli
77-
// images and pass that to `--windows-ami` below.
78-
def windows_server_ami_name = ""
79-
windows_server_ami_name = "Windows_Server-2022-English-Full-Base-*"
80-
def windows_server_ami = shwrapCapture("""
81-
aws ec2 describe-images \
82-
--region=${c.primary_region} \
83-
--owners="amazon" \
84-
--filters="Name=name,Values=${windows_server_ami_name}" \
85-
--query="sort_by(Images, &CreationDate)[-1].ImageId" \
86-
--output text
87-
""")
88-
89-
// validate that we did actually get an AMI ID returned.
90-
if (!(windows_server_ami_name != /^ami-[0-9][a-f]{17}$/)) {
91-
error("Invalid Windows Server AMI ID: ${windows_server_ami}")
92-
}
93-
9469
def extraArgs = []
9570
if (c.grant_users) {
9671
extraArgs += c.grant_users.collect{"--grant-user=${it}"}
@@ -106,7 +81,7 @@ def replicate_to_clouds(pipecfg, basearch, buildID, stream) {
10681
cosa imageupload-aws \
10782
--upload \
10883
--winli \
109-
--windows-ami=${windows_server_ami} \
84+
--winli-billing-product ${c.winli_billing_code}\
11085
--arch=${basearch} \
11186
--build=${buildID} \
11287
--region=${c.primary_region} \

0 commit comments

Comments
 (0)