Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all 1860 articles
Browse latest View live

VMWare vSphere SDK - Fail to run SDK Samples due to System.Web.Services.Protocols.SoapException: Unsupported nested context

$
0
0

Hi All,

 

I've downloaded vSphere Management SDK for vSphere 5.5.

I am using VS 2008 for this test.

I'm using the C# dotnet samples.

We have two ESXi 5.5 hosts that are in one cluster.

I've created the the following files using WSDL tools according to the instructions:

1. Vim25Service2008.dll

2. Vim25Service2008.XmlSerializers.dll

3. STSService.dll

 

I've changed the references in order to make the build pass.

After that I tried to run the Simple Client example.

I get the following error:


[ 23/06/16 10:23:37 AM ] Begin Log.

Started

System.Web.Services.Protocols.SoapException: Unsupported nested context '{http://schemas.xmlsoap.org/ws/2004/08/addressi

ng}Address'

   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response,

Stream responseStream, Boolean asyncCall)

   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

   at STSService.Issue(RequestSecurityTokenType RequestSecurityToken)

   at AcquireBearerTokenByUserCredentialSample.AcquireBearerTokenByUserCredential.GetToken(String[] args) in C:\Work\VMW

are\SDK\vsphere-ws\dotnet\cs\samples\AcquireBearerTokenByUserCredentialSample\AcquireBearerTokenByUserCredential.cs:line

151

Caught Exception :  Name : SoapException Message : Unsupported nested context '{http://schemas.xmlsoap.org/ws/2004/08/adhttp://schemas.xmlsoap.org/ws/2004/08/adhttp://schemas.xmlsoap.org/ws/2004/08/ad

dressing}Address' Trace :    at AcquireBearerTokenByUserCredentialSample.AcquireBearerTokenByUserCredential.GetToken(Str

ing[] args) in C:\Work\VMWare\SDK\vsphere-ws\dotnet\cs\samples\AcquireBearerTokenByUserCredentialSample\AcquireBearerTok

enByUserCredential.cs:line 160

   at AppUtil.ServiceUtil.ClientConnectSSO() in C:\Work\VMWare\SDK\vsphere-ws\dotnet\cs\samples\AppUtil\ServiceUtil.cs:l

ine 60

Exception running : SimpleClient

Caught Exception :  Name : SoapException Message : Unsupported nested context '{http://schemas.xmlsoap.org/ws/2004/08/ad

dressing}Address' Trace :    at AppUtil.ServiceUtil.ClientConnectSSO() in C:\Work\VMWare\SDK\vsphere-ws\dotnet\cs\sample

s\AppUtil\ServiceUtil.cs:line 81

   at AppUtil.ServiceUtil.ClientConnect() in C:\Work\VMWare\SDK\vsphere-ws\dotnet\cs\samples\AppUtil\ServiceUtil.cs:line

41

   at AppUtil.AppUtil.connect() in C:\Work\VMWare\SDK\vsphere-ws\dotnet\cs\samples\AppUtil\AppUtil.cs:line 656

[ 23/06/16 10:23:40 AM ] End Log.

 

 

Caught SoapException -  Actor :  Code : ServerFaultCode Detail XML : <detail><RuntimeFaultFault xsi:type="vim25:InvalidR

equest" xmlns="urn:vim25" xmlns:vim25="urn:vim25" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /></detail>

 

These are the command line arguments I pass to the application:

--url https://10.161.47.213/sdk --username administrator@vsphere.local --password  ****** --ssoUrl https://10.161.47.213:7444/sso-adminserver/sdk/vsphere.local

 

I'm not sure about the url and the ssoUrl.

However the 10.161.47.213 is the ip address of the vCenter.

 

Any help will be appreciated.

Thanks,

Dudi.


Copying a large file to the guest causes the virtual machine to hang and eventually crash with error "CoreDump error line 2160, error Cannot allocate memory" as described in KB2137310

$
0
0

VMware vCenter Server 6.0U2+ (6.0.0.3634794)

VMware ESXi Server 6.0U2+ (6.0.0.3825889)

Guest OS: Windows Server 2012 R2

VMware Tools: 10.0.6.3560309

 

