Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1607925

Summary: openstack overcloud container image upload will first upload and then cleanup all the images
Product: Red Hat OpenStack Reporter: Chen <cchen>
Component: openstack-containersAssignee: Steve Baker <sbaker>
Status: CLOSED DUPLICATE QA Contact: Marius Cornea <mcornea>
Severity: medium Docs Contact: Andrew Burden <aburden>
Priority: unspecified    
Version: 13.0 (Queens)CC: cchen, m.andre, mburns, m.messeiry, sbaker
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-25 01:29:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chen 2018-07-24 14:48:11 UTC
Description of problem:

openstack overcloud container image upload will first upload and then cleanup all the images

Snip of sudo openstack overcloud container image upload --config-file local_registry_images.yaml --verbose

result ['registry.access.redhat.com/rhosp13/openstack-swift-proxy-server:13.0-46', '192.168.24.1:8787/rhosp13/openstack-swift-proxy-server:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-aodh-api:13.0-47', '192.168.24.1:8787/rhosp13/openstack-aodh-api:13.0-47', 'registry.access.redhat.com/rhosp13/openstack-aodh-evaluator:13.0-46', '192.168.24.1:8787/rhosp13/openstack-aodh-evaluator:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-aodh-listener:13.0-46', '192.168.24.1:8787/rhosp13/openstack-aodh-listener:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-aodh-notifier:13.0-46', '192.168.24.1:8787/rhosp13/openstack-aodh-notifier:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-ceilometer-central:13.0-44', '192.168.24.1:8787/rhosp13/openstack-ceilometer-central:13.0-44', 'registry.access.redhat.com/rhosp13/openstack-ceilometer-compute:13.0-46', '192.168.24.1:8787/rhosp13/openstack-ceilometer-compute:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-ceilometer-notification:13.0-45', '192.168.24.1:8787/rhosp13/openstack-ceilometer-notification:13.0-45', 'registry.access.redhat.com/rhosp13/openstack-cinder-api:13.0-46', '192.168.24.1:8787/rhosp13/openstack-cinder-api:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-cinder-scheduler:13.0-45', '192.168.24.1:8787/rhosp13/openstack-cinder-scheduler:13.0-45', 'registry.access.redhat.com/rhosp13/openstack-cinder-volume:13.0-45', '192.168.24.1:8787/rhosp13/openstack-cinder-volume:13.0-45', 'registry.access.redhat.com/rhosp13/openstack-cron:13.0-51', '192.168.24.1:8787/rhosp13/openstack-cron:13.0-51', 'registry.access.redhat.com/rhosp13/openstack-glance-api:13.0-47', '192.168.24.1:8787/rhosp13/openstack-glance-api:13.0-47', 'registry.access.redhat.com/rhosp13/openstack-gnocchi-api:13.0-45', '192.168.24.1:8787/rhosp13/openstack-gnocchi-api:13.0-45', 'registry.access.redhat.com/rhosp13/openstack-gnocchi-metricd:13.0-46', '192.168.24.1:8787/rhosp13/openstack-gnocchi-metricd:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-gnocchi-statsd:13.0-46', '192.168.24.1:8787/rhosp13/openstack-gnocchi-statsd:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-haproxy:13.0-47', '192.168.24.1:8787/rhosp13/openstack-haproxy:13.0-47', 'registry.access.redhat.com/rhosp13/openstack-heat-api-cfn:13.0-45', '192.168.24.1:8787/rhosp13/openstack-heat-api-cfn:13.0-45', 'registry.access.redhat.com/rhosp13/openstack-heat-api:13.0-46', '192.168.24.1:8787/rhosp13/openstack-heat-api:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-heat-engine:13.0-44', '192.168.24.1:8787/rhosp13/openstack-heat-engine:13.0-44', 'registry.access.redhat.com/rhosp13/openstack-horizon:13.0-45', '192.168.24.1:8787/rhosp13/openstack-horizon:13.0-45', 'registry.access.redhat.com/rhosp13/openstack-iscsid:13.0-45', '192.168.24.1:8787/rhosp13/openstack-iscsid:13.0-45', 'registry.access.redhat.com/rhosp13/openstack-keystone:13.0-44', '192.168.24.1:8787/rhosp13/openstack-keystone:13.0-44', 'registry.access.redhat.com/rhosp13/openstack-mariadb:13.0-47', '192.168.24.1:8787/rhosp13/openstack-mariadb:13.0-47', 'registry.access.redhat.com/rhosp13/openstack-memcached:13.0-46', '192.168.24.1:8787/rhosp13/openstack-memcached:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-neutron-dhcp-agent:13.0-48', '192.168.24.1:8787/rhosp13/openstack-neutron-dhcp-agent:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-neutron-l3-agent:13.0-47', '192.168.24.1:8787/rhosp13/openstack-neutron-l3-agent:13.0-47', 'registry.access.redhat.com/rhosp13/openstack-neutron-metadata-agent:13.0-48', '192.168.24.1:8787/rhosp13/openstack-neutron-metadata-agent:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-neutron-openvswitch-agent:13.0-48', '192.168.24.1:8787/rhosp13/openstack-neutron-openvswitch-agent:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-neutron-server:13.0-48', '192.168.24.1:8787/rhosp13/openstack-neutron-server:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-nova-api:13.0-48', '192.168.24.1:8787/rhosp13/openstack-nova-api:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-nova-compute:13.0-48', '192.168.24.1:8787/rhosp13/openstack-nova-compute:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-nova-conductor:13.0-48', '192.168.24.1:8787/rhosp13/openstack-nova-conductor:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-nova-consoleauth:13.0-47', '192.168.24.1:8787/rhosp13/openstack-nova-consoleauth:13.0-47', 'registry.access.redhat.com/rhosp13/openstack-nova-libvirt:13.0-52', '192.168.24.1:8787/rhosp13/openstack-nova-libvirt:13.0-52', 'registry.access.redhat.com/rhosp13/openstack-nova-novncproxy:13.0-48', '192.168.24.1:8787/rhosp13/openstack-nova-novncproxy:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-nova-placement-api:13.0-48', '192.168.24.1:8787/rhosp13/openstack-nova-placement-api:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-nova-scheduler:13.0-48', '192.168.24.1:8787/rhosp13/openstack-nova-scheduler:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-panko-api:13.0-47', '192.168.24.1:8787/rhosp13/openstack-panko-api:13.0-47', 'registry.access.redhat.com/rhosp13/openstack-rabbitmq:13.0-47', '192.168.24.1:8787/rhosp13/openstack-rabbitmq:13.0-47', 'registry.access.redhat.com/rhosp13/openstack-redis:13.0-49', '192.168.24.1:8787/rhosp13/openstack-redis:13.0-49', 'registry.access.redhat.com/rhosp13/openstack-swift-account:13.0-46', '192.168.24.1:8787/rhosp13/openstack-swift-account:13.0-46', 'registry.access.redhat.com/rhosp13/openstack-swift-container:13.0-48', '192.168.24.1:8787/rhosp13/openstack-swift-container:13.0-48', 'registry.access.redhat.com/rhosp13/openstack-swift-object:13.0-45', '192.168.24.1:8787/rhosp13/openstack-swift-object:13.0-45']


