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

vSphere Management SDK url is just blank page

$
0
0

I'm trying to get started using the vSphere API, reading the document at the link below I should be able to browse to my vcenter using "sdk" in the URL but it's blank. Also I read that you have to download the root certificates, but that link is not where this document claims it is. I'm using 5.5

https://vdc-download.vmware.com/vmwb-repository/dcr-public/2d445149-7707-4c7d-98a7-9f00394b7df2/7322d611-ef3b-454a-ab63-ad3302d8b218/SDK/vsphere-ws/docs/SDK-README.html

Do I need to enable this SDK in vCenter?


How we can retrieve list of objects filtered by property in vSphere API?

$
0
0

I need the ability to filter what objects should fall to collection when retrieving objects in vSphere API, but can`t find any information about it in documentation.

Only using PropertyCollector to filter what properties may be in result vSphere Documentation Center.

What about API functionality like this? vSphere Documentation Center

For example I need get only VMs with specific name or state, or any other property.

Is there such an opportunity?

Programming / Scripting Language used for vSphere Management

$
0
0
We wanted to better understand what language you use or would like to us to develop vSphere Management Applications. Thanks for your time

Impact of vCenter plugin to vCenter's performance

$
0
0

Dear all

We have a vCenter plugin, which do a lot of work (calculate, create new thread ...). So I wonder does that impact much to performance of vCenter Server? Is there any document which mention about that?

Thanks for your help.

Console Proxy for VS6.5 (pre-authenticated)

$
0
0

Hi all, 

We are in the process of upgrading our/planning the rollout of 6.5 - currently on 5.5.

With the loophole of having the webconsole on the jetty powered service being closed - where by you could generate the console session tickets etc and chuck an (unauthenticated) user at that endpoint granting them access to the console. As this is now behind the authenticated /vsphere-client/ or /ui/ apps on the appliance this no longer works. Up until now we had been doing that and using IIS ARR to reverse proxy the requests into our infrastructure. 

I have an almost working solution but need some help with generated (for the lack of a better term) and application session token aka. what ends up as the JSESSIONID in your client cookie.

I have tried generating sessions via the restful api and using that ID as the value but it doesnt seem to accept them which in a way makes sense, different systems (ish). 

I am guessing i need to look into the SSO SDK but struggling with where to start - i even tried automating / mimicking the login to the various pages - following redirects and eventually posting the credentials to the SSO page so i could capture the JSESSIONID but still a work in progress/there has to be a better way.

FYI my new console proxy solution involves the standard looking URL for the new 6.5 /webconsole.html pages excepts switches out the domain for a proxy site running nginx, we also add an additional sessionid query string value and i have nginix add / append this to the reverse proxy request as well as have a set-cookie header back to the client.

Can someone point me in the right direction here/have any experience doing the same thing?

I need help, thank you all guys: [ cannot run the demo code according to the SSO programming guide]

$
0
0

1) I have configured 2 vcenters, xx.xx.xx.180,  xx.xx.xx.182,  and the SSO server: xx.xx.xx.181, like this:

ssss.png

 

2) according to  the programming guide(http://pubs.vmware.com/vsphere-60/topic/com.vmware.ICbase/PDF/sso_prog_guide_6_0.pdf )  , we can get token from sso server, like this:

1111.png

 

3)but i can't run the demo code, i got this error:

my command line: run.bat com.vmware.sso.client.samples.AcquireBearerTokenByUserCredentialSample https://192.168.21.181/sts/STSService username passs

222.png

i don't understand why got this error, i can visit the sso url through: https://192.168.21.181/sts/STSService

121212.png

finnaly i found out the reason why I got the 404 error,  because of the code in  demo:

Bu I don't know how to fix it..

 

 

 

I don't think i missed any steps,  pls  help  me,  thanks!!!

Need help, Unable to find some information using vim25 SDK

$
0
0

Hi, Guys,

We used to use powerCLI to collect some useful information from vSphere, and now we want to find the same information using vim25 SDK, but we are not able to find the following items.

Can anyone help to tell if they are available in SDK, if so, where can I find them?

 

Thanks

 

 

column1: the powerCLI command we use.

column2: the attribute we cannot find in SDK correspondingly.

column3: a sample value for this attribute from powerCLI output.

 

 

$(Get-VMHost | Where-Object {$_.ConnectionState -eq 'Connected' -and $_.Version -eq '6.0.0'} | % {

$esxcli = Get-EsxCli -VMHost $strVMHostName.Name

    New-Object psobject -Property @{

"strVMHostName" = $_

"hostname" = ($esxcli.system.hostname.get()).hostname

"lockmode" = $esxcli.storage.vmfs.lockmode.list()}})

ATSCompatible

FALSE

ATSIncompatibilityReason

Device does not support ATS

ATSUpgradeModes

None

LockingMode

ATS+SCSI

 

Get-Cluster | Get-VM | Sort Name | Get-HardDisk | Select Parent,Name,CapacityGB,DiskType,

ScsiCanonicalName,FileName | FT -AutoSize

DiskType

Flat

 

        $HostVIBs = $esxcli.software.vib.list() |

            Where-Object {$_.Name -like "*vem*" } | Select-Object Name,Version,Vendor,ID

VEM version

v172-5.2.1.3.1.3.0-3.2.1

 

 

$(Get-VM | where { $_.PowerState -eq “PoweredOn”} | %{$strVMName = $_.Name Get-Stat -Entity $_ -Stat Cpu.Ready.Summation -RealTime | Group-Object -Property MetricID | %{New-Object -TypeName PSObject -Property @{VMName = $strVMName; MetricId = $_.Name; AvgValue = ($_.Group | Measure-Object -Property Value -Average).Average Units = ($_.Group | %{$_.Unit} | Select -Unique) -join "," } | Select VMName,MetricId,AvgValue,Units ## end new-object}} | Sort-Object -Property MetricID,AvgValue,VMName -Descending)

MetricID

  1. cpu.ready.summation

AvgValue

  1. 179.5944134

Units

millisecond

 

 

 

$(Get-VMHost | Where-Object {$_.ConnectionState -eq 'Connected'} | % {

$strVMHostName = $_

$esxcli = Get-EsxCli -VMHost $strVMHostName.Name

$hostname = $esxcli.system.hostname.get() | select -ExpandProperty Hostname

$esxcli.storage.core.device.list() | select @{N="hostname";E={$hostname}}, Vendor, Model, Device, Size, NoofoutstandingIOswithcompetingworlds, VAAIStatus | FT -AutoSize})

NoofoutstandingIOswithcompetingworlds

32

 

 

 

 

$(Get-VMHost | Where-Object {$_.ConnectionState -eq 'Connected'} | % {

$strVMHostName = $_

$esxcli = Get-EsxCli -VMHost $strVMHostName.Name

$esxcli.system.hostname.get() | select -ExpandProperty Hostname

$esxcli.system.module.parameters.list("fnic")

})

fnic_fc_trace_max_pages

fnic_max_qdepth

0

fnic_trace_max_pages

fnic_max_qdepth

 

fnic_trace_max_pages

 

heap_initial

 

heap_max

 

skb_mpool_initial

 

  1. driver. skb_mpool_max

 

 

 

$(Get-VMHost | Where-Object {$_.ConnectionState -eq 'Connected'} | % {$strVMHostName = $_; $esxcli = Get-EsxCli -VMHost $strVMHostName.Name

$esxcli.system.hostname.get() | select -ExpandProperty Hostname;$esxcli.system.settings.advanced.list() | select Path, IntValue | where {$_.Path -eq '/DataMover/MaxHWTransferSize'}})

MetricID,AvgValue,VMHostName -Descending)

Path

/DataMover/MaxHWTransferSize

 

IntValue

4096

 

 

vSphere 6.0 Task and events notification

$
0
0

Hi ,

Is there a way where we can subscribe to the events and task status and vSphere can notify us when the event/task happens/completes.

 

My goal is to get the notifications from vSphere tasks and events , without having to poll for task/events from vSphere.  I am thinking of exposing an endpoint by extending the interface from vSphere management SDK (6.0)  and configure that endpoint in vSphere  , and get notified on tasks and events as it happens on vSphere instead of me polling the vSphere.

 

I am not sure if it is possible , any help/sample/documentation is appreciated.

 

Thanks

-Sada


Getting the details of a VM's host

$
0
0

Hi,

 

I'm trying to get the host details related to a VM, so that I can construct a link to the Web console. Code:

if (dp.getName().equals("runtime")) {                VirtualMachineRuntimeInfo runtimeInfo = (VirtualMachineRuntimeInfo) dp.getVal();                ManagedObjectReference hostInfo = runtimeInfo.getHost();                getInfoHote(hostInfo);  public String getInfoHote(ManagedObjectReference hostInfo) {

 ManagedObjectReference propColl = serviceContent.getPropertyCollector();

    try {      List<String> vmList = new ArrayList<String>();      vmList.add("HostSystem");      ManagedObjectReference cViewRef = vimPort.createContainerView(hostInfo,          serviceContent.getRootFolder(),          vmList,          true);            ObjectSpec oSpec = new ObjectSpec();      oSpec.setObj(cViewRef);      oSpec.setSkip(true);      TraversalSpec tSpec = new TraversalSpec();      tSpec.setName("traverseEntities");      tSpec.setPath("view");      tSpec.setSkip(false);      tSpec.setType("ContainerView");      oSpec.getSelectSet().add(tSpec);      PropertySpec pSpec = new PropertySpec();      pSpec.setType("HostSystem");      pSpec.getPathSet().add("config");      PropertyFilterSpec fSpec = new PropertyFilterSpec();      fSpec.getObjectSet().add(oSpec);      fSpec.getPropSet().add(pSpec);      List<PropertyFilterSpec> fSpecList = new ArrayList<PropertyFilterSpec>();      fSpecList.add(fSpec);      RetrieveOptions ro = new RetrieveOptions();      RetrieveResult props = vimPort.retrievePropertiesEx(propColl,fSpecList,ro);

 

But I'm getting:

 

com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: The request refers to an unexpected or unknown type. Please see the server log to find more detail regarding exact cause of the failure.

 

What I'm doing wrong?

Having problem with downloading plugin resource bundles, when the port number of vCenter is not default port (443).

$
0
0

We have installed a vCenter in PORT - 441.

We are trying to register a plugin (com.vitallabs.storApp.TasksAndEvents) for displaying Task and Events with properties: eventList, faultList, taskList

When we tried to register our plugin the resource bundle is not getting downloaded properly.

When we read virgo logs for the plugin, we came across the following lines:

 

[2017-08-09T12:32:51.710+05:30] [WARN ] cm-catalog-manager-pool-1704 70000427 100013 200003 com.vmware.vise.vim.cm.CmCatalogManager                           ResourceBundle https://10.10.2.14/catalog/com.vitallabs.storApp.TasksAndEvents_catalog.zip download failedjava.net.ConnectException: Connection refused: connect

[2017-08-09T12:32:51.710+05:30] [INFO ] cm-catalog-manager-pool-1704 70000427 100013 200003 com.vmware.vise.vim.cm.CmCatalogManager                           download time (ms) for the resource bundle C:\ProgramData\VMware\vCenterServer\cfg\vsphere-client\cmCatalog\com.vmware.ciscom.vitallabs.storApp.TasksAndEvents.zip,https://10.10.2.14/catalog/com.vitallabs.storApp.TasksAndEvents_catalog.zip: 1082

[2017-08-09T12:32:51.710+05:30] [WARN ] cm-catalog-manager-pool-1704 70000427 100013 200003 com.vmware.vise.vim.cm.CmCatalogManager                           Failed to download C:\ProgramData\VMware\vCenterServer\cfg\vsphere-client\cmCatalog\com.vmware.ciscom.vitallabs.storApp.TasksAndEvents.zip from https://10.10.2.14/catalog/com.vitallabs.storApp.TasksAndEvents_catalog.zip

 

But when we tried to run the url with port number i.e., "https://10.10.2.14:441/catalog/com.vitallabs.storApp.TasksAndEvents_catalog.zip", we are able to download the Resource Bundle file.

This also perfectly works fine if vCenter is deployed in default port number.

 

Any idea why vCenter is not adding port number to the catalog path before downloading resource bundle?

Thick Provision Eager Zeroed

$
0
0

Ciao a tutti sono un nuovo utente e sto studiando vmware. Quali sono i vantaggi nell'usare  Thick Provision Eager Zeroed Thick Provision Lazy Zeroed e Thin Provision?

 

Perchè usare una modalità piuttosto di un'altra?

 

Quando è consigliabile usarle?

 

Dove posso trovare queste risposte in rete?

 

Trovo solo scritto cosa sono ma non dicono quando e perchè usare una piuttosto dell'altra

 

Spero in una risposta

 

Ciao!

Getting real -time VM CPU usage using VMWare Infrastructre SDK 2.5

$
0
0

 

I searched the SDK for a long time, but still get no luck. Could any one please give me some hints?

 

 

 

 

 

Thanks,

 

 

Qian

 

 

503 Service Unavailable (Error connecting tunnel on named pipe: (null)) (ticket wmks)

$
0
0

Hello, I'm trying to use the html5 sdk console from vmware to externally manage the machines, I have used the sample code and fulfilled the necessary requirements, but I am not getting success in running, it gives the following error 503.

Does anyone know how I can solve it?

 

503 Service Unavailable (Error connecting tunnel on named pipe: (null))

 

Code:

<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>Console</title>

</head>

<body>

<link rel="stylesheet" type="text/css" href="css/wmks-all.css" />

<script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.min.js"></script>

<script type="text/javascript" src="https://code.jquery.com/ui/1.8.16/jquery-ui.min.js"></script>

<script type="text/javascript" src="wmks.min.js"></script>

<div id="wmksContainer" style="position:absolute;width:100%;height:100%"></div>

<script>

var wmks = WMKS.createWMKS("wmksContainer",{})

.register(WMKS.CONST.Events.CONNECTION_STATE_CHANGE, function(event,data){

if(data.state == WMKS.CONST.ConnectionState.CONNECTED){

  console.log("connection state change : connected");}

});

wmks.connect("wss://ip:443/ticket/ticketnumber");

</script>

</body>

</html>

 

Remember that the version of my vmware is 6.0

If someone knows how to solve thank you right away.

Performance Manager returning no data - C#, vSphere 6.5

$
0
0

Hi all,

I have code that works fine with vSphere 5, 5.5 and 6.0 that will return me performance stats with no problem. As soon as I point it at a 6.5 environment I get nothing returned by any object for any counter.

I have used powershell to query the 6.5 vCenter (not an appliance) and it returns data correctly.

Is there any changes that I have missed for 6.5 which could stop me getting performance data from vCenter? It is hard for me to post code as it is entwined with some complex methods etc.

Thanks,

Paul

Hostdiag vCenter extension - severity

$
0
0

Hello,

There is a vCenter extension - hostdiag which sends events of type EventEx. For instance, eventTypeId – “esx.problem.scsi.device.io.latency.high” and severity field is empty string. There is no severity info in ExtensionEventTypeInfo either.

Hovewer vCenter marks those events as warnings somehow (see the attached screenshot). So how does vCenter get this information?


VimService65.dll not found

$
0
0

Hello

I just updated to PowerCLI 6.5.2 as I need access to the VMware.Vim.dll.  After upgrading when I run my code it complains that VimService65.dll is not found.  Before when I used version 6.5.0 there were no issues.  To get this to work I needed to manually add the VimService65.dll to my project.  Is this normal for this version?

Total bandwidth usage tracking

$
0
0

In VMWare vSphere, how can I set and track the monthly bandwidth usage of each guest? I need to reduce the network speed when bandwidth usage exceeds 90% or so.

 

What are my options?

Could not load VMware.Vim dll as doesn't have the strong name in Power CLI 6.5

$
0
0

Hi,

 

Till 6.5.0 Power CLI, VMware.Vim.dll was strong name enabled dlls. But from 6.5.1, those dll's are not strongly named dll's.

 

In PowerShell gallery based installation also, dll's were not strongly named.

 

Unable to load those dll's into strongly named execution binary.

 

 

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'VMware.Vim, Version=6.5.1.378, Culture=neutral, PublicKeyToken=null' or one o

f its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

   at VimClientTest.Program.Main(String[] args)

Knowing datastore name/url pair, how to get the actual datastore?

$
0
0

Hi, 

I collected a list of VirtualMachineConfigInfoDatastoreUrlPair from querying the target vm, is there easy way for me to get to the actual datastore without iterating/searching through the whole inventory?   Thanks in advance.

Help with TraversalSpec

$
0
0

Hello
I trying to retrieve data from a standlone esxi host using c# and the vmware.vim.dll. 
I am trying to do this using the Property Controller along with the TraversalSpec.  The following code is what I have but when I run it I get the following:

"Additional information: A specified parameter was not correct: undefined TraversalSpec name" at the 
ObjectContent[] objs =pCollector.RetrieveProperties(pFss);


Without the TraversalSpec section I can get the maxCollector value if I change the "ipAddress" to "maxCollector" but I'm trying to get the ipAddress that is within the latestEvent property.
This is just a test to see that it works.  So far I cant get the TraversalSpec part to work.

Any help would be appreciated.

public void listTasks(VimClientImpl client)
 
        {
    ManagedObjectReference objRef = new ManagedObjectReference();
 
            objRef.Type = "ServiceInstance";
 
            objRef.Value = "ServiceInstance";
 
 
 
            ServiceContent sc = client.ServiceContent;
 
            
 
            ManagedObjectReference pcMOR = sc.PropertyCollector;
 
            
 
            ManagedObjectReference rootFolderMOR = sc.EventManager;
 
            PropertySpec pSpec = new PropertySpec();
 
            pSpec.All = false;
 
            pSpec.Type = rootFolderMOR.Type;
 
            pSpec.PathSet = (new String[] { "ipAddress" });
 
 
 
            ObjectSpec oSpec = new ObjectSpec();
 
            oSpec.Obj = rootFolderMOR;
 
 
 
            TraversalSpec folderToChild = new TraversalSpec();
 
            folderToChild.Name = "folderToChild";
 
            folderToChild.Type = rootFolderMOR.Type;
 
            folderToChild.Path = "latestEvent";
 
            folderToChild.Skip = false;
 
 
 
            SelectionSpec foldersSSpec = new SelectionSpec();
 
            foldersSSpec.Name = "folderToChild";
 
            SelectionSpec[] ftcArr = new SelectionSpec[] { foldersSSpec };
 
            oSpec.SelectSet = ftcArr;
 
 
 
 
 
            PropertyFilterSpec[] pFss = new PropertyFilterSpec[1];
 
            pFss[0] = new PropertyFilterSpec();
 
            pFss[0].ObjectSet = (new ObjectSpec[] { oSpec });
 
            pFss[0].PropSet = (new PropertySpec[] { pSpec });
 
 
 
            PropertyCollector pCollector = new PropertyCollector(client, pcMOR);
 
 

            //fails at this point

            ObjectContent[] objs =pCollector.RetrieveProperties(pFss);
 
 
 
            if (objs!=null&&objs[0]!=null)
 
            {
 
                for (int i =0; i<objs.Length;i++)
 
                {
 
                    DynamicProperty[] dps = objs[i].PropSet;
 
                    foreach (DynamicProperty d in dps)
 
                    {
 
                        listview1.Items.Add(d.Val);
                    }
 
                }    
 
            }
 
         }
 

Thanks

public void listTasks(VimClientImpl client)
 
        {
    ManagedObjectReference objRef = new ManagedObjectReference();
 
            objRef.Type = "ServiceInstance";
 
            objRef.Value = "ServiceInstance";
 
 
 
            ServiceContent sc = client.ServiceContent;
 
            
 
            ManagedObjectReference pcMOR = sc.PropertyCollector;
 
            
 
            ManagedObjectReference rootFolderMOR = sc.EventManager;
 
 
 
            
 
            
 
            PropertySpec pSpec = new PropertySpec();
 
            pSpec.All = false;
 
            pSpec.Type = rootFolderMOR.Type;
 
            pSpec.PathSet = (new String[] { "ipAddress" });
 
 
 
            ObjectSpec oSpec = new ObjectSpec();
 
            oSpec.Obj = rootFolderMOR;
 
 
 
            TraversalSpec folderToChild = new TraversalSpec();
 
            folderToChild.Name = "folderToChild";
 
            folderToChild.Type = rootFolderMOR.Type;
 
            folderToChild.Path = "latestEvent";
 
            folderToChild.Skip = false;
 
 
 
            SelectionSpec foldersSSpec = new SelectionSpec();
 
            foldersSSpec.Name = "folderToChild";
 
            SelectionSpec[] ftcArr = new SelectionSpec[] { foldersSSpec };
 
            oSpec.SelectSet = ftcArr;
 
 
 
 
 
            PropertyFilterSpec[] pFss = new PropertyFilterSpec[1];
 
            pFss[0] = new PropertyFilterSpec();
 
            pFss[0].ObjectSet = (new ObjectSpec[] { oSpec });
 
            pFss[0].PropSet = (new PropertySpec[] { pSpec });
 
 
 
            PropertyCollector pCollector = new PropertyCollector(client, pcMOR);
 
 
 
            ObjectContent[] objs =pCollector.RetrieveProperties(pFss);
 
 
 
            if (objs!=null&&objs[0]!=null)
 
            {
 
                for (int i =0; i<objs.Length;i++)
 
                {
 
                    DynamicProperty[] dps = objs[i].PropSet;
 
                    foreach (DynamicProperty d in dps)
 
                    {
 
                        
 
                             
 
                        listview1.Items.Add(d.Val);
 
                            
 
                    }
 
                }    
 
            }
 
         }
Viewing all 1860 articles
Browse latest View live


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