nova docker: Cannot setup network: Cannot find any PID when lanunch container

asked 2015-09-24 05:35:37 -0500

leoyyoung gravatar image

updated 2015-09-26 19:35:40 -0500

smaffulli gravatar image

hi All

In my openstack-docker setup, I have one image named "leo_ubuntu_media", and that image is workable in my setup. Based on this image, I neededt o add one script and make sure the script will be execuble when the container is up, so I created one dockerfile, and make one new image(called "ubuntu_traffic"). This image was workaed ok when I do "docker run ubuntu_traffic", but when I added it into the openstack glance, and try to lanunch container in openstack, the container could not be up, the error "{"message": "Build of instance d0a7b333-6050-41fb-9098-d04d6d053d03 was re-scheduled: Cannot setup network: Cannot find any PID under container" will be displayed.

Logs: Create the image: Create the image:

[root@46-37 temp(keystone_admin)]# cat Dockerfile
# VERSION       3.0

# use the ubuntu base image provided by dotCloud
FROM  leo_ubuntu_media

MAINTAINER Victor Coisne victor.coisne@dotcloud.com

#Copy the script
ADD vm_traffic_start.sh /root/vm_traffic_start.sh
RUN chmod 777 /root/vm_traffic_start.sh
RUN ln -fs /bin/bash /bin/sh

#Execute the script
ENTRYPOINT /root/vm_traffic_start.sh
[root@46-37 temp(keystone_admin)]# docker build -t ubuntu_traffic .
Sending build context to Docker daemon 7.168 kB
Step 0 : FROM leo_ubuntu_media
 ---> 818d2afe9d31
Step 1 : MAINTAINER Victor Coisne victor.coisne@dotcloud.com
 ---> Running in b0f20fa1a0c7
 ---> ac460e901843
Removing intermediate container b0f20fa1a0c7
Step 2 : ADD vm_traffic_start.sh /root/vm_traffic_start.sh
 ---> f415d5f65a3d
Removing intermediate container 77cb9f391be9
Step 3 : RUN chmod 777 /root/vm_traffic_start.sh
 ---> Running in e0e43a09aef3
 ---> 3550e4535450
Removing intermediate container e0e43a09aef3
Step 4 : RUN ln -fs /bin/bash /bin/sh
 ---> Running in e29ad22a6822
 ---> 5ad1e407f102
Removing intermediate container e29ad22a6822
Step 5 : ENTRYPOINT /root/vm_traffic_start.sh
 ---> Running in 184b0a6f85f1
 ---> 3a185c47dda4
Removing intermediate container 184b0a6f85f1
Successfully built 3a185c47dda4


Lanunch the container and errors:
[root@46-37 ~(keystone_admin)]#  nova  boot --flavor 2 --image ubuntu_traffic   --availability-zone nova:46-40.ibm.com --nic net-id=283205ef-8670-4df7-aef0-181e967020a1   leo20
[root@46-37 ~(keystone_admin)]# nova show leo20
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property                             | Value                                                                                                                                                                                                                                                                                                                                                         |
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                                                                                                                                                                                                                                                                                                                        |
| OS-EXT-AZ:availability_zone          | docker                                                                                                                                                                                                                                                                                                                                                        |
| OS-EXT-SRV-ATTR:host                 | 46-40.ibm.com                                                                                                                                                                                                                                                                                                                                                 |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | 46-40.ibm.com                                                                                                                                                                                                                                                                                                                                                 |
| OS-EXT-SRV-ATTR:instance_name        | instance-000000e1                                                                                                                                                                                                                                                                                                                                             |
| OS-EXT-STS:power_state               | 0                                                                                                                                                                                                                                                                                                                                                             |
| OS-EXT-STS:task_state                | spawning                                                                                                                                                                                                                                                                                                                                                      |
| OS-EXT-STS:vm_state                  | error                                                                                                                                                                                                                                                                                                                                                         |
| OS-SRV-USG:launched_at               | -                                                                                                                                                                                                                                                                                                                                                             |
| OS-SRV-USG:terminated_at             | -                                                                                                                                                                                                                                                                                                                                                             |
| accessIPv4                           |                                                                                                                                                                                                                                                                                                                                                               |
| accessIPv6                           |                                                                                                                                                                                                                                                                                                                                                               |
| config_drive                         |                                                                                                                                                                                                                                                                                                                                                               |
| created                              | 2015-09-24T08:11:24Z                                                                                                                                                                                                                                                                                                                                          |
| fault                                | {"message": "Build of instance d0a7b333-6050-41fb-9098-d04d6d053d03 was re-scheduled: Cannot setup network: Cannot find any PID under container \"13723d168e4c7bac1dd626b24b46c88034c4fb4d9c3033d001ebcbf22fec14de\"", "code": 500, "details": "  File \"/usr/lib/python2.7/site-packages/nova/compute/manager.py\", line 2219, in _do_build_and_run_instance |
|                                      |     filter_properties)                                                                                                                                                                                                                                                                                                                                        |
|                                      |   File \"/usr/lib/python2.7/site-packages/nova/compute/manager.py\", line 2362, in _build_and_run_instance                                                                                                                                                                                                                                                    |
|                                      |     instance_uuid=instance.uuid, reason=six.text_type(e))                                                                                                                                                                                                                                                                                                     |
|                                      | ", "created": "2015-09-24T08:11:56Z"}                                                                                                                                                                                                                                                                                                                         |
| flavor                               | m1.small (2)                                                                                                                                                                                                                                                                                                                                                  |
| hostId                               | f24a900199c31bfac40247b5f8e332794a3519eb63df8a747758e5c2                                                                                                                                                                                                                                                                                                      |
| id                                   | d0a7b333-6050-41fb-9098-d04d6d053d03
edit retag flag offensive close merge delete