Trying to copy a large file to the guest causes the virtual machine to hang and eventually crash with error "CoreDump error line 2160, error Cannot allocate memory" as described in KB2137310

 

The file I'm trying to copy to the guest is Windows8.1-KB2919355-x64.msu (690.8 MB) which can be downloaded here:

Download Windows 8.1 Update for x64-based Systems (KB2919355) from Official Microsoft Download Center

 

I'm able to reproduce the issue with the attached code sample written in C# targeting .NET 4.5 and references VMware.Vim.dll that comes with VMware-PowerCLI-6.3.0-3737840.

 

I'm running on Windows 7 Enterprise x64 SP1 and using Visual Studio 2015 Update 2.

"C:\KB2919355\Windows8.1-KB2919355-x64.msu" exists on my machine.

"C:\install" already exists in the guest.

In my case, the upload stops at around 50%.

There is enough disk space in the guest and on the host.

There is also enough memory on the host, indicated as Memory usage: 25445.00 MB Capacity: 32759.11 MB.

 

Running the PowerCLI Cmdlet Copy-VMGuestFile works without issues.

 

KB2137310

VMware KB: Consumption of VMware Extended Guest Statistics on ESXi 5.5 Update 3 or ESXi 6.0 may lead to virtual mach…

 

Any ideas?

 

Thank you!

 

Message was edited by: icnocop2 Updated build version numbers

how to get a list of Distributed vSwitch in c#

$
0
0

Hi,

    basically I use the code below (and it works) to get the list of vswitch and would like something like that for dVS....

 

var vswitches = ((VMware.Vim.HostSystem)(client.FindEntityViews(typeof(HostSystem), null, null, null)[0])).Config.Network.Vswitch;

 

            foreach (var vswitch in vswitches)

 

Thanks for your help.

SDK support creating vm with VMDK > 2T ?

$
0
0

Hello

 

May I create a vm with vmdk size >2T with SDK ?

 

I created a vm with wmdk 2046G with vSphere API, It works. But when I try to created a vm with vmdk 2048G, it fails and the error is :File *.vmdk is larger than the maximum size supported by datastore.

 

The enviroment is vSphere 5.5 and VMFS 5. 

 

Any body have idea on it?

 

thanks. 

GetViewByMorefs causes "Required parameter specSet is missing" for HostSystem

$
0
0

Hello,

I am attempting to get a collection of HostSystem objects in a specific cluster using the VMware.Vim API that comes with PowerCLI 6. I can retrieve the cluster by doing:

var clusters = client.FindEntityViews(typeof(ClusterComputeResource), null, null, null).Cast<ClusterComputeResource>();

For each of these clusters, I can inspect the Host property to get an array of MoRef's that point to each host in the cluster. However, when attempting to retrieve the hosts using:

var hosts = client.GetViewsByMorefs(cluster.Host, "Name", "Summary", "Vm").Cast<HostSystem>();

An exception is thrown:

Required parameter specSet is missing


while parsing call information for method RetrieveProperties

at line 1, column 218


while parsing SOAP body

at line 1, column 207


while parsing SOAP envelope

at line 1, column 38

I have tried both with and without specifiying the params string[] properties parameter specified, but I get the same result either way. Is there something I'm missing?

I have also tried past versions of the library (5.5 and 5.0), and encounter the same problem.

Thanks!

Required parameter specSet is missing
 
while parsing call information for method RetrieveProperties
at line 1, column 218
 
while parsing SOAP body
at line 1, column 207
 
while parsing SOAP envelope
at line 1, column 38

pyvmomi - example of DatastoreSystem.QueryVmfsDatastoreCreateOptions

$
0
0

I have been unable to make calls to the API's in the vim.host.DatastoreSystem. I am passing the right number of arguments but i still get an error 'Unexpected error: _InvokeMethod() takes at least 2 arguments (1 given)'. I posted the question on a couple of forums but have not gotten any response. Below is my code snippet.

 

