Quantcast
Channel: VMware Communities : Discussion List - vSphere Management SDK
Viewing all 1375 articles
Browse latest View live

How to retrieve all the volumes/luns connected over FibreChannelHba ?

$
0
0

I have storage device connected via FiberChanel.

I want to list all the available luns/Volumes available in it.

how to navigate over fiberchanelHba to get all volumes?


Using c# .net how to update hostsystem configuration detail ?

$
0
0

I am trying to update /change configutaions detaills of host object using c#.net. Can anyone help out for this?

 

Gettting host object by

 

VimClient vimClient = new VimClient();

vimclient.Connect(URL);

List<EntityViewBase> hosts = vimClient.FindEntityViews(typeof(VMware.Vim.HostSystem),null,null,null);

 

 

Thanks.

retrievepropertiesex and continueretrievepropertiesex throw xml exception in .NET

$
0
0

I recently updated some code to use the web sdk for vsphere 5.5.  I also updated the code to use retrievepropertiesex with continuepropertiesex where apiver is > 4.0, and to use just retrieveproperties where apiver < 4.1.  The code is all C# with .NET, built for .NET 3.5.  I used wsdl.exe from MS to generate the proxies and performed the proper edits to generate the xml serializer assemblies etc.

 

Retrieveproperties works (and has always worked) just fine.

 

However, sometimes, retrievepropertiesex and continueretrievepropertiesex (more so for retrievepropertiesex than for continueretrievepropertiesex) throw an exception about an error in the xml document.  I noticed that it usually happens for 4.1 VCs, more so much more often for one particular 4.1 VC though sometimes for other 4.1 VCs as well.  I have not found anything in common with the VCs where the exception is thrown, they are at the same version and patch level as many others that are processed just fine.  Also I get exceptions much more often when I run the code on one machine versus another.

 

Whenever the exception is thrown, the inner exception is always empty (null), thereby leaving me with nothing more than the message about xml error.  Is anyone else seeing anything like this?

 

Regards,

--Moby

Login to ESX, when you only have VCenter Credentials

$
0
0

Hi,

 

I am trying to download a file using the datastore browser. I have credentials to login to VCenter. So I can download the file via the datastore browser using the VCenter URL:

https://vcenter/folder/...

 

However, this is slow when the VCenter managing the ESX is in different location than the ESX on which that file is present. Hence I would like to download the file directly via the datastore browser using ESX URL:

https://esx/folder/...

 

The ESX is part of that VCenter. But since I don't have ESX credentials, I am unable to login to ESX. Is there a way for me to login to ESX using only VCenter credentials?

 

Thank you.

vSphere (4.1) API and PHP

$
0
0

Hi all,

 

I'm tearing my hair out here. I can successfully connect to the API via SOAP using PHP and calling the "ServiceInstance" method, I can get the following:

 

 