Removing local copy of 192.168.24.1:8787/rhosp13/openstack-aodh-api:13.0-47
Removing local copy of 192.168.24.1:8787/rhosp13/openstack-aodh-evaluator:13.0-46

$ docker images | wc -l
1

Version-Release number of selected component (if applicable):

OSP13

How reproducible:

100%

Steps to Reproduce:
1.  openstack --debug overcloud container image prepare -vvvvvvvv --namespace=registry.access.redhat.com/rhosp13 --push-destination=192.168.24.1:8787 --prefix=openstack --tag-from-label {version}-{release} --output-env-file=/tmp/overcloud_images_osp13.yaml --output-images-file /tmp/local_registry_images.yaml
2. sudo openstack overcloud container image upload --config-file /tmp/local_registry_images_osp13.yaml  --verbose
3.

Actual results:

In cleanup() function of tripleo_common/image/image_uploader.py all the images are regarded as local_images and they all get deleted.

Expected results:


Additional info:

Comment 1 Steve Baker 2018-07-24 21:40:57 UTC
The cleanup doesn't delete all local images, it deletes images involved in the upload operation.

The local docker images is different to the local registry images. Running "docker images" doesn't actually say what images exist in the registry. To do this you need to inspect an individual image, like:

  skopeo inspect --tls-verify=false docker://192.168.24.1:8787/rhosp13/openstack-swift-container:13.0-48