def createDatastore(si, uuid):

    dp="/vmfs/devices/disks/"+ str(uuid)

    print "Device path: %s" %dp

    try:

        vmfs_ds_options = vim.host.DatastoreSystem.QueryVmfsDatastoreCreateOptions(devicePath=dp, vmfsMajorVersion=5)

    except vim.fault.NotFound:

        print "Not found"

    except vim.fault.HostConfigFault:

        print "host config fault"

    except vmodl.fault.NotSupported:

        print "Not supported"

    except Exception as e:

        print "Unexpected error: %s" %e

 

 

    else:

        print "Query success"

 

 

 

When i run my script, i get the below error (and traceback)

 

Traceback (most recent call last):

  File "test_datastore.py", line 74, in createDatastore

    vmfs_ds_options = vim.host.DatastoreSystem.QueryVmfsDatastoreCreateOptions(devicePath=dp, vmfsMajorVersion=5)

  File "/usr/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 560, in __call__

    return self.f(*args, **kwargs)

TypeError: _InvokeMethod() takes at least 2 arguments (1 given)

Unexpected error: _InvokeMethod() takes at least 2 arguments (1 given)

specifying the vmpath for cloning a VM with the SDK vmClone sample

$
0
0

 

Does anyone know the syntax on how the vmpath should be passed.

 

 

I have tried many of the examples:

 

 

--vmpath datacenter/folder/vmname

 

 

I can not get theis to work

 

 

VMINFO.PL: how to list the power state of the VM????

$
0
0

Hello all,

 

I have downloaded and compiled the VMware Infrastructure (VI) Perl Toolkit Packages (Latest Version: 1.5.0 | 1/17/2008 | Build: 67153). I am trying to get the

power state of the VM by executing the below script, but i cant get the output to do so. It simply prints out the help menu instead. When i use the powerstatus as a switch, do i pass anything as a argument? Please, help.

 

vminfo.pl --username XXXX --password XXXX --url XXXX --vmname XXXX --powerstatus ????

 

Thanks in advance!


how to get past this error? "Cannot find 'vimService.wsdl' wsdl. Place the resource correctly in the classpath."

$
0
0

Hi,

 

I download the VMWare management SDK 5.1 with Java samples.

 

I ran the build.bat file to build everything (I had to tweak it to get it working because it didn't like the spaces in "Program Files", for example) -- it produced the vim25.jar and the samples.jar.

 

When I try to run a sample (CreateVM), I provide all the required params (url, username, password, and so on), but it gives me this error:

 

javax.xml.ws.WebServiceException: Cannot find 'vimService.wsdl' wsdl. Place the resource correctly in the classpath.

    at com.vmware.vim25.VimService.<clinit>(VimService.java:32)

    at com.vmware.vm.VMCreate.connect(VMCreate.java:253)

    at com.vmware.vm.VMCreate.main(VMCreate.java:919)

 

 

I tried putting the vimService.wsdl in the classpath, but it still doesn't work.

 

What am I doing wrong?  Stuck on this.

 

Thanks!

Rob

vSphere-WS SDK Packages and JavaDoc

$
0
0

Hello guys,

 

I do have a bunch of question regarding to the java vsphere-ws sdk. I have build the vim25.jar and samples.jar following the instructions here:

http://pubs.vmware.com/vsphere-60/index.jsp#com.vmware.wssdk.dsg.doc/sdk_java_development.4.4.html

  • Is it possible to get the java doc for the vim25.jar into Netbeans?, I only found the Javadoc for the samples?
  • Is there a current documentation for all the classes at all? For example I was not able to find any documentation for the class "VimPortType"?
  • A lot of examples that I consulted in order to get startet with the sdk do import something from the package “mo”, like these:
    • importcom.vmware.vim25.mo.ClusterComputeResource;
    • importcom.vmware.vim25.mo.Datastore;
    • importcom.vmware.vim25.mo.Folder;
    • importcom.vmware.vim25.mo.HostSystem;
    • importcom.vmware.vim25.mo.InventoryNavigator;
    • importcom.vmware.vim25.mo.ServiceInstance;
    • importcom.vmware.vim25.mo.VirtualMachine;

     But somehow I do not have the “mo” package at all. Is this deprecated in 6.0 or why am I unable to see them?

How to set connection timeout in vSphere Java SDK?

$
0
0

Hi all,

how can be set the connection timeout in vSphere SDK?
I've tried to set in different way on VimPortType, with no luck.

For example:

        ((BindingProvider) _service).getRequestContext().put(JAXWSProperties.REQUEST_TIMEOUT, DEFAULT_TIMEOUT); // Timeout in millis

        ((BindingProvider) _service).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, DEFAULT_TIMEOUT); // Timeout in millis

 

