Ask Your Question
0

Docker nova name = hostname [closed]

asked 2014-01-27 09:01:59 -0500

Nuriel gravatar image

Hi,

It is possible to pass a hostname to Docker upon creation of a container. However, I noticed that when booting a Docker container with openstack, the container gets assigned a hostname in the format "instance-0000002a" and the nova name has nothing to do with it.

Is it possible to implement this into the Docker nova driver so that the nova instance name also becomes the actual hostname on that instance? Having the "instance-000000..." format does not make much sense.

Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by Nuriel
close date 2014-01-29 05:32:37.717391

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-01-29 02:29:49 -0500

Nuriel gravatar image

updated 2014-01-29 02:34:39 -0500

Well, I know this is very unorthodox modification to do, but I really had to have this accomplished.

Added:

instance['name'] = instance['hostname']

just above :

args = {
  'Hostname': instance['name'],
  'Image': image_name,
  'Memory': self._get_memory_limit_bytes(instance)
}

at "def spawn":

/usr/lib/python2.7/dist-packages/nova/virt/docker/driver.py

and restarted nova-compute.

edit flag offensive delete link more

Comments

doesn't work. not with icehouse nor with juno...

Jason90 gravatar imageJason90 ( 2015-02-04 10:00:08 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-01-27 09:01:59 -0500

Seen: 132 times

Last updated: Jan 29 '14