container can't change hostname

Bug #1493298 reported by lvdongbing
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova-docker
Fix Committed
Undecided
wanghuagong

Bug Description

When I use novadocker as compute driver to boot sahara cluster, it failed as following erros:
2015-09-08 03:00:54.213 18473 DEBUG sahara.context [req-31b31f6b-2d67-4b74-9364-9f47ee4497c2 ] [instance: 3b78a56a-150b-4e42-a62c-e6cdcd5e39b7, cluster: 59609d21-8633-4225-9c85-d4047fb5995c] Thread configure-instance-cluster2-master-0 failed with exception: RemoteCommandException: Error during command execution: "sudo hostname cluster2-master-0.novalocal"
Return code: 1
STDERR:
sudo: unable to resolve host instance-0000001e
hostname: you must be root to change the host name

Error ID: ae1991c2-66e8-4c9f-a0e9-7fbb97b702ed
Error ID: 7c621a1b-ce72-4d06-89a7-178baab40fb9 _wrapper /opt/stack/sahara/sahara/context.py:172
2015-09-08 03:00:54.214 18473 DEBUG sahara.context [req-31b31f6b-2d67-4b74-9364-9f47ee4497c2 ] [instance: none, cluster: 59609d21-8633-4225-9c85-d4047fb5995c] Thread configure-instance-cluster2-worker-0 failed with exception: RemoteCommandException: Error during command execution: "sudo hostname cluster2-worker-0.novalocal"
Return code: 1
STDERR:
sudo: unable to resolve host instance-0000001d
hostname: you must be root to change the host name

I found that it's an issue related to novadocker, container created by novadocker didn't hava privileges to set hostname.
The code Docker client start container as below:
        def start(self, container, binds=None, port_bindings=None, lxc_conf=None,
              publish_all_ports=False, links=None, privileged=False, ...)
The parameter 'privileged' should be 'True', but novadocker didn't pass this para to Docker client when booting container.

wanghuagong (whgfirst)
Changed in nova-docker:
assignee: nobody → wanghuagong (whgfirst)
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Changed in nova-docker:
status: New → Fix Committed
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.