Since we implemented the --environment-directory option [1] to the 'openstack overcloud container image prepare' command, there is a possibility it outputs empty files when calling the command without additional options.
Previously, calling the command without options would render the template at [2] without filtering the images. However, since we defaulted the --environment-directory to ~/.tripleo/environments to match the deploy command, this could enable the filtering in case this directory contains an environment file even though we're not explicitly asking for it.
One workaround is to always pass the roles_data file and heat environment files that are going to be used in the deployment to the 'prepare' command to get a slick file with just the necessary images, or point the --environment-directory to an empty directory to keep generating for all images.
[1] https://review.openstack.org/#/c/511521/
[2] https://github.com/openstack/tripleo-common/blob/master/container-images/overcloud_containers.yaml.j2
the workaround to specify --environment- directory does not work, at least in queens, the .tripleo/ environment directory is still being read. A file is being added here when one uses the upload- puppet- modules utility:
# normal undercloud s1undercloud- 0 ~]$ openstack overcloud container image prepare io/tripleomaste r/centos- binary- aodh-api: current- tripleo io/tripleomaste r/centos- binary- aodh-evaluator: current- tripleo
(undercloud) [stack@
container_images:
- imagename: docker.
- imagename: docker.
# ..etc
# then upload- puppet- modules on plain puppet files:
(undercloud) [stack@ s1undercloud- 0 ~]$ mkdir -p tripleo- patch/puppet- tripleo s1undercloud- 0 ~]$ cp -R /usr/share/ openstack- puppet/ modules/ tripleo tripleo- patch/puppet- tripleo/ s1undercloud- 0 ~]$ upload- puppet- modules -d tripleo- patch/puppet- tripleo .tripleo/ environments/ puppet- modules- url.yaml modules- h0MEFmT/ puppet- modules. tar.gz ------- ------- ---+--- ------- ------- ----+-- ------- ------- ------- ------- ----+ ------- ------- ---+--- ------- ------- ----+-- ------- ------- ------- ------- ----+ modules. tar.gz | overcloud-artifacts | 096bca64ab6da10 58096d64d1840e6 6e | ------- ------- ---+--- ------- ------- ----+-- ------- ------- ------- ------- ----+
(undercloud) [stack@
(undercloud) [stack@
Creating tarball...
Tarball created.
Creating new Swift Temp-URL-Key for container: overcloud-artifacts
Creating heat environment file: /home/stack/
Uploading file to swift: /tmp/puppet-
+------
| object | container | etag |
+------
| puppet-
+------
Upload complete.
# now image prepare is non-functional:
(undercloud) [stack@ s1undercloud- 0 ~]$ openstack overcloud container image prepare
container_images: []
# same if you use --environment- directory:
(undercloud) [stack@ s1undercloud- 0 ~]$ openstack overcloud container image prepare --environment- directory= /tmp/
container_images: []
# remove the puppet- modules- url.yaml file, it works again:
(undercloud) [stack@ s1undercloud- 0 ~]$ mv .tripleo/ environments/ puppet- modules- url.yaml . s1undercloud- 0 ~]$ openstack overcloud container image prepare --environment- directory= ./foo/ io/tripleomaste r/centos- binary- aodh-api: current- tripleo io/tripleomaste r/centos- binary- aodh-evaluator: current- tripleo io/tripleomaste r/centos- binary- aodh-listener: current- tripleo
(undercloud) [stack@
container_images:
- imagename: docker.
- imagename: docker.
- imagename: docker.
I am at least super glad I found this issue because it's been driving me nuts for weeks.