Can you please elaborate on why this cleanup behaviour is a problem?

Comment 4 messeiry 2018-09-04 20:24:14 UTC
Hi, I do have the same issues, the output of skopeo is 


[stack@director ~]$ skopeo inspect --tls-verify=false docker://10.20.10.1:8787/rhosp13/openstack-aodh-api:13.0-55
{
    "Name": "10.20.10.1:8787/rhosp13/openstack-aodh-api",
    "Digest": "sha256:27380887edc728030a19c77fd6be3b09f1704bbe7fef1b1fa108421f52389ef7",
    "RepoTags": [
        "13.0-55"
    ],
    "Created": "2018-08-16T02:21:32.481381Z",
    "DockerVersion": "1.12.6",
    "Labels": {
        "architecture": "x86_64",
        "authoritative-source-url": "registry.access.redhat.com",
        "batch": "20180814.1",
        "build-date": "2018-08-16T02:20:32.346638",
        "com.redhat.build-host": "osbs-cpt-010.ocp.osbs.upshift.eng.rdu2.redhat.com",
        "com.redhat.component": "openstack-aodh-api-container",
        "description": "Red Hat OpenStack Platform 13.0 aodh-api",
        "distribution-scope": "public",
        "io.k8s.description": "Red Hat OpenStack Platform 13.0 aodh-api",
        "io.k8s.display-name": "Red Hat OpenStack Platform 13.0 aodh-api",
        "io.openshift.expose-services": "",
        "io.openshift.tags": "rhosp osp openstack osp-13.0",
        "maintainer": "Red Hat, Inc.",
        "name": "rhosp13/openstack-aodh-api",
        "release": "55",
        "summary": "Red Hat OpenStack Platform 13.0 aodh-api",
        "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/rhosp13/openstack-aodh-api/images/13.0-55",
        "usage": "This image is very generic and does not serve a single use case. Use it as a base to build your own images.",
        "vcs-ref": "62f65728de51e787eea0a02031ab2562916235aa",
        "vcs-type": "git",
        "vendor": "Red Hat, Inc.",
        "version": "13.0"
    },
    "Architecture": "amd64",
    "Os": "linux",
    "Layers": [
        "sha256:378837c0e24ad4a2e33f0eb3d68dc0c31d9a7dbbd5357d4acafec1d3a7930602",
        "sha256:e17262bc23414bd3c0e9808ad7a87b055fe5afec386da42115a839ea2083d233",
        "sha256:8c2b108a3545995c61d8907ce772975fba6f54b98d81e65a2a0ca4aa777931fa",
        "sha256:b8b6014d57c08575c8a3c0c00a3bf5342ab91d940adbbbbf2e642d46ad267c23",
        "sha256:3df75efa25813128e5b156bc9d62588bbd7d7f937b2279d334f93dd53d5710f0",
        "sha256:aef69c5157b2582c80e9db0eee4fbe2fd21791b21b01f71d4ecc45412cdfe0a8"
    ]
}


However, i think docker images should be able to show the images list, other wise how to validate that i have the correct images

Comment 5 messeiry 2018-09-04 20:33:50 UTC
also, when i try to use docker to pull from registery there is nothing. 

[stack@director ~]$ docker pull 10.20.10.1:8787/rhosp13/openstack-aodh-api
Using default tag: latest
Trying to pull repository 10.20.10.1:8787/rhosp13/openstack-aodh-api ...
Pulling repository 10.20.10.1:8787/rhosp13/openstack-aodh-api
Error: image rhosp13/openstack-aodh-api:latest not found


note that during the upload when i run docker images, i see all images being uploaded, then the command is removing them, as my colleague here mentioned before.

how can we validate if the docker images are being uploaded to the local registry?

Comment 6 Steve Baker 2018-09-05 22:24:35 UTC

*** This bug has been marked as a duplicate of bug 1599106 ***

Comment 7 Steve Baker 2018-09-05 22:27:26 UTC
See the documentation section 5.5.5 for the current recommended commands to confirm that images have been successfully uploaded:

https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/13/html/director_installation_and_usage/configuring-a-container-image-source#registry-methods

Regarding the "docker pull" command in comment #5, you need to specify the full tagged path as it appears in /home/stack/templates/overcloud_images.yaml

Comment 8 messeiry 2018-09-06 08:17:02 UTC
i did re-prepare: 

$ openstack overcloud container image prepare \
--namespace=registry.access.redhat.com/rhosp13 \
--push-destination=10.20.10.1:8787 \
--prefix=openstack- \
-e /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible.yaml \
--set ceph_namespace=registry.access.redhat.com/rhceph \
--set ceph_image=rhceph-3-rhel7 \
--tag-from-label {version}-{release} \
--output-env-file=/home/stack/templates/overcloud_images.yaml \
--output-images-file /home/stack/local_registry_images.yaml


$ sudo openstack overcloud container image upload \
  --config-file  /home/stack/local_registry_images.yaml \
  --verbose

$ url http://10.20.10.1:8787/v2/_catalog | jq .repositories[]
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1526  100  1526    0     0   183k      0 --:--:-- --:--:-- --:--:--  212k
"rhceph/rhceph-3-rhel7"
"rhosp13/openstack-aodh-api"
"rhosp13/openstack-aodh-evaluator"
"rhosp13/openstack-aodh-listener"
"rhosp13/openstack-aodh-notifier"
"rhosp13/openstack-ceilometer-central"
"rhosp13/openstack-ceilometer-compute"
"rhosp13/openstack-ceilometer-notification"
"rhosp13/openstack-cinder-api"
"rhosp13/openstack-cinder-scheduler"
"rhosp13/openstack-cinder-volume"
"rhosp13/openstack-cron"
"rhosp13/openstack-glance-api"
"rhosp13/openstack-gnocchi-api"
"rhosp13/openstack-gnocchi-metricd"
"rhosp13/openstack-gnocchi-statsd"
"rhosp13/openstack-haproxy"
"rhosp13/openstack-heat-api"
"rhosp13/openstack-heat-api-cfn"
"rhosp13/openstack-heat-engine"
"rhosp13/openstack-horizon"
"rhosp13/openstack-iscsid"
"rhosp13/openstack-keystone"
"rhosp13/openstack-mariadb"
"rhosp13/openstack-memcached"
"rhosp13/openstack-neutron-dhcp-agent"
"rhosp13/openstack-neutron-l3-agent"
"rhosp13/openstack-neutron-metadata-agent"
"rhosp13/openstack-neutron-openvswitch-agent"
"rhosp13/openstack-neutron-server"
"rhosp13/openstack-nova-api"
"rhosp13/openstack-nova-compute"
"rhosp13/openstack-nova-conductor"
"rhosp13/openstack-nova-consoleauth"
"rhosp13/openstack-nova-libvirt"
"rhosp13/openstack-nova-novncproxy"
"rhosp13/openstack-nova-placement-api"
"rhosp13/openstack-nova-scheduler"
"rhosp13/openstack-panko-api"
"rhosp13/openstack-rabbitmq"
"rhosp13/openstack-redis"
"rhosp13/openstack-swift-account"
"rhosp13/openstack-swift-container"
"rhosp13/openstack-swift-object"
"rhosp13/openstack-swift-proxy-server"


