A “container” way to execute powercli and naviseccli
This post is just a littel review of two docker images that could aid developer and sysadmin to execute scripted task. From sysadmin perspective it doesn’t change a lot from using client installed version of powercli and navicli, but IMHO it could be more confortable in some off-premise scenarios.
Naviseccli
Naviseccli is a linux software; for this reason the porting to container was not much difficult: let’s see my Dockerfile
1 2 3 4 5 6 7 8 9 10 |
FROM ubuntu:latest MAINTAINER Lino "Jan" Telera <linotelera@gmail.com> ADD <a href="https://github.com/emc-openstack/naviseccli/raw/master/navicli-linux-64-x86-en-us_7.33.2.0.51-1_all.deb">https://github.com/emc-openstack/naviseccli/raw/master/navicli-linux-64-x86-en-us_7.33.2.0.51-1_all.deb</a> /tmp/naviseccli.deb RUN dpkg -i /tmp/naviseccli.deb env PATH /opt/Navisphere/bin/:$PATH WORKDIR /opt/Navisphere/bin/ |
Simply lanuch the container with this command:
1 |
docker run --rm -i naviseccli -Scope 0 –Address <spa/b ip address> –User <user> –Password <password> getagent |
and here’s the result
Enjoy and let me know issues and improvements
Powercli
Thanks to William Lam (@lamw) for the porting, there is a vmware official image here: https://hub.docker.com/r/vmware/powerclicore/
In my test I was able to show my vDC hosts including my script in the container execution:
1 |
docker run --rm -i -v /c///<dir>//<owercli_script_dir>:/script vmware/powerclicore powershell "& '/script/sample-script.ps1'" |
And here my result:
Enjoy!