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 is a linux software; for this reason the porting to container was not much difficult: let’s see my Dockerfile
MAINTAINER Lino "Jan" Telera <firstname.lastname@example.org>
ADD <a href="https://github.com/emc-openstack/naviseccli/raw/master/navicli-linux-64-x86-en-us_18.104.22.168.51-1_all.deb">https://github.com/emc-openstack/naviseccli/raw/master/navicli-linux-64-x86-en-us_22.214.171.124.51-1_all.deb</a> /tmp/naviseccli.deb
RUN dpkg -i /tmp/naviseccli.deb
env PATH /opt/Navisphere/bin/:$PATH
Simply lanuch the container with this command:
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
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:
docker run --rm -i -v /c///<dir>//<owercli_script_dir>:/script vmware/powerclicore powershell "& '/script/sample-script.ps1'"
And here my result: