VMware Cloud Community
ArrowSIVAC
Enthusiast
Enthusiast

Linux - vSphere 6 POWER CLI

I am trying to construct a deployment set of scripts.  The environment is bringing in OEM systems pre-loaded with base vSphere but need script to automate a bunch of steps for vSwitch creation, MTU etc....

As such I built a deployment system for these steps using "VMWare POWERCLI"

I built this initially on Windows, but want to deploy this en-mass, so want to wrap this up as a "deployment system" for sites and to avoid License issues, want to convert it to work on CentOS.

So I figured it would be easy,  develop on Windows then move scripts over to CentOS, launch power shell from within bash...   call on pre-built VMWare POWERCLI scripts....

HMmm.

Linux

Step 1: Download and Install

From Linux system (Example CentOS 6) install package

[root@vsmgr00 ~]# cp /media/labfiles/Software/vmware/6/VMware-PowerCLI-6.3.0-3639347.oss.tgz /tmp/

[root@vsmgr00 ~]# cd /tmp/

[root@vsmgr00 tmp]# tar -zxvf VMware-PowerCLI-6.3.0-3639347.oss.tgz

[root@vsmgr00 tmp]# cd vmware-vsphere-cli-distrib

[root@vsmgr00 vmware-vsphere-cli-distrib]# ls

apps  bin doc  etc  FILES lib  Makefile.PL  man resources  vmware-install.pl

[root@ibmvsmgr00 vmware-vsphere-cli-distrib]# ./vmware-install.pl

Installing vSphere CLI 6.0.0 build-2503617 for Linux.

You must read and accept the vSphere CLI End User License Agreement to

  1. continue.

Press enter to display it.

terms will continue to be valid and enforceable to the fullest extent

permitted

by law.

Do you accept? (yes/no)  yes

Thank you.

This vSphere CLI installer includes precompiled Perl modules for RHEL.

Answering yes will install the precompiled modules, and answering no will

install from CPAN.

Do you want to install precompiled Perl modules for RHEL?

[yes]

In which directory do you want to install the executable files?

[/usr/bin]

Please wait while copying vSphere CLI files...

The installation of vSphere CLI 6.0.0 build-2503617 for Linux completed

  1. You can decide to remove this software from your system at any

time by invoking the following command:

"/usr/bin/vmware-uninstall-vSphere-CLI.pl".

This installer has successfully installed both vSphere CLI and the vSphere SDK for Perl.

The following Perl modules were found on the system but may be too old to work with vSphere CLI:

MIME::Base64 3.14 or newer

version 0.78 or newer

Enjoy,

--the VMware team

[root@vsmgr00 vmware-vsphere-cli-distrib]#

Launch PowerCLI shell

[root@ibmvsmgr00 tmp]# cd /usr/bin/

[root@ibmvsmgr00 bin]# ls -alh vmw*

-r-xr-xr-x. 1 root root  59K Jul  5 14:25 vmware-cmd

-rwxr-xr-x. 1 root root 404K Feb 26 11:22 vmware-config-tools.pl

lrwxrwxrwx. 1 root root   37 May 27 08:29 vmware-guestproxycerttool -> /usr/lib/vmware-tools/bin64/appLoader

lrwxrwxrwx. 1 root root   37 May 27 08:29 vmware-hgfsclient -> /usr/lib/vmware-tools/bin64/appLoader

lrwxrwxrwx. 1 root root   37 May 27 08:29 vmware-toolbox-cmd -> /usr/lib/vmware-tools/bin64/appLoader

-rwxr-xr-x. 1 root root 195K Feb 26 11:22 vmware-uninstall-tools.pl

-r-xr-xr-x. 1 root root 125K Jul  5 14:25 vmware-uninstall-vSphere-CLI.pl

lrwxrwxrwx. 1 root root   52 May 27 08:29 vmware-user -> /usr/lib/vmware-tools/bin64/vmware-user-suid-wrapper

lrwxrwxrwx. 1 root root   48 May 27 08:29 vmware-xdg-detect-de -> /usr/lib/vmware-tools/bin32/vmware-xdg-detect-de

lrwxrwxrwx. 1 root root   43 May 27 08:29 vmware-xferlogs -> /usr/lib/vmware-tools/bin64/vmware-xferlogs

[root@ibmvsmgr00 bin]# ./vmware-cmd

Can't locate Compress/Raw/Zlib.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/lib64/perl5/Archive/Zip.pm line 11.

BEGIN failed--compilation aborted at /usr/lib64/perl5/Archive/Zip.pm line 11.

Compilation failed in require at /usr/share/perl5/VMware/VIExt.pm line 11.

BEGIN failed--compilation aborted at /usr/share/perl5/VMware/VIExt.pm line 11.

Compilation failed in require at ./vmware-cmd line 10.

BEGIN failed--compilation aborted at ./vmware-cmd line 10.

[root@ibmvsmgr00 bin]#  hmmm....

[root@ibmvsmgr00 bin]# ./vmware-toolbox-cmd

./vmware-toolbox-cmd: Missing command

Try './vmware-toolbox-cmd help' for more information.

[root@ibmvsmgr00 bin]#


Within Windows you just launch it and it works

Windows

Launch CLI Power Shell

WindowsVMWarePOWERCLI.png

Connect to vCenter. Example:  vcenter.acme.com

"Connect-CIServer vcenter.acme.com"

Connect—CISeruer ucenter.acme.com Specify Credential Please specify vcenter.acme.com credenbal Password: " height="474" width="705">

Question:

1) What is the proper way to get Linux PowerCLI shell to launch?

2) Is the failure I am seeing due to CentOS Perl library, if so, why did it not check during install, and what is expected version?

Tags (2)
3 Replies
LucD
Leadership
Leadership

I'm afraid you are mixing two different CLI here.

PowerCLI, which is an add-on for PowerShell can be used on Windows platforms.

The CLI you see to have installed on the Linux box, is a Perl based CLI.

And you can't use scripts from PowerCLI in a Perl shell I'm afraid.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ArrowSIVAC
Enthusiast
Enthusiast

Soooo..

https://my.vmware.com/group/vmware/details?downloadGroup=VCLI600&productId=491&download=true&fileId=...

Download location for single set of tools called "POWER CLI"

One a .exe  (windows).   One a tarball for 32bit.  One a tarball for 64bit.

But not the same tool set?

Not able to use scripts written in common on one and used on another platform?

Are we sure on that statement?  Because it does not make sense to me.

0 Kudos
LucD
Leadership
Leadership

Not sure where you see the word "Power" on that page.

And yes, the vSphere CLI (no Power) is available for Windows and Linux.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference