Symptoms
When running a Konvoy Image Builder job, it is possible to encounter a message stating the following:
==> Some builds didn't complete successfully and had errors:
--> centos-7.9: Error modify snapshot attributes: OperationNotPermitted: Snapshots with marketplace product codes may not be made public.
status code: 400, request id: 9c99288b-45d6-4c8b-97d6-ab16407b5c9e
or
==> Some builds didn't complete successfully and had errors:
--> ubuntu-22.04: Error modify snapshot attributes: OperationNotPermitted: Encrypted snapshots cannot be shared publicly.
status code: 400, request id: 6f9fb694-3a8d-4ebd-a238-1c79235e0326
Solution
- In the KIB folder, go inside the
work
directory. - Inside this directory there will be further directories and if you ran KIB for the first time, there will only be one directory. If you have previously used KIB, you may list the directory and browse inside the latest created directory.
- Look for the specific file inside the OS work directory you will either find a file named
packer.json
(for DKP 2.4.x and KIB 1.24) orpacker.pkr.hcl
(for DKP 2.5.x and KIB 2.2). - Modify the file and look for the section snapshot_groups: all. For 2.4.x set the value from all to an empty string
"snapshot_groups": ""
. For 2.5.x set the value to an empty arraysnapshot_groups: []
- From here re-run the KIB job and pass another flag to include
--ami-users
with the account allowed to access the image. - Also include the flag
--package-manifest work/<os>/packer<.json/.pkr.hcl>
to use the modified file modified in the steps above.