Could you please help?

Documentation in lagging in this area.

 

Thanks!

Setting VM annotation/notes via SDK.

$
0
0

 

I'm interested in setting the annotation/notes property of a VM programatically via the Java/vSphere Web service SDK.  It seems that the annotation field is available in the following types:

 

  • VirtualMachineConfigSummary

  • VirtualMachineConfigInfo

  • VirtualMachineConfigSpec

 

So I guess I have a two part question.  One, which of the above types should I operate on in order to set the "Notes" field and secondly, what is the most direct way to accomplish this via Java and the SDK?

pyvmomi - add disk - RecommendDatastores

$
0
0

I am trying to add a disk to an existing VM.

if vm:    for cluster in ds_cluster:        print cluster.name        spec = vim.vm.ConfigSpec()        # get all disks on a VM, set unit_number to the next available        for dev in vm.config.hardware.device:            if hasattr(dev.backing, 'fileName'):                unit_number = int(dev.unitNumber) + 1                # unit_number 7 reserved for scsi controller                if unit_number == 7:                    unit_number += 1                if unit_number >= 16:                    print "we don't support this many disks"                    return            if isinstance(dev, vim.vm.device.VirtualSCSIController):                controller = dev        # add disk here        dev_changes = []        new_disk_kb = INSTANCE_TYPE['standard']['diskSize']  * 1024 * 1024 #int(args.disksize) * 1024 * 1024        disk_spec = vim.vm.device.VirtualDeviceSpec()        disk_spec.fileOperation = "create"        disk_spec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add        disk_spec.device = vim.vm.device.VirtualDisk()        disk_spec.device.backing = \            vim.vm.device.VirtualDisk.FlatVer2BackingInfo()        disk_spec.device.backing.datastore = datastore        disk_spec.device.backing.thinProvisioned = True        disk_spec.device.backing.diskMode = 'persistent'        disk_spec.device.unitNumber = unit_number        disk_spec.device.capacityInKB = new_disk_kb        disk_spec.device.controllerKey = controller.key        dev_changes.append(disk_spec)        spec.deviceChange = dev_changes        spec.name = vm.summary.config.name        podsel = vim.storageDrs.PodSelectionSpec()        podsel.storagePod = cluster        vmpodconfig = vim.storageDrs.PodSelectionSpec.VmPodConfig()        vmpodconfig.storagePod = cluster        disklocator=vim.storageDrs.PodSelectionSpec.DiskLocator()        disklocator.diskId = unit_number        disklocator.diskBackingInfo = disk_spec.device.backing        vmconfiginfo = vim.storageDrs.VmConfigInfo()        vmconfiginfo.vm  = vm        vmconfiginfo.enabled = True        vmpodconfig.vmConfig = vmconfiginfo        vmpodconfig.disk.append(disklocator)        podsel.initialVmConfig.append(vmpodconfig)        storagespec = vim.storageDrs.StoragePlacementSpec()        storagespec.podSelectionSpec = podsel        storagespec.vm = vm        storagespec.type = 'reconfigure'        storagespec.folder = datacenter.vmFolder        storagespec.configSpec = spec        storagespec.resourcePool = resource_pool        print storagespec        rec = content.storageResourceManager.RecommendDatastores(storageSpec=storagespec)        rec_key = rec.recommendations[0].key        print rec_key        #task = content.storageResourceManager.ApplyStorageDrsRecommendation_Task(rec_key)        #wait_for_task(task, 'Applying Disk Recommendations')        #task = vm.ReconfigVM_Task(spec=spec)        #wait_for_task(task,"Adding disk")        print "%sGB disk added to %s" % ('4', vm.config.name)    #reboot(vm,content,args)else:    print 'VM not found'

 

