Reply

Docker IPAM Driver

[ Edited ]
pmleano
Techie
Posts: 2
2578     0

Hi,

 

Im trying to use Infoblox and ipam driver to manage containers' ip addresses but unable to create the docker network.

 

Docker Versions: 1.12.5 and 17.09.0-ce

docker infoblox image: docker.io/infoblox/ipam-driver:latest

 

I need some clarifications on the following options:

 

1. Whats the difference of --global-network-container with --local-network-container ?

2.  Do values given to above must be an existing IPAM network in Infoblox?

3. Why in some examples seen do the local|global--prefix-length differ from the local|global-network-container

 ie.

--local-network-container="192.168.0.0/20,192.169.0.0/22" --local-prefix-length=25 --global-view=global_view

--global-network-container="172.18.0.0/16" --global-prefix-length=24

 

Steps done so far:

 

1. Run ipam-driver container

 sudo docker run -e DOCKER_API_VERSION=1.22 -v /var/run:/var/run -v /run/docker:/run/docker infoblox/ipam-driver --plugin-dir /run/docker/plugins --driver-name infoblox --grid-host infoblox01.dev --wapi-username admin --wapi-password infoblox --global-view docker-global --global-network-container 172.22.192.0/18 --global-prefix-length 25 --local-view docker-local --local-network-container 10.54.6.0/23 --local-prefix-length 23

 

ipam-driver container Logs:

2017/10/02 06:18:17 Deleted Old Socket File: '/run/docker/plugins/infoblox.sock'
2017/10/02 06:18:17 Driver Name: 'infoblox'
2017/10/02 06:18:17 Socket File: '/run/docker/plugins/infoblox.sock'
2017/10/02 06:18:17 Docker id is 'B7TP:ADOT:KTAN:7G2GSmiley SurprisedSDN:BFW4:ZHZ5:6KJ7:65G5:BWCJ:AUENSmiley Very HappyJ5G'

 

2. Create docker network using infoblox driver

 

command: sudo docker network create --ipam-driver infoblox test

 

output: Error response from daemon: Post http://%2Frun%2Fdocker%2Fplugins%2Finfoblox.sock/IpamDriver.RequestPool: http: ContentLength=116 with Body length 0

 

ipam-driver container Logs:

2017/10/02 06:21:07 'RequestPool' request: '&{networkview/ZG5zLm5ldHdvcmtfdmlldyQw:default/true map[] %!s(bool=false)}'
2017/10/02 06:21:07 RequestPoolRequest is '&{networkview/ZG5zLm5ldHdvcmtfdmlldyQw:default/true map[] false}'
2017/10/02 06:21:07 http: panic serving @: runtime error: invalid memory address or nil pointer dereference
goroutine 13 [running]:
net/http.(*conn).serve.func1(0xc42021b200)
/usr/local/go/src/net/http/server.go:1491 +0x12a
panic(0x6bbec0, 0xc420014040)
/usr/local/go/src/runtime/panic.go:458 +0x243
main.(*InfobloxDriver).allocateNetworkHelper(0xc4202ba9a0, 0x0, 0x0, 0x0, 0x0, 0xc420221600, 0x2, 0x2)
/home/vagrant/gospace/src/github.com/infobloxopen/docker-infoblox/infoblox-ipam.go:172 +0x48
main.(*InfobloxDriver).allocateNetwork(0xc4202ba9a0, 0xc4202f65a5, 0x7, 0x0, 0x0, 0x0, 0xc420010320, 0xc42007d1e0, 0x0)
/home/vagrant/gospace/src/github.com/infobloxopen/docker-infoblox/infoblox-ipam.go:198 +0x9a
main.(*InfobloxDriver).RequestPool(0xc4202ba9a0, 0x696b00, 0xc4202f6540, 0x0, 0x0, 0x66)
/home/vagrant/gospace/src/github.com/infobloxopen/docker-infoblox/infoblox-ipam.go:243 +0x46b
main.(*InfobloxDriver).RequestPool-fm(0x696b00, 0xc4202f6540, 0xc420045bb0, 0x2, 0x2)
/home/vagrant/gospace/src/github.com/infobloxopen/docker-infoblox/ipam-driver.go:176 +0x3e
main.main.func1(0x850300, 0xc420316000, 0xc4200c4ff0)
/home/vagrant/gospace/src/github.com/infobloxopen/docker-infoblox/ipam-driver.go:210 +0x272
net/http.HandlerFunc.ServeHTTP(0xc4202b4d40, 0x850300, 0xc420316000, 0xc4200c4ff0)
/usr/local/go/src/net/http/server.go:1726 +0x44
net/http.(*ServeMux).ServeHTTP(0x86bc60, 0x850300, 0xc420316000, 0xc4200c4ff0)
/usr/local/go/src/net/http/server.go:2022 +0x7f
net/http.serverHandler.ServeHTTP(0xc4202e6180, 0x850300, 0xc420316000, 0xc4200c4ff0)
/usr/local/go/src/net/http/server.go:2202 +0x7d
net/http.(*conn).serve(0xc42021b200, 0x850900, 0xc4202f6400)
/usr/local/go/src/net/http/server.go:1579 +0x4b7
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2293 +0x44d

 

3. Create docker network using infoblox driver with subnet (same with the one used for --local-network-containe)

 

command: sudo docker network create --ipam-driver infoblox --subnet 10.54.6.0/23 test 

 

output: Error response from daemon: remote: Network (10.54.6.0/23) already in use

 

4. Create docker network using infoblox driver with different subnet

 

command: sudo docker network create --ipam-driver infoblox --subnet 10.54.6.0/24 test

 

output: 

Error response from daemon: failed to allocate gateway (): Post http://%2Frun%2Fdocker%2Fplugins%2Finfoblox.sock/IpamDriver.RequestAddress: http: ContentLength=89 with Body length 0

 

5. Create docker network using infoblox driver with different subnet and specifying gateway

 

command: sudo docker network create --ipam-driver infoblox --subnet 10.54.6.0/24 --gateway 10.54.6.254 test

output:

Error response from daemon: failed to allocate gateway (10.54.6.254): Post http://%2Frun%2Fdocker%2Fplugins%2Finfoblox.sock/IpamDriver.RequestAddress: http: ContentLength=100 with Body length 0

 

thank you,

 

paolo

Re: Docker IPAM Driver

Adviser
Posts: 353
2579     0

In Docker, there is a concept of "local" network drivers and "global" network drivers. The different local/global containers apply to those different types of network drivers. See this blog for more details.

 

The values used for these parameters are "network containers" in Infoblox parlance, or you might think of them as summary routes or just large CIDRs that will contain all your various Docker networks. I don't think it needs to be pre-created in Infoblox.

 

The default prefix length descibes the size of the network to create, if you don't specify it in the specific create network call. So, it really needs to represent a smaller network than the network container. For example, you may give a /20 to your Docker infrastructure. Each network then may be a /25.

Re: Docker IPAM Driver

Adviser
Posts: 353
2579     0

All of that said - you should never get a crash, so you should open a support case.

Re: Docker IPAM Driver

pmleano
Techie
Posts: 2
2579     0

Thanks for the info 

Showing results for 
Search instead for 
Do you mean 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin