Docker InfraKit with HPE OneView demo container - HewlettPackard/infrakit-instance-oneview GitHub Wiki

Docker InfraKit with HPE OneView demo container

To simplify the use of the Docker InfraKit plugin, i've placed it all into a docker container that will allow people to use it immediately.

NOTE: this is only for demonstration purposes, also the process will be automated eventually so don't get too used to this container being around :-)

Usage

Grab the plugin container

$ docker pull thebsdbox/infrakit_oneview:0.1

Inside the container are four binaries that will be ran individually:

  • infrakit
  • infrakit-group-default
  • infrakit-flavor-vanilla
  • infrakit-instance-oneview

Note: due to a dependancy on libc and libcurl any time you run this container the following volume mapping will be needed -v /lib64:/lib64:ro This simply passes the host OS libraries read-only into the container when it runs (also keeps the container small as we don't need them when the image is built)

Running the Docker InfraKit plugins

Note: Docker InfraKit makes use of UNIX Sockets that live on the filesystem, as each of these containers are running seperately we need to ensure that the socket directory is shared between them all. To fix this create a hidden infrakit directory in your home directory with the command mkdir ~/.infrakit and then we will map this inside the container with /home/user/.infrakit => /.infrakit with the -v flag. In the example i'm using my homedir.

You will want a few (4) terminal windows/tabs open for this :-)

Starting the Group plugin

$ docker run -v /lib64:lib64:ro -v /home/dan/.infakit:/.infrakit -it --rm /infrakit-group-default

Starting the flavor plugin

$ docker run -v /lib64:lib64:ro -v /home/dan/.infakit:/.infrakit -it --rm /infrakit-flavor-vanilla

Running the HPE OneView Plugin for InfraKit

This is a little bit more complicated as we also need to start the container with environment variables for the various OneView authentication credentials. So -e "OV_ADDRESS:192.168.0.1" -e "OV_USERNAME:admin" -e "OV_PASSWORD:password" however adjust as needed.

$ docker run -v /lib64:lib64:ro -e "OV_ADDRESS:192.168.0.1" -e "OV_USERNAME:admin" -e "OV_PASSWORD:password" -v /home/dan/.infakit:/.infrakit -it --rm /infrakit-instance-oneview

These credentials can also be passed through the JSON configuration detailed in the main README.md however it's a depricated idea and is insecure.

Passing in the configuration

Ensure that the plugins are all up and running:

$ docker run -v /lib64:lib64:ro -v /home/dan/.infakit:/.infrakit -it --rm /infrakit plugin ls

We will then need to pass in our json configuration so that the infrakit CLI can use it we will map /home/dan/Docker_swarm.json => /Docker_swarm.json inside the container and then ask the infrakit CLI to commit it.

$ docker run -v /lib64:lib64:ro -v /home/dan/Docker_swarm.json:/Docker_swarm.json -v /home/dan/.infakit:/.infrakit -it --rm /infrakit group commit Docker_swarm.json

et voila !