Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1383045

Summary: [atomic storage] importing containers can't be started
Product: Red Hat Enterprise Linux 7 Reporter: Alex Jia <ajia>
Component: atomicAssignee: smahajan <smahajan>
Status: CLOSED NOTABUG QA Contact: atomic-bugs <atomic-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.3CC: dwalsh
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-11 15:23:21 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 Alex Jia 2016-10-09 09:52:44 UTC
Description of problem:
Running a container then export it to specified path then recovery it again after resetting storage, the original command in running container is replaced w/ "/run/gotar -xf -", obviously, it will be failed to start it by docker.

In addition, could we recovery running container w/ previous specified name? at present, the container is imported by random name, although you gave a name for running container before resetting storage.

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

[root@atomic-host-001 cloud-user]# cat /etc/redhat-release 
Red Hat Enterprise Linux Atomic Host release 7.3

[root@atomic-host-001 cloud-user]# rpm -q atomic docker
atomic-1.12.5-2.el7.x86_64
docker-1.10.3-55.el7.x86_64


How reproducible:
always

Steps to Reproduce:
1. docker pull busybox
2. docker run -itd --name storage_test busybox /bin/sh
3. atomic storage export --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker
4. systemctl stop docker
5. atomic storage reset
6. systemctl start docker
7. atomic -y storage import --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker
8. docker ps -a
9. docker start <container_id>

Actual results:

[root@atomic-host-001 cloud-user]# docker run -itd --name storage_test busybox /bin/sh
a98e0e1a4fbc665d859e3a3b7b34ed5efd823f83309b3e2a3b1b2cff1250c003

[root@atomic-host-001 cloud-user]# atomic storage export --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker
Exporting image: e02e811dd08f
Exporting container: a98e0e1a4fbc
Exporting volumes
atomic export completed successfully

[root@atomic-host-001 cloud-user]# systemctl stop docker
[root@atomic-host-001 cloud-user]# atomic storage reset
[root@atomic-host-001 cloud-user]# systemctl start docker

[root@atomic-host-001 cloud-user]# atomic -y storage import --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker
Importing image: e02e811dd08f
Importing container: a98e0e1a4fbc
Importing volumes
atomic import completed successfully
Deleting /tmp/atomic_storage_export_1

[root@atomic-host-001 cloud-user]# docker ps -a
CONTAINER ID        IMAGE               COMMAND              CREATED             STATUS                      PORTS               NAMES
a98e0e1a4fbc        e02e811dd08f        "/run/gotar -xf -"   26 seconds ago      Exited (0) 24 seconds ago                       high_ardinghelli


[root@atomic-host-001 cloud-user]# docker start a98e0e1a4fbc
Error response from daemon: Cannot start container a98e0e1a4fbc665d859e3a3b7b34ed5efd823f83309b3e2a3b1b2cff1250c003: [9] System error: exit status 1
Error: failed to start containers: a98e0e1a4fbc


Expected results:

the container command should be previous command not "/run/gotar -xf -", it had better to keep previous container name, it will be convenient for users to recovery previous container by name later.


Additional info:

Comment 2 smahajan@redhat.com 2016-10-10 16:48:18 UTC
Hi Alex,

Initially after the import, the entry point to the container would be "/run/gotar -xf -". However the user gets a message "Please restart docker daemon for the changes to take effect". N Once the user restart the docker daemon, things are back to how it was originally. What I am wondering is why you didn't get that message?

I tried this on a F24 VM with atomic rpm package. N This works fine for me.

sh-4.3# atomic -y storage import --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker
Importing image: e02e811dd08f
Importing container: 3c3793af0306
 WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
Importing volumes
atomic import completed successfully
Deleting /tmp/atomic_storage_export_1
****************************************************************************
Please restart docker daemon for the changes to take effect
****************************************************************************
sh-4.3# systemctl restart docker
sh-4.3# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                       PORTS               NAMES
3c3793af0306        busybox             "/bin/sh"           4 minutes ago       Exited (137) 2 seconds ago                       storage_test 

Shishir

Comment 3 Alex Jia 2016-10-11 15:23:21 UTC
(In reply to smahajan from comment #2)
> Hi Alex,
> 
> Initially after the import, the entry point to the container would be
> "/run/gotar -xf -". However the user gets a message "Please restart docker
> daemon for the changes to take effect". N Once the user restart the docker

Shishir, thanks for your details, I forgot to restart docker daemon, everything is okay now.