I keep getting the error:

Caught vmodl fault : A specified parameter was not correct: StoragePlacementSpec.podSelectionSpec and configSpec

Any idea what i am missing?

The documentation here https://github.com/vmware/pyvmomi/blob/master/docs/vim/StorageResourceManager.rst#recommendDatastores

seems confusing.

Need help in identifying right vmware API Property to check whether a Datastore supports Hardware Acceleration or not

$
0
0

Hi ,

We are developing a datastore view screen where we need to bring in a column to check if  "Hardware Accelearation" is Supported/Not Supported. Can someone help me in identifying the right vmware API property to get "Hardware Acceleration" status for a Datastore? 

Currently I am using HostSystem.capability.vStorageCapable as the property get this value. Here HostSystem is the host on which datastore is created. But I am not able to confirm if this is the right property. I tried to disable Hardware Acceleration of Host from ESXi and check if the value changes for datastore.But this does not have any impact on the Hardware Acceleration of  the Datastore.

It is also good if any one can suggest a way to disable "Hardware Acceleration" for a datastore. Atleast this helps us in .confirming whether the property we are using is valid or not.

Thanks in Advance

Rajendra

vim25.jar with Axis2's jar file can't be compatible

$
0
0

Does anyone use both Apache Axis2 and vim25.jar??

Please tell me how to solve the problem..Thanks!!

 


Custom Task setTaskState Error example

$
0
0


I'm trying to set error messages for my custom tasks when some unexpected error occurs.   From the vSphere 5.5 docs, I understand I need to invoke Task.setTaskState with the following parameters:


    _this    ManagedObjectReference    // reference to task


    state    TaskInfoState    // must be TaskInfoState.ERROR for errors


    result   xsd:anyType      // valid only if TaskInfo.State.success SKIP


    fault     MethodFault     //  must directly or indirectly extend VimFault


 


In the Eclipse IDE, the method VimPortType.setTaskState says the final argument is of type LocalizedMethodFault, not MethodFault.   So, I created a LocalizedMethodFault variable and set its properties.  One property setter is setFault, which takes a MethodFault.  I know VimFault extends MethodFault, so I create a VimFault instance and use with setFault. 


However, I see VimFault has a setter setFaultCause, which takes an argument of, LocalizedMethodFault.   So this fault assignment is starting to get recursive.


                LocalizedMethodFault fault = new LocalizedMethodFault();
                VimFault vimFault = new VimFault();


            
                fault.setDynamicType("Runtime Error");
                fault.setLocalizedMessage(message);
                fault.setFault(vimFault);


                vimFault.setDynamicType("Runtime Error");
                vimFault.setFaultCause(fault);


In any case, I tried to use this code but it did not work.  Any ideas or example code that works would be greatly appreciated.


-E

How to log in to SSO with SAML Token string

$
0
0

I'm trying to connect to vCloud Suite API via vSphere Web Client Plug-in and assign a tag to a datastore.
But I want to avoid having users enter user name and password on vSphere Web Client Plug-in GUI because it is not user-friendly.
Therefore, I want to connect to vCloud Suite API without having users enter user name and password.

I thought I could log in to SSO using SAML Token XML(UserSession.samlTokenXml) that can be obtained from Web Client SDK, but failed.

Following is the code I created using vCloud Suite API sample code.

 

Code :
com\vmware\vcloud\suite\samples\common\ServiceManager.java

public void connect()
            throws com.vmware.vcloud.suite.lookup.RuntimeFaultFaultMsg,
            RuntimeFaultFaultMsg, InvalidLocaleFaultMsg, InvalidLoginFaultMsg, InvalidTokenException {
           
    ...
   
    // login to vAPI service end point
    vapi = new VapiServiceEndpoint(vapiUrl);
    String samltokenXml = "<saml2:Assertion xmlns:saml2=\"urn:oasis:names:tc:SAML:2.0:assertion\" ... </saml2:Assertion>";
    vapi.login(DefaultTokenFactory.createToken(samltokenXml));

    ...
}