stdClass Object
(
    [returnval] => stdClass Object
        (
            [rootFolder] => stdClass Object
                (
                    [_] => ha-folder-root
                    [type] => Folder
                )
            [propertyCollector] => stdClass Object
                (
                    [_] => ha-property-collector
                    [type] => PropertyCollector
                )
            [viewManager] => stdClass Object
                (
                    [_] => ViewManager
                    [type] => ViewManager
                )
            [about] => stdClass Object
                (
                    [name] => VMware ESXi
                    [fullName] => VMware ESXi 4.1.0 build-260247
                    [vendor] => VMware, Inc.
                    [version] => 4.1.0
                    [build] => 260247
                    [localeVersion] => INTL
                    [localeBuild] => 000
                    [osType] => vmnix-x86
                    [productLineId] => embeddedEsx
                    [apiType] => HostAgent
                    [apiVersion] => 4.1
                    [licenseProductName] => VMware ESX Server
                    [licenseProductVersion] => 4.0
                )
            [setting] => stdClass Object
                (
                    [_] => HostAgentSettings
                    [type] => OptionManager
                )
            [userDirectory] => stdClass Object
                (
                    [_] => ha-user-directory
                    [type] => UserDirectory
                )
            [sessionManager] => stdClass Object
                (
                    [_] => ha-sessionmgr
                    [type] => SessionManager
                )
            [authorizationManager] => stdClass Object
                (
                    [_] => ha-authmgr
                    [type] => AuthorizationManager
                )
            [perfManager] => stdClass Object
                (
                    [_] => ha-perfmgr
                    [type] => PerformanceManager
                )
            [eventManager] => stdClass Object
                (
                    [_] => ha-eventmgr
                    [type] => EventManager
                )
            [taskManager] => stdClass
However, I try to invoke a login call, but keep getting the following error message:
Uncaught SoapFault exception: [ServerFaultCode] The session is not authenticated
If I try and change ommit the userName or password nodes, I get the following (expected) error:
SOAP-ERROR: Encoding: object has no 'userName' property
This is my XML:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:vim25">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:Login>
         <urn:_this type="SessionManager">SessionManager</urn:_this>
         <urn:userName>redacted</urn:userName>
         <urn:password>redacted</urn:password>
      </urn:Login>
   </soapenv:Body>
</soapenv:Envelope>
Any pointers greatly appreciated :-)

Create ESX local user using VCenter credentials

$
0
0

Hi,

 

I have an ESX added to a VCenter.

 

Can I create a local user for the ESX using the Vcenter?

 

Thank you.

How to upload a file to guest using C# through vSphere Web Client SDK

$
0
0

i find the sample in java,it's name is UploadGuestFile. But can't find the similar sample in C#. is any sample here for reference?

Need Help on ExtendVirtualDisk_Task on .NET SDK

$
0
0

Hi ,

 

I am developing an app to upgrade the hard disk of a VM.

 

ExtendVirtualDisk_Task seems to be the API to extend the hard disk. However it is throwing the below exceptions when trying to upgrade the hard disk.

 

"The request refers to an unexpected or unknow type"

 

Please help me with the sample code or examples.


vSphere API to check VAAI and VASA provider installed and enabled ?

$
0
0

Hi,

 

I want to know if there is an API available (VMware vSphere Web Services API) that one can use to identify if the

 

1. VAAI plug-in / Hardware Acceleration is "Supported" for specific datastore

DatastoreHardwareAcceleration.png

 

 

AND the

2. VASA plug-in is "Supported"/"Installed" for specific datastore/host

 

If there is no such API available (VMware vSphere Web Services API); then is there any configuration setting for any Managed Object that can be checked for deriving this information

 

Thanks in advance.

"code too large" - Javac complains about VimServiceStub.populateFaults method (generated by Axis2 wsdl2java)

$
0
0

Hi,

 

I am trying to genreate jar file from java classes by compiling the Vsphere wsd, using the Axis2 wsdl2java utility.

 

 

Java complains that the code is tool large for method populateFaults in VimServiceStub

 

 

 

 

vim25\vim25service\VimServiceStub.java:4552: code too large

 

 

 

 

javac     private void populateFaults(){

javac                  ^

 

 

 

 

Looks like there is a 64k limit on the method byte size code in java. This method came upto 4000 lines approximately, and it was trying to build the exception to fault map

 

 

 

 

Did anyone face this issue? I am using javac 1.6.0_14

 

 

 

 

Currently, I split this method manually, into two parts and calling them separately.

 

 

 

 

However, I can't rely on this manual intervention, and I would like to automate the whole process.

 

 

 

 

Let me know if you have any hints/ideas on how to solve this issue

 

 

 

 

Thank you

Help creating a VApp from perl

$
0
0

So I'm trying to use CreateVAPP to create a new barebones Vapp and I'm running into problems.

 

I have this call:  my $vapp = $rp->CreateVApp(name => "Test_for_DR_Script", configSpec => $vAppConfig, resSpec => $resConfig);

 

and the configSpec: my $vAppConfig = VAppConfigSpec->new(annotation => "This is a test VApp", vmFolder => $tmpFolder);

 

and everytime I run it, I get:

Argument vmFolder is not valid at /usr/share/perl5/VMware/VICommon.pm line 2486
    ComplexType::arg_validation('VAppConfigSpec', 'vmFolder', 'ManagedObjectReference=HASH(0x4ac8090)', 'annotation', 'This is a test VApp') called at /usr/share/perl5/VMware/VICommon.pm line 2458
    ComplexType::new('VAppConfigSpec', 'annotation', 'This is a test VApp', 'vmFolder', 'ManagedObjectReference=HASH(0x4ac8090)') called at ./getVAPPInfo.pl line 154

 

I have run thru practically every folder I can find from the ESXi host on up to the top of the tree and all of them give me that error.

 

Can anyone give me some help?  An example creating a VApp would be great, but short of that, explaining what folder I need would help.

 

Also, I am using the SDK for Perl v5.1 connecting to a vSphere Appliance v 5.0U2.

 

Tom

Actual memory and CPU usage of ResourcePool managed object - which one is it

$
0
0

Hi,

 

I'm creating a simple web page with jsp and Web Services SDK for monitoring usage of resouce pools.

I'm getting usage information from ResourcePool MOR using (ResourcePool object).getRuntime().getMemory().getOverallUsage() for memory and (ResourcePool object).getRuntime().getCpu().getOverallUsage() for cpu usage.

But the values returned are not anyhow covered in vSphere Client or vSphere web client. I'm adding consumed and overhead consumed, private and shared from vSphere clients but it does not cover values taken by getOverallUsage. Can you guys tell me what exactly getOverallUsage shows and which value shows real usage? This is quite important thing, because all resource calculations and planning are based on Consumed value from vSphere clients.

To be specific, getOverallUsage returns values higher (depending on resource pool size - I mean number of VMs and child resource pools ) than consumed + overhead consumed but smaller than private + shared.

 

-ald017

Throughput by traffic type on a vSwitch and/or distributed switch

$
0
0

Hello,

 

I am currently working on a piece of software that determines how much of different types of traffic is flowing through switches in my VM environment. I am collecting throughput information based on traffic flow on my pNics (see vSphere 5.5 Documentation Center ). I am using the throughput.usage.trafficType counters (e.g. throughput.usage.ft, etc) to gather this information.

 

Question: What happens if my switch isn't configured to handle a certain traffic type? Say, I don't want any FT traffic flowing through my switch. What will the value of the throughput.usage.ft counter be in that case? Just a zero? Or to be more specific, is there any way to determine, looking just at the counter value for all pNics, whether or not the switch supports a particular traffic type?

 

Thanks!

datastore.siocActiveTimePercentage.average returning odd values

$
0
0

When you look at the datastore.siocActiveTimePercentage.average value through the vSphere Web Client you see either a 0 or a 100 for each datastore connected to a Host. When I query that same counter via the SDK, I get really odd values that don't make sense to me. The values are numbers like 333, 666, 2000, 1333, 2666, etc. Can someone please explain how I am supposed to interpret these values returned from the SDK? How do I convert that into a percentage or does the returned value mean something completely different? Thanks.

VcTag scripting object

$
0
0

I am not sure if I missed the memo or what but it seems that in 5.1 custom fields are now read only and everything needs to be converted to tags.  I am trying to figure out how to programatically interact with the tagging as we use custom fields to sync some information to and fro from our machine database.  I see the property "tags" on most of the managed entities but I don't see where I can manipulate the tags (add/change/delete).  All I can do is get an array of the tags currently associated with the entity.

 

Do I need to tweak something in my vCenter configuration to keep the custom fields in place for now and useable as they were before?  The api docs all say "experimental" on that attribute and the vcTag object type.

 

This is a cross posting from the Orchestrator forums as I use orchestrator/javascript for everyting along with the vCenter plugin.

 

Paul


Using copyVirtualDisk_Task with ESXi 5.5 API

$
0
0

Hi!

 

So far I used the method "copyVirtualDisk_Task" of the API on an ESXi 5.1 server to copy a vmdk file on the datastore - and it worked well.

With an upgrade to version ESXi, 5.5.0, (Build 1331820) it seems that this method is not going to work any more?

 

On the console I get the following (translated from German):

"Copying Virtual Machine

The method is not implemented by the server."

 

And in the following the original message in German:

"Virtuelle Festplatte kopieren

Der angeforderte Vorgang wird vom Server nicht implementiert."

 

Are there any fixes or workarounds?

 

Thanks in advance!

 

Best regards,

alex

How to find disk usage of a thin provisioned virtual disk?

$
0
0

 

Hi

 

 

I have a virtual machine having a thin provisioned virtual disk. The disk's allocated size is 8 GB but used size is around 2 GB.

 

 

I am interested in knowing is there a why of finding out the used size of disk programmatically like we can see in the

 

 

vSphere Client GUI's datastore browser. I have already tried to query the datastore using  the "HostDatastoreBrowser" but

 

 

it also returns the size of disk as 8GB. Any ideas in this direction will be appreciated. Thanks.

 

 

vSphere & SOAP - API from Hell

$
0
0

We are trying to use the vSphere SOAP API to gather some statistics and informations about running systems. During our development we have found so many stupid, useless, and irritating things,

that i thought to collect them here and "warn" other developers. Maybe some other could avoid making the same mistakes we did.

 

Generating Client Library

 

vSphere WSDL files and gSoap

Don't do it. It would work, but you will get trouble to compile it. The resulting files are so huge, we was not able to compile the library in less then 4 hours, without any optimization. And the resulting binary was >50MB.

Compiling with optimization flags? No way, unless you have systems with more den 128GB of RAM

 

axis2c

Not tested, as it first starting to complain about a missing service definition, because there is none in the WSDL file, even if they where fetched from the vSphere Server. After fixing that, the resltung files was even larger then from gSoap, so we deleted it and decided to not use any automatic generator for the C library.

 

Documentation Issues

The documentation is a mess. Exactly as the API definitions as a whole. So they match together, but readable is something else.

And there are some very confusing parts in the docs. For example:

The ServiceContent has an optional member: sessionManager. To retrieve these member, if it is not delivered by the api (as it is optional), we have to use the PropertyCollector. To create the matching filter we need the permission System.View -  but wait! How should we get a session with the according permission if we could not get the sessionManager  (to understand recursion you have to understand recursion first)? So we assume that the sessionManager is NOT optional.

 

So, if you have found the information you are looking for, and thought you understand what the author wanted to say: Think twice about it, sleep a night, think again and try to put some more logic in it. Don't trust the docs!

 

Broken API Design

If you use the API, you should always remember: It is broken by Design.

 

It starts with the request headers you have to use. ALL operations have the SOAP-Action  "urn:vim25/5.1" according to the vim.wsdl. Some operations need it, for other the header is ignored. I think somebody should explain the developers of the API what the header is really for: Maybe O'Reilly Unraveling the Mystery of SOAPAction - O'Reilly XML Blog ?

 

Also, all operations a tied to a specific type of Managed Object. In the documentation only of course! All defined operations requires the base type, Managed Object, to be set. There are no derived objects for the real types! That makes it very hard to understand the WSDL without the external documentation. Also, you may miss some errors in your code, if you assign the wrong object as _this to a operation.

 

TL;DR

The API is a piece of crap. Don't use it unless you really have to.

Directory copy using InitiateFileTransferToGuest ??

$
0
0

Hello experts,

 

I do have the question related to the FileOperation using the vSphere API.

 

Q: How can we use the InitiateFileTransferToGuest() to upload the directory  ?

- Do we have to browse through the directory and get the list of the files. Then recursively call the  InitiateFileTransferToGuest() and http function to upload each individual files ??/???

Is there any better way of doing it ? or API available ?

- How to handle the symbolic link files  ?

 

Appreciate your help.

 

Thanks.

- Bala

Making Desktop Pool

$
0
0

hi, Everyone.

 

I want to make VMware Desktop Pool with making VM.
And I Know There are exist VMware Horizon view Administrator web Page. but There are may step for making the Pool.
So, I want to make a web page like VMware Horizon view Administrator.(using Java)
That page are many defalt value for making VMware Desktop Pool.
How can I make that Page? Using SDK or PowerCli?
Is there exsiting SDK or API for Horizon view Administrator?(I think SDK is for VMware Horizon view Client)

 

Thank you.

Viewing all 1375 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>