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

Re: Issue with retrieveProperties

$
0
0

I had a similar issue with hosts/vcenter >= 4.1.  I switched from using retrieveproperties to using retrievepropertiesex together with continueretrievepropertiesex and the problem of blank returns went away (though I am fighting another problem but that is a different story).  See if changing your calls helps.

 

--Moby


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

$
0
0

HostConfigInfo.storageDevice is your friend.  Are you familiar with the MOB?

 

Regards,

--Moby

Re: SOAP InvalidPropertyFault on vSphere 5.5

$
0
0

Hello.

 

I have two suggestions for you to try out.

 

First of all "RetrieveProperties()" method is deprecated since vSphere 4.1. You should use "RetrievePropertiesEx()" instead.

 

Second - check what headers are you sending in http request containing soap envelope?

 

One of the headers should be "SOAPAction", containing API namespace and API version like this one: "urn:vim25/5.5".

If this header is missing, then response will contain only data which was present on very early release of vSphere.

 

Regards.

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.

Re: Login to ESX, when you only have VCenter Credentials

$
0
0

To connect ESX directly (Without vCenter), It requires root or root equivalent credential. I believe that there is no other option.

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.

Re: Login to ESX, when you only have VCenter Credentials

$
0
0

No,

You will have to obtain the Root user credentials for the ESXi server. If you have integrated ESXi to your AD, you will be able to login using AD credentials.

Re: Create ESX local user using VCenter credentials

$
0
0

There is no way to do such thing from vCenter Server. However, you can create another local user from vSphere Client which directly connected to the ESXi host.

 

 

Alternatively, you can join The ESXi host into existing Active Directory. Then, import certain user/group and grant permission to this ESXi host only.


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?

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

Re: vSphere (VI) API and PHP

$
0
0

Hi!

 

Did you manage to get it working? I have the same problem as you.

 

Thanks.

Re: A few problems with API

$
0
0

My apologies, with the holidays and vacation I haven't had time to dig into your code.  But if you found a functional wrapper library that should get you past some of the VI SDK SOAP complexities.

 

In terms of which property is causing your invalid property fault, take a look at the vpxd.log file.  It's location will vary depending on what OS you installed vCenter on, but generally if you execute your script then review the current vpxd log file, you'll get a more specific error message that will indicate which property caused the vCenter server to error.

Re: vSphere (VI) API and PHP

$
0
0

You'll need to review the traversal spec and property retrieval methods for the SDK.  You can look through the API Programming Guide.

 

The basic issue with PHP is that there is no official SDK toolkit for it, so you have to do the low level SOAP construction.  For login/logout this is fairly simple (see the above example).  For more complex operations (querying inventory data, performance metrics, etc) you'll have to build nested, complex SOAP objects by hand and deal with some quirks like the ManagedObjectReference slightly non-expected XML attributes (like ServiceInstance in above example).

 

I would encourage you to use an official toolkit vs PHP for this reason (you'll find all utility functions to retrieve objects are pre-built for you).  If it's to be web embedded, Perl has several options and is officially supported.  The non-supported Python bindings were released as well: https://github.com/vmware/pyvmomi

 

There were some PHP kits the community put together, but I can't speak to their current status or how complete they were.  I did explore the PHP process years ago, but ultimately abandoned it.  It was too time consuming.  I was able to make much faster and more robust progress with Perl +  HTML::Mason (which provides PHP like embedded Perl with inheritance). 

 

For example, using the above thread, if you wanted to get all the VMs of a specific datacenter in Perl:

$my_dc_vms = Vim::find_entity_views(view_type => "VirtualMachine", begin_entity => $my_dc);

 

To do the same in the lower level API calls, you'd have to build TraversalSpecs, PropertySpecs, and ObjectSpecs using the SOAP constructions in PHP.  However, if you do build these Specs, you can do very advanced filtering and searching on the SDK inventory efficiently. 

 

But for a simple VM retrieval, learning the complete SDK inventory traversal operation and hand building the SOAP in PHP can be difficult, particularly if you're not already familiar with the VI SDK SOAP model.

Re: Create ESX local user using VCenter credentials

$
0
0

The trick used in the past is through Host Profiles.  You can create a snippet host profile to add a local user account.  Of course, this requires putting the host into maintenance mode, so generally being prepared with AD integrated authentication is best.

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

$
0
0

You mean using the vSphere Web Services SDK, because the Web Client SDK has nothing to do with Guest apis or the UploadGuestFile sample.  I'll move this question to the proper forum for you.


Re: A few problems with API

$
0
0

Hello.

 

The message "Error:SoapFault exception: [ServerFaultCode] Required property type is missing from data object of type PropertySpec while parsing serialized DataObject of type vmodl.query.PropertyCollector.PropertySpec"

means that vSphere Server is expecting to find property "type" in your PropertySpec object. As your code contains this property, then one thing which can be wrong is this property's position. Try to put it before property "all" like here:


$prop_set = array(new SoapVar(array('type' => "Datastore", 'all' => true), SOAP_ENC_OBJECT, "PropertySpec"));


Regards.

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.

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.

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

$
0
0

The only reliable property seems to be “Datastore.capability.nativeSnapshotSupported” which appears to be set to true only if the VAAI plug-in is installed on the respective host and the installed VAAI plug-in supports the respective Datastore Hardware Acceleration.

 

It’s not clear if there are any experts in this forum those have used vSphere API to an extent. Anyways appreciate the forum for help and support.

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

$
0
0

I have attached a perl module that I wrote which rebuilds VimServiceStub.java. It's not pretty but I think it does the job. It extracts over 3800 classes from VimServiceStub into their own files. In addition it completely recodes populateFaults to get around the 65K limit. It reduces VimServiceStub.java from 2.5M lines to about 170K lines. Unfortunately, all I know is that it compiles as I don't know how to test it. Yet...

 

I've also included an ANT file that I use to build everything. It's designed to be run under the Eclipse development tool and I'm running on OSx 10.9. Place these 2 files at the root level of a Java project, put the xsd and wsdl files in a wsdl folder and the jar files in the lib/axis-1.6.2 folder. The jar files are:

XmlSchema-1.4.7.jar

axiom-api-1.2.13.jar

axiom-impl-1.2.13.jar

axis2-adb-1.6.2.jar

axis2-kernel-1.6.2.jar

axis2-transport-http-1.6.2.jar

axis2-transport-local-1.6.2.jar

commons-codec-1.3.jar

commons-httpclient-3.1.jar

commons-logging-1.1.1.jar

httpcore-4.0.jar

mail-1.4.jar

neethi-3.0.2.jar

wsdl4j-1.6.2.jar

 

Some of these are only needed to run a program using the stub code and more may be needed to get full functionality, but they should be available from the axis2 distribution. You'll have to modify the ANT file to fit your needs. I haven't included all the instructions here, but if you're used to  using Eclipse, they should suffice.

 

As an extra aid, I've added the following to my eclipse.ini to give enough storage to Java so some of the compiles will complete:

-Xms5g

-Xmx5g

-XX:PermSize=1g

-Xss1M

Viewing all 2052 articles
Browse latest View live