com\vmware\vcloud\suite\samples\vapi\endpoint\ServiceEndpoint.java

    public void login(SamlToken samlToken) {
        StubConfiguration tmp = new StubConfiguration();
        // Create a PrivateKey
        SecurityUtil su = SecurityUtil.generateKeyCertPair();
        tmp.setSecurityContext(SecurityContextFactory.createSamlSecurityContext(samlToken, su.getPrivateKey()));
        T session = stubFactory.createStub(clazz, tmp);
        char[] sessionId = login(session);
        stubConfiguration.setSecurityContext(SecurityContextFactory.createSessionSecurityContext(sessionId));
    }

 

Error :
com.vmware.vapi.std.errors.Unauthenticated: Unauthenticated (com.vmware.vapi.std.errors.unauthenticated) => {
    messages = [LocalizableMessage (com.vmware.vapi.std.localizable_message) => {
    id = vapi.method.authentication.required,
    defaultMessage = This method requires authentication.,
    args = []
}],
    data = <null>
}
    at com.vmware.vapi.std.errors.Unauthenticated._newInstance(Unauthenticated.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.vmware.vapi.internal.bindings.convert.impl.JavaClassStructConverter.createStructBinding(JavaClassStructConverter.java:167)
    at com.vmware.vapi.internal.bindings.convert.impl.JavaClassStructConverter.fromValue(JavaClassStructConverter.java:66)
    at com.vmware.vapi.internal.bindings.convert.impl.JavaClassStructConverter.fromValue(JavaClassStructConverter.java:36)
    at com.vmware.vapi.internal.bindings.TypeConverterImpl$ValueToJavaVisitor.visit(TypeConverterImpl.java:318)
    at com.vmware.vapi.bindings.type.ErrorType.accept(ErrorType.java:31)
    at com.vmware.vapi.internal.bindings.TypeConverterImpl.convertToJava(TypeConverterImpl.java:632)
    at com.vmware.vapi.internal.bindings.Stub.convert(Stub.java:389)
    at com.vmware.vapi.internal.bindings.Stub.convertError(Stub.java:406)
    at com.vmware.vapi.internal.bindings.Stub.access$300(Stub.java:58)
    at com.vmware.vapi.internal.bindings.Stub$2.setResult(Stub.java:220)
    at com.vmware.vapi.internal.bindings.Stub$2.setResult(Stub.java:211)
    at com.vmware.vapi.internal.protocol.client.msg.json.JsonApiProvider$ResponseCallbackImpl.received(JsonApiProvider.java:221)
    at com.vmware.vapi.internal.protocol.client.msg.json.JsonApiProvider$1.received(JsonApiProvider.java:249)
    at com.vmware.vapi.internal.protocol.client.rpc.http.HttpClient.handleContent(HttpClient.java:269)
    at com.vmware.vapi.internal.protocol.client.rpc.http.HttpClient.send(HttpClient.java:236)
    at com.vmware.vapi.internal.protocol.client.msg.json.JsonApiProvider.sendRequest(JsonApiProvider.java:126)
    at com.vmware.vapi.internal.protocol.client.msg.json.JsonApiProvider.invoke(JsonApiProvider.java:307)
    at com.vmware.vapi.internal.bindings.Stub.invoke(Stub.java:206)
    at com.vmware.vapi.internal.bindings.Stub.invoke(Stub.java:187)
    at com.vmware.vapi.internal.bindings.Stub.invokeMethodAsync(Stub.java:151)
    at com.vmware.vapi.internal.bindings.Stub.invokeMethod(Stub.java:119)
    at com.vmware.cis.SessionStub.create(SessionStub.java:37)
    at com.vmware.cis.SessionStub.create(SessionStub.java:30)
    at com.vmware.vcloud.suite.samples.vapi.endpoint.VapiServiceEndpoint.login(VapiServiceEndpoint.java:13)
    at com.vmware.vcloud.suite.samples.vapi.endpoint.VapiServiceEndpoint.login(VapiServiceEndpoint.java:1)
    at com.vmware.vcloud.suite.samples.vapi.endpoint.ServiceEndpoint.login(ServiceEndpoint.java:42)
    at com.vmware.vcloud.suite.samples.common.ServiceManager.connect(ServiceManager.java:138)
    at com.vmware.vcloud.suite.samples.common.ServiceManagerFactory.getServiceManager(ServiceManagerFactory.java:38)
    at com.vmware.vcloud.suite.samples.common.SamplesAbstractBase.getServiceManager(SamplesAbstractBase.java:151)
    at com.vmware.vcloud.suite.samples.cis.tagging.TagDatastore.setup(TagDatastore.java:80)
    at com.vmware.vcloud.suite.samples.common.SamplesAbstractBase.init(SamplesAbstractBase.java:127)
    at Main.tagCreateTest(Main.java:32)
    at Main.main(Main.java:19)

 

Login by the above code fails.

What kind of code should I create to log in to SSO using SAML Token XML?

Also, is there a way to connect to vCloud Suite API without using SSO's user name and password other than using SAML Token XML?

Clone a VM with THIN disk type as FLAT

$
0
0

I'm trying to clone a VM from a template. For that, I have a code as below 
 

VirtualMachineRelocateSpec rSpec = new VirtualMachineRelocateSpec();
...
rSpec.setTransform(VirtualMachineRelocateTransformation.FLAT);

 

As per this link

for thin provisioning , use sparse
for thick provisioning , use flat

Now, I want to check a condition where the underlying datastore doesn't support thick provisioning but I'm still passing transformation as flat (according to VMWare documentation here, which is a requirement)

In my case, the VM gets created with Thin provisioning. I want to know whether this is expected behavior or not. Should VMWare API throw an exception saying thick provision is not supported on this datastore.

Can anyone verify this?
 

create a task vsphere sdk

$
0
0

Hi all ,

We are working on the vSphere plugin and currently got stuck with creating a tasks in the vSphere webclients recent tasks.

we need to add a task to the recent tasks tab for any operation we do on the plugin we are developing .

My code looks like this :

    UserSession userSession = _userSessionService.getUserSession();
        ServerInfo[] sinfo = userSession.serversInfo;
        String sessionCookie = sinfo[0].sessionCookie;
        String serviceUrl = sinfo[0].serviceUrl;
        ServiceContent serviceContent = getServiceContent(sinfo[0].serviceGuid);
       
        ManagedObjectReference extensionReference = serviceContent.getExtensionManager(); 
         _taskMgrReference = serviceContent.getTaskManager();
         _vimPort.createTask(extensionReference, _taskMgrReference, "Rakesh", "Bandari", true, "Administrator", "TestFault");

    UserSession userSession = _userSessionService.getUserSession();
    ServerInfo[] sinfo = userSession.serversInfo;
    String sessionCookie = sinfo[0].sessionCookie;
    String serviceUrl = sinfo[0].serviceUrl;
    ServiceContent serviceContent = getServiceContent(sinfo[0].serviceGuid);
       
    ManagedObjectReference extensionReference = serviceContent.getExtensionManager(); 
    _taskMgrReference = serviceContent.getTaskManager();
   _vimPort.createTask(extensionReference,_taskMgrReference,"Rakesh","Bandari",true,"Administrator","TestFault");

 

this code doesn't work for me .Can some one please let me know how can i create a cutom task in the vPsphere plugin .

 

Thanks,

RakeshBandari

Help Setting up Development Environment for C#

$
0
0

Greetings, 

 

I am very new to using C# so maybe this is more of a simple matter of me missing something simple but I am trying to use the VMWare VSphere SDK for 5.5.  I am following the following article to set up my environment:

 

vSphere 5.5 Documentation Center

 

I am having a hard time with step 3 "generate the VimService.cs file"

 

The error that I am getting from wsewsdl3 is as follows:

 

Error:  Invalid URL, or File 'and' not found.

 

At first, I thought this was maybe an issue with the environment variables that I set but I did a cd to each variable and they are valid.  I also ensure that both the vim.wsdl and the VimService.wsdl are both located at the paths specified.  I am not sure where the command is getting the "'and'" from.  I did a direct copy and paste out of the documentation for the command to ensure that I did not have any typos when I manually typed in the command.

 

 

Operating System:  Windows 7

Visual Studio 2013 Professional

Viewing all 1860 articles
Browse latest View live


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