cat templates/overcloud_images.yaml | grep keystone

  DockerKeystoneConfigImage: 10.20.10.1:8787/rhosp13/openstack-keystone:13.0-53
  DockerKeystoneImage: 10.20.10.1:8787/rhosp13/openstack-keystone:13.0-53

$ skopeo inspect --tls-verify=false docker://10.20.10.1:8787/rhosp13/openstack-keystone:13.0-53
{
    "Name": "10.20.10.1:8787/rhosp13/openstack-keystone",
    "Digest": "sha256:1f5b1a4168b8c02ca03b39c29314a32df977721a762174099208abc97cec902f",
    "RepoTags": [
        "13.0-53"
    ],
    "Created": "2018-08-16T01:55:17.36261Z",
    "DockerVersion": "1.12.6",
    "Labels": {
        "architecture": "x86_64",
        "authoritative-source-url": "registry.access.redhat.com",
        "batch": "20180814.1",
        "build-date": "2018-08-16T01:54:55.959066",
        "com.redhat.build-host": "osbs-cpt-007.ocp.osbs.upshift.eng.rdu2.redhat.com",
        "com.redhat.component": "openstack-keystone-container",
        "description": "Red Hat OpenStack Platform 13.0 keystone",
        "distribution-scope": "public",
        "io.k8s.description": "Red Hat OpenStack Platform 13.0 keystone",
        "io.k8s.display-name": "Red Hat OpenStack Platform 13.0 keystone",
        "io.openshift.expose-services": "",
        "io.openshift.tags": "rhosp osp openstack osp-13.0",
        "maintainer": "Red Hat, Inc.",
        "name": "rhosp13/openstack-keystone",
        "release": "53",
        "summary": "Red Hat OpenStack Platform 13.0 keystone",
        "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/rhosp13/openstack-keystone/images/13.0-53",
        "usage": "This image is very generic and does not serve a single use case. Use it as a base to build your own images.",
        "vcs-ref": "29ff48fe838d66f3a2f886dc8cc02e310e09e42a",
        "vcs-type": "git",
        "vendor": "Red Hat, Inc.",
        "version": "13.0"
    },
    "Architecture": "amd64",
    "Os": "linux",
    "Layers": [
        "sha256:378837c0e24ad4a2e33f0eb3d68dc0c31d9a7dbbd5357d4acafec1d3a7930602",
        "sha256:e17262bc23414bd3c0e9808ad7a87b055fe5afec386da42115a839ea2083d233",
        "sha256:8c2b108a3545995c61d8907ce772975fba6f54b98d81e65a2a0ca4aa777931fa",
        "sha256:b8b6014d57c08575c8a3c0c00a3bf5342ab91d940adbbbbf2e642d46ad267c23",
        "sha256:bad492528fc8f4a7eeb78a7570b50bc03491994936f5228cac634d3a75c91cbd",
        "sha256:a73115a8c37bc7383a1512519b55f59c6f79406548386a8eef6a1c9102ea8b57"
    ]
}

so i guess the way we check on the local registery is different, however i still dont understand why the docker images command is not showing the local registry images?

Comment 9 Steve Baker 2018-09-06 19:31:30 UTC
Running "docker images" only shows the images in local docker storage, which is completely different to the images stored in the undercloud registry.

Having "10.20.10.1:8787/rhosp13/openstack-keystone:13.0-53" show up in a docker images output *might* mean it is really there in the registry, or it might not because it was deleted or never pushed. So using it to validate images being in the registry is misleading and not useful.

Comment 10 messeiry 2018-09-08 09:35:10 UTC
thanks Steve.