how to use vsphere CLI to run esxcli to get information for a host with vCenter credential

I want to run a command like "esxcli swiscsi nic list -d vmhba35" to get some iSCSI information. I can run it directly on ESX host. Now there is a ESX host under a vCenter management, I have credential for the vCenter, but not the ESX hots directly.

I installed vsphere CLI on a Linux machine,  I found I can do

esxcli --server=ESXHOST --username=ESXUSER  --password=ESXPASSWORD swiscsi nic list -d vmhba35


But I don't know how to do it with vCenter credential only.






LVL 7
jackiechen858Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
I believe esxcli is not vCenter aware, meaning you must connect to a specific ESX or ESXi host when performing an operation.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
rather than me comment on esxcli, checkout this article by fellow vEXPERT William Lam!

which explains The new remote version of esxcli is compatible with both ESXi 5 and ESX(i) 4.1 hosts.
Article Source
http://www.virtuallyghetto.com/2011/07/major-enhancements-in-esxcli-for.html
0
jackiechen858Author Commented:
this article:

http://www.vmware.com/support/developer/vcli/vcli41/vsp4_41_vcli_relnotes.html


mentioned " You can run most vSphere CLI commands against a vCenter Server system and target any ESX/ESXi system that the vCenter Server system manages. vSphere CLI commands are especially useful for ESXi hosts because ESXi does not include a service console."

Guess I was misled.


0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
It states "You can run most vSphere CLI commands against a vCenter Server......"

 I've never seen esxcli commands used against vCenter, always against a host, and fellow fellow vEXPERT William Lam,, does not mention vCenter in his recent article.

there is lots of confusion, in the industry as to what vSphere is, is it the host or vcenter, or both!
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
okay, this is not obvious, from the documents but vCLI 5.0

try

esxcli --server [vcenter-server] --vihost [esx(i)-host] .....

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jackiechen858Author Commented:
Hmm, I can't even find the vsphere CLI 5.0. Only found a vsphere PowerCLI 5.0 but I think it's different animal ( I used 4.0 version vsphere PowerCli before).


0
jackiechen858Author Commented:
Yeah, seems CLI 5.0 is not out yet. 4.1 CLI doesn't have --vihost for esxcli.

I will just accept your post anyway :-)


0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
these newer features for vCenter are included on 5.0.

download is here

http://www.vmware.com/support/developer/vcli/

(you need to login)

http://www.vmware.com/support/developer/vcli/vcli50/vsp5_50_vcli_relnotes.html
0
jackiechen858Author Commented:
The links you provided are just release note?


I think they changed the name. I downloaded "VMware vSphere 5.0 SDK for Perl" and seems that's the cli. it even uninstalled my previous installed vsphere 4.1 CLI.

I just tried it, quiet a exercise.  After installed vCli 5.0 on a 2003 VM, it put a esxcli.exe there, but when I run it, I got a error "The system cannot execute the specified program."

After spending some time to google and check event log, I found the error in event log is "Dependent Assembly Microsoft.VC90.CRT could not be found and Last Error was The referenced assembly is not installed on your system."

The fix is to download VS2008 runtime from http://code.google.com/p/userinfoex/downloads/detail?name=Microsoft.VC90.CRT.zip&can=2&q=

and put those dlls in the same folder as esxcli.

Very disappointed with Vmware's QA.


Tried to run it, it now support -h ( --vihost ), but doesn't work with my vCenter 4.1 ( this is not a surprise, I knew it probably will not work, just want to give it a try. )


















0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
the first link is the download, you need a valid login, Weve got the tools here!
0
jackiechen858Author Commented:
oh, actually the first link can download the vCli:

VMware vSphere CLI (vCLI) - Windows Installer
Command-line tools (for Windows environments) to manage your vSphere infrastructure.         48M       exe
(md5sum:0cfe27849d6e27553fe745f2074d9072)
(sha1sum:464068effc0f03f16bd804712cb00f86d50b4f58)

It's exactly same as the one I downloaded:

vSphere SDK for Perl - Windows Installer
Download an SDK for Windows environments that allows to create Perl scripts to automate vSphere management.         48M       exe
(md5sum:0cfe27849d6e27553fe745f2074d9072)
(sha1sum:464068effc0f03f16bd804712cb00f86d50b4f58)
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
click the first link, look for the word DOWNLOAD which you have missed, LOGIN accept EULA and download!

I cannot give you exact url because its hashed with our VMware Partner password, we not numpties at this!!!
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
YES very good you can read!
0
jackiechen858Author Commented:
Thanks, I see it now. I already download same installation file from the other "vSphere SDK for Perl" download url.

0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
this version is vCLI 5.0, now it would not surprise me, if this has to match vSphere 5.0 ESXi 5.0 hosts, and vCenter 5.0.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VMware

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.