Two issues with the indigodatacloud/im Docker image
alahiff opened this issue · comments
Following the documentation and launching IM in a Docker container like this:
docker run -d -p 8899:8899 -p 8800:8800 --name im indigodatacloud/im
I find that it doesn't work with OCCI endpoints (e.g. EGI FedCloud sites):
$ im_client.py create onevm.radl
Connected with: http://localhost:8899
ERROR creating the infrastructure: Cloud provider not supported: OCCI (error: No module named xmltodict)
This error is coming from the IM server, i.e. in /var/log/im/im.log in the container is this error:
Exception: Cloud provider not supported: OCCI (error: No module named xmltodict)
This can be resolved by running the following in the container:
apt-get update
apt-get -f install -y
apt-get install -y python-xmltodict
It then becomes possible to successfully create a VM, i.e.
$ im_client.py create onevm.radl
Connected with: http://localhost:8899
Infrastructure successfully created with ID: 1bdd21be-01b4-11e8-9093-0242ac110002
so it seems like python-xmltodict is missing from the Docker image.
However, while it's possible to successfully ssh into the VM using im_client.py sshvm
, ansible fails to configure the machine: in /var/log/im/im.log I see:
fatal: [a.b.c.d]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Host key verification failed.\r\n", "unreachable": true}
I noticed that there is an ansible.cfg (https://github.com/indigo-dc/im/blob/master/docker/ansible.cfg) but this is not referred to at all in the Dockerfile (https://github.com/indigo-dc/im/blob/master/docker/Dockerfile). If I launch an IM container where the image contains this version of ansible.cfg rather than the default, I can then create VMs and IM is able to successfully configure them using ansible. This suggests there should be a line:
COPY ansible.cfg /etc/ansible/ansible.cfg
in the Dockerfile (like in https://github.com/grycap/im/blob/master/docker/Dockerfile).
Hi @alahiff,
You are right these values are correct in the Upstream version but not in the INDIGO fork.
I will fix it.