[R2.20-Build 17]: nova --user-data option is not working for docker container creation
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Juniper Openstack | Status tracked in Trunk | |||||
R2.20 |
Invalid
|
Medium
|
Ignatious Johnson Christopher | |||
Trunk |
Invalid
|
Medium
|
Ignatious Johnson Christopher |
Bug Description
while creating nova instances, user-data script is not getting executed in case of docker containers.
root@nodeg18:~# cat script.sh
#!/bin/sh
echo "hello" > /tmp/output.txt
root@nodeg18:~# nova boot --flavor 2 --image e25699d4-
root@nodeg18:~# nova list
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| 834753ab-
| c77a4c84-
| de43e336-
| 9f4a4f55-
| 4f6de287-
| 8a4e6c1e-
+------
root@nodec62:
root@nodec62:
information type: | Proprietary → Public |
tags: | added: releasenote |
tags: | added: blocker |
I tried it test with cloud image in contrail mainline build 2712, It worked as expected, Possibly you were not using a cloud docker image, for the meta data services to be operational , we need cloud image( image with cloud-init package installed).
root@a5s194:~# contrail-version ------- ------- ------- ------- --- ------- ------- ------- ------- -- ------- ------- ------- ------- ------ config- openstack 3.0-2712 2712 fabric- utils 3.0-2712 2712 install- packages 3.0-2712~kilo 2712
Package Version Build-ID | Repo | Package Name
-------
contrail-analytics 3.0-2712 2712
contrail-config 3.0-2712 2712
contrail-
contrail-control 3.0-2712 2712
contrail-dns 3.0-2712 2712
contrail-docs 3.0-2712 2712
contrail-f5 3.0-2712 2712
contrail-
contrail-heat 3.0-2712 2712
contrail-
root@a5s194:~# pwd
/root
root@a5s194:~# cat script.sh
#!/bin/sh
echo "hello" > /tmp/output.txt
root@a5s194:~#
root@a5s194: /opt/contrail/ utils# docker pull cirros /opt/contrail/ utils# /opt/contrail/ utils# docker save cirros | glance image-create cirros --public --container-format docker --disk-format raw ------- -----+- ------- ------- ------- ------- ------- --+ ------- -----+- ------- ------- ------- ------- ------- --+ b76323cafa3af96 09 | 11T20:14: 57.322982 | 8958-4951- a3cb-053b48c5da 61 | 597f7c2bd8cb92f 90 | 11T20:14: 57.650256 |
Pulling repository cirros
64a920f75037: Download complete
c74e3fca9821: Download complete
e1ceeb0716f6: Download complete
cb5c6009bac1: Download complete
7725b0aea0a1: Download complete
Status: Downloaded newer image for cirros:latest ^C
raw@a5s194:
root@a5s194:
--name cirros
+------
| Property | Value |
+------
| checksum | 7985e2c80e85671
| container_format | docker |
| created_at | 2016-02-
| deleted | False |
| deleted_at | None |
| disk_format | raw |
| id | 1fdd738a-
| is_public | True |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros |
| owner | 72b4127e873f4df
| protected | False |
| size | 8131584 |
| status | active |
| updated_at | 2016-02-
| virtual_si...