Zun

Launch a container in zun

Bug #1782400 reported by Changwan Yu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zun
Invalid
Undecided
Unassigned

Bug Description

This bug tracker is for errors with the documentation, use the following as a template and remove or add fields as you see fit. Convert [ ] into [x] to check boxes:

- [x] This doc is inaccurate in this way: ______
- [ ] This is a doc addition request.
- [ ] I have a fix to the document that I can paste below including example: input and output.

@@ interactive option error

i installed openstack queen manually
and installed zun also manually.

almost all 'openstack appcontainer' commands work very well.
but commands with --interactive option don't work.

I had 2 experience.

1. I made container2 , cirros with ping 8.8.8.8 command. like this page.

@controller:~$ openstack appcontainer exec --interactive container2 /bin/sh
HTTPConnectionPool(host='10.0.2.15', port=2375): Max retries exceeded with url: /v1.35/exec/f81e1e0f326cfceb3e8861cffcc530477906d3cd209b0e9d54b5c3cd6f5d7610/start (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f61ad056b90>: Failed to establish a new connection: [Errno 111] Connection refused',))

2. container3 is cirros with bin/sh command.

@controller:~$ openstack appcontainer attach container3
connected to container3, press Enter to continue
type ~. to disconnect
Remote host closed connection:Connection is already closed.:container3
****above case, I didn't anything.

@controller:~$ openstack appcontainer attach container3
connected to container3, press Enter to continue
type ~. to disconnect
Failed to connect to remote host:[Errno 104] Connection reset by peer:container3
******** this case I pressed Enter.
-----------------------------------
ip 10.0.2.15 is just NAT adapter for internet access.(i made controller node by virtual box)
controller node's host ip is 11.0.0.11 and compute node's host ip is 11.0.0.31.
default gateway is 10.0.2.2

are there some codes using network interface?
container networking is fine. ping is work everywhere.
docker commands on compute node are fine.

just exec command is fine.
 ex)
exec container3 echo "hello",
exec container3 /bin/sh is working (without --interactive) then just exit. no error.

but "exec --interactive" don't work.
attach container with /bin/sh don't work.

I guess, if command needs keyboard input -> error
or I missed some configuration.

so, What should I do ?

I want to provide log file.
but I can't find zun log file. where is log file? usually is in /var/log/

-----------------------------------
Release: on 2018-07-17 03:33
SHA: 18bde1df69c820ca2aef8cec95d1db2ef17cb6a0
Source: https://git.openstack.org/cgit/openstack/zun/tree/doc/source/install/launch-container.rst
URL: https://docs.openstack.org/zun/queens/install/launch-container.html

Revision history for this message
hongbin (hongbin034) wrote :

For #1, Could you try this. In your compute node, edit the Zun config file (/etc/zun/zun.conf) as following:

  ...
  [docker]
  docker_remote_api_host = <YOUR_IP_ADDRESS>
  ...

Then, restart the zun-compute process.

Note: this IP address will be used by the exec command to access the Docker daemon, so make sure it is accessible from the the host you run the command.

For #2, could I know how you create the 'container3'. Below is the steps that worked for me:

  $ openstack appcontainer create --interactive --name container3 --net network=$NET_ID cirros /bin/sh
  $ openstack appcontainer start container3
  $ openstack appcontainer attach container3

Revision history for this message
hongbin (hongbin034) wrote :

About the log, since we are using systemd, the log needs to be retrieved by using journalctl. For example:

  # journalctl -u zun-compute > zun-compute.log
  # journalctl -u zun-api > zun-api.log
  # journalctl -u zun-wsproxy > zun-wsproxy.log

Or you can follow the logs in real time:

  # journalctl -f -u zun-*

Note: if you want debug information in the log, you can set debug=True in your Zun config file.

Another trick for debugging is to add the '--debug' flag in the command you run. For example:

  $ openstack --debug appcontainer exec --interactive container2 /bin/sh

Revision history for this message
Changwan Yu (yudaegam) wrote :

Oh, thank you. I tried your comment#1
and solved error completely.
Your answer is very helpful for me.

Revision history for this message
hongbin (hongbin034) wrote :

It seems the problem is resolved so I closed this bug. Feel free to let me know if this is not the case.

Changed in zun:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.