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

HA configuration (ClusterDasAdvancedRuntimeInfo) w/ VMWare.vim?

$
0
0

Not sure if this should go here or the PowerCLI forum (move if necessary).

 

I'm using VMWare.vim.dll in c# and trying to retrieve HA configuration on my clusters.

 

ClusterComputeResource.RetrieveDasAdvancedRuntimeInfo() should return ClusterDasAdvancedRuntimeInfo. 

 

When i invoke the method using the mob it appears to be returning ClusterDasFailoverLevelAdvancedRuntimeInfo instead

 

According to mob this is supposed to contain information about HA 'slots', such as hostSlots, totalSlots, etc.  This is the information I need, but when I invoke the RetrieveDasAdvancedRuntimeInfo method on a cluster it returns the ClusterDasAdvancedRuntimeInfo that does not have these parameters.

 

How can I retrieve what I need?


Shared datastores from a cluster of ESXi servers

$
0
0

Hi,

 

Is there any API that gives only the shared datastores of a particular ESXi server / cluster of ESXi servers..?

 

Cluster1

--Host1 --> local1, shared1, shared2

--Host2 --> local2, shared1, shared2

 

where shared1 and shared2 are mapped to both Host1 and Host2. So is there any API to get these..? I achieved this by getting the datastores from all the hosts and comparing them. But if there is any API then I can reduce the no. of lines in my code.

 

Please help.

Retrieve list of alarm descriptions in C#

$
0
0

How do I do it?  It seems like such a simple thing yet I'm struggling (I can do other things like get VMs, DC's, etc but I am still learning...).  I can get the alarm ID's, just having trouble with the descriptions.

 

Can someone please point me in the right direction?

An error for add the Pnic to the DVS via vSphere SDK

$
0
0

I try to add the Pnic to the DVS via vSphere SDK , but i occur an error. Anybody can help me?

 

An error occurred during host configuration.

2015-04-03 15:50:51,291 INFO  c.v.v.LogUtil [printDetailedObject:142] [main] -  Arg(1) Key = msg

2015-04-03 15:50:51,291 INFO  c.v.v.LogUtil [printDetailedObject:142] [main] -  Arg(2) Value = 10.0.70.49

2015-04-03 15:50:51,291 INFO  c.v.v.LogUtil [printDetailedObject:142] [main] -  Arg(2) Key = host

2015-04-03 15:50:51,291 WARN  c.v.v.v.Task [getTaskInfo:163] [main] - ---- End of Error details -------------------------------------

Exception in thread "main" com.vmware.vc.MethodFaultFaultMsg: Cannot complete a vSphere Distributed Switch operation for one or more host members.

    at com.vmware.vcqa.vim.DistributedVirtualSwitch.reconfigure(DistributedVirtualSwitch.java:258)

    at com.vmware.vcqa.vim.dvs.DVSUtil.addPnicsToUplinkPortKey(DVSUtil.java:3652)

    at VCDEnvSetup.Test.main(Test.java:88)

queryPerf and random timeout

$
0
0


Hi all, could you give me some advices on how to understand the root cause of this problem?


Code is performing q queryPerf call on realtime data. Every call is getting counters for Host and associated VMs. 


Randomly, call fails returning no data all. If I try to perform the same call some seconds after, I obtain no data. Usually, after 15/20min, call start working again.


Network is fine, I suspect a lack of resources on vCenter or a problem on host (an utilization spike?).


What should I have to look at in order to get the root cause of the problem?


 Thanks!

Finding host initiator information for 6.0 ESX Host path

$
0
0


I have hit an issue with 6.0 ESXi hosts that is caused by a different behavior than 5.x hosts in our vSphere plugin.  The problem/difference lies in the HostMultipathStateInfoPath name field.  For pre-6.0 systems the field would contain "iqn.1998-01.com.vmware:ictm-dev-01-38a18efa-00023d000001,iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004c267c0000000051640559,t,1-naa.6782bcb00013ffa400005ea854913534" for an iSCSI path and "fc.20000000c9e46418:10000000c9e46418-fc.20020080e51f63ac:20120080e51f63ac-naa.60080e50001f63ac00004c9b551265f9" for a FibreChannel path.  I was using this information to find the endpoint for mapping to the storage systems supplying storage to the datastores.


On the 6.0 ESX servers the name field contains "vmhba33:C0:T0:L1" which doesn't directly supply me the information I need.  I have been looking around in the MOB for the information I was using, which in this case was the Host side initiator information, i.e. for the FC example above its the <span style="font-size:11px;"><span style="color: rgb(0, 0, 0); font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; line-height: normal;">20000000c9e46418:10000000c9e46418 </span></span>and for iSCSI its the <span style="font-size:11px;"><span style="color: rgb(0, 0, 0); font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; line-height: normal;">iqn.1998-01.com.vmware:</span><span>ictm-dev-01-38a18efa-00023d000001</span></span>.    I don't know how to find the information I need for being able to do my mapping from the ESX host side datastore to the storage served up by my storage system product that I have developed the plugin for.

 


Is there something I can do with the vmhba33:C0:T0:L1 information that the name field now contains to retrieve the information I need?


 

A general system error occurred: Not initialized

$
0
0

I try to add Traffic Rule for one of ports on DVS.

 

Body of my SOAP request looks like:

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelopexmlns:ns0="urn:vim25"

   xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

   <ns1:Body>

   <ns0:ReconfigureDVPort_Task>

   <ns0:_thistype="VmwareDistributedVirtualSwitch">dvs-52</ns0:_this>

   <ns0:port>

   <ns0:operation>edit</ns0:operation>

   <ns0:key>1196</ns0:key>

   <ns0:settingxsi:type="ns0:VMwareDVSPortSetting">

   <ns0:filterPolicy>

   <ns0:inherited>0</ns0:inherited>

   <ns0:filterConfig

   xsi:type="ns0:DvsTrafficFilterConfig">

   <ns0:inherited>0</ns0:inherited>

   <ns0:trafficRuleset>

   <ns0:enabled>1</ns0:enabled>

   <ns0:rules>

   <ns0:description>description

   </ns0:description>

   <ns0:sequence>1</ns0:sequence>

   <ns0:qualifier

   xsi:type="ns0:DvsIpNetworkRuleQualifier">

   <ns0:sourceAddress

   xsi:type="ns0:IpRange">

   <ns0:addressPrefix>

  255.255.255.255

   </ns0:addressPrefix>

   <ns0:prefixLength>0

   </ns0:prefixLength>

   </ns0:sourceAddress>

   <ns0:destinationAddress

   xsi:type="ns0:IpRange">

   <ns0:addressPrefix>

  255.255.255.255

   </ns0:addressPrefix>

   <ns0:prefixLength>0

   </ns0:prefixLength>

   </ns0:destinationAddress>

   <ns0:protocol>

   <ns0:negate>false</ns0:negate>

   <ns0:valuexsi:type="xsd:string">

  6

   </ns0:value>

   </ns0:protocol>

   </ns0:qualifier>

   <ns0:action></ns0:action>

   <ns0:direction>incomingPackets

   </ns0:direction>

   </ns0:rules>

   </ns0:trafficRuleset>

   </ns0:filterConfig>

   </ns0:filterPolicy>

   </ns0:setting>

   <ns0:configVersion>4</ns0:configVersion>

   </ns0:port>

   </ns0:ReconfigureDVPort_Task>

   </ns1:Body>

</SOAP-ENV:Envelope>

 

What I receive in answer is:

A general system error occurred: Not initialized

 

Can someone tell me what is wrong with my SOAP request. Maybe I have to configure something on DVS or Port Group, to make this SOAP request to work.

 

I'm using oslo.vmware to create and send API requests. DVS is set to be compatible with vSphere API 5.5.

Adding custom objects to vCenter Inventory

$
0
0


Hi,

I've tried this in the webClient Forum, but was told to submit the discussion here.

 

We have custom objects in our plugin (WebClient), similar to the Rack and Chassis samples which are a part of the vSphere WebClient sdk.

We need to allow an Administrator to  assign permissions to these objects.

To do this, we think it must be necessary to add our objects to the vCenter Inventory.

Is our assumption correct? Is it possible to do this? Are there any samples to show how this is done?

thanks for any info

Cathy


Copying ovf file from local to datastore is not happening using your sample class ColdMigration.java under package com.vmware.httpfileaccess

$
0
0

While trying to copy ovf file from local to datastore using your sample class ColdMigration.java under package com.vmware.httpfileaccess showing me the following output in console

 

Copying The Virtual Machine file To Host..........

Putting VM File https://10.106.251.12/folder/datastore1_3/rishi?dcPath=ha-datacenter&dsName=datastore1_3

File size is: 5

 

After this the program is not getting terminated and file is not getting copied to remote. Please suggest the needful. Thanks.

What is the actual purpose of the accessible property in the NetworkSummary data object ?

$
0
0

Hi There,

I have a scenario where i need to monitor the SSH connectivity of the ESX server.

Simple way is to ping each server and get the status of individuals against the response of a ping.

 

I found the accessible property in thenetwork summarydata object.

vSphere 5.5 Documentation Center

Description of it is not that much succinct to get the meaning of it in a one go.

 

Is anyone aware about the purpose of this property? Will it be helpful to monitor the SSH connectivity of ESX Server.(something like iteratively checking the ping status)

How it internally works? Does it try a ping to individual server to confirm the connectivity?

Any help will be appreciated.

 

Abhijit.

Need some help with retrieving objectId for the vCenter Server from the Home View

$
0
0


Hi,


What I am trying to achieve is this:


Create a new Home View where the user can enter some config info. When the user clicks the submit button, trigger a background job to traverse the vCenter tree (as can be seen in the MOB), and retrieve information about the ESX Servers and Virtual Machines as well. (Assume I have a single vCenter Server).


I wanted to use the default utilities (QueryUtil, ObjectUtil, etc.) and not have to munge using the vSphere SDK (the vim25.jar classes that is) if possible. However, I am stuck at how to retrieve the "objectId" of the vCenter server itself. The sample code shows how to send the objectId from the GUI depending on the current context (for instance if I am at the ESXi node in the inventory tree, I can get its objectId from the URI), but there is no way I could find to simply get a handle to the objectId of the vCenter Server itself, or even a MOR.


When I tried retrieving the ServerInfo object from the UserSession object, I could see the "ServiceContent" and "ServiceInstance" objects inside the actual runtime object, but these are clearly not accessible from client code! So how do I go about it? 


In brief, I want minimal code to get a handle to the vcenter server root and be able to retrieve the ESX Server and VM (and their properties) information! I am on a severe time crunch, and hence the extreme need to go down the easiest path!


 


P.S: In the worst case, I wouldn't mind writing classic vSphere SDK code to retrieve the information, but when I took a look at the SDK samples for the vSphere WebServices SDK, the login process has been made extremely compliccated, and the username/password method is deprecated! Just curious - can I use the security token from the UserSession object and pass this to logon to the vSphere Web Service? Or can I still use the classic username/password combination?


Any help or suggestions will be much appreciated!


Thanks!


 


 


 


 

How do i programtically create a tag category via VIJAVA or vSphere SDK?

$
0
0

Example would be much appreciated.

Label ignored for vmxnet3 virtualdevice

$
0
0

I'm trying to set the label for a vmxnet3 virtual device, the information is passed to vsphere, but vsphere ignores the label (customlabel) and just calls the network interface 'Network Adapter 1'.

 

Data passed to Vsphere (Using Fog.io):

 

(vim.vm.device.VirtualDeviceSpec) {
-->             dynamicType = <unset>,
-->             operation = "add",
-->             fileOperation = <unset>,
-->             device = (vim.vm.device.VirtualVmxnet3) {
-->                dynamicType = <unset>,
-->                key = 0,
-->                deviceInfo = (vim.Description) {
-->                   dynamicType = <unset>,
-->                   label = "customlabel",
-->                   summary = "VM Network",
-->                },
-->                backing = (vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo) {
-->                   dynamicType = <unset>,
-->                   port = (vim.dvs.PortConnection) {
-->                      dynamicType = <unset>,
-->                      switchUuid = "be 0c 1a 50 3a 62 17 09-ba a4 0a 88 ad a6 96 a0",
-->                      portgroupKey = "dvportgroup-87",
-->                      portKey = <unset>,
-->                      connectionCookie = <unset>,
-->                   },
-->                },
-->                connectable = (vim.vm.device.VirtualDevice.ConnectInfo) null,
-->                slotInfo = (vim.vm.device.VirtualDevice.BusSlotInfo) null,
-->                controllerKey = <unset>,
-->                unitNumber = <unset>,
-->                addressType = "generated",
-->                macAddress = <unset>,
-->                wakeOnLanEnabled = <unset>,
-->                resourceAllocation = (vim.vm.device.VirtualEthernetCard.ResourceAllocation) null,
-->             },
-->          },

 

But when I read the device info back it comes back as 'Network Adapter 1'.

Is it possible to set a label on a network adapter?

sharing same PropertyCollector instance across threads with non-overlapping actions?

$
0
0

Hi,

 

Can the same instance of PropertyCollector be shared across 2 threads if the properties to be read/collect don't overlap?

 

Running VCSA 5.5

 

First Thread:  
- invokes WaitForUpdatesEx() on the PropertyCollector to monitor updates on EventHistoryCollector.latestPage, with filter defined based on event types

 

Second Thread:

- invokes RetrievePropertiesEx() on the same Property Collector to read certain attributes of VM objects, with filter defined based on VM properties

 

Concern:

- Would WaitForUpdatesEx() and RetrieveProperties() calling from different threads potentially mess up the run time state of the same Property Collector instance?

 

From vSphere docs, it seems separate instances of PropertyCollector are required if both threads are using WaitForUpdatesEx(); but I am not sure

whether the same restriction also applies for combination of WaitForUpdatesEx() and RetrieveProperties() with non-overlapping filters.

 

Thanks!

Vmware server performance issue

$
0
0

Hi All,

I am new to the VMware, I am a citrix xenapp admin. currently my citrix environment is running on the Virtual machines and the esxi host version is 5.1

currently i have performance issue with the applications running on these machines. applications are working fine but some scenario where there is a huge data execution between application server and database server, execution time is very high. we have worked on the Databases and application point of view with the vendors. Now i just want to check with the VMware point of view.

 

All the application servers are in one host and the database servers are in different host.

 

1. could you please let me know what settings/configuration  i need to check to improve the performance of these machine.

2. for application server we have 8 GB RAM,  2 processor(2 core each), my concern is having 2 processors with 4 cores(2 core each) performce better or 4 processors with 4 cores(1 core each) will perform better?

3. simply increasing the cores of a processor will increase the performance or not?

 

please hel[ me on this


How to use two different versions of the Web Client SDK stub files in a single project (5.5 and 6.0)

$
0
0

Hello,

 

I have a project that uses the vSphere 5.5 Management SDK (I built the stub files as per documentation) and have these in my C# Solution. Everything works great. My class files that interact with vSphere all have a using statement like so:

 

using Vim25Api;

 

All fine so far.

 

Now, I want to be able to provide support for a user to be able to connect to vSphere 5.5 as well as vSphere 6.0 environments. I built the stub files for vSphere 6.0 Management SDK and brought those into my solution in a separate project. Each project builds out a different class library and I have each set of stub files for each vSphere version in different NuGet packages. However, when I select to use a vSphere 5.5 connection it seems as though internally the 6.0 stub files are being used, or vice-versa.

 

I tried to separate things out by giving the Vim25Service.dll and Vim25Service.XmlSerializers.dll files for each version different aliases (default alias for all assemblies is "global" but I changed this to vSphere5 and vSphere6 for each version. Then at the top of each class file before any using statements I do:

 

extern alias vSphere5;

 

or

 

extern alias vSphere6

 

(Depending on which project I am in). The using statement for each class file that interacts with vSphere then uses using vSphere5::Vim25Api; or using vSphere6::Vim25Api; to ensure I use the correct namespace/stub files for each version I support.

 

However this still doesn't seem to work, and things seem to be getting muddled up somehow. I'm taking a guess that internally the files are making calls and somehow getting crossed over.

 

Is it possible to use two different vSphere version stub files together in the same project? How should I handle my scenario? I thought about just upgrading everything to use the vSphere 6 version (I can still connect to vCenter 5.5 using these, but some of the properties on objects have changed, (e.g. some dynamic properties on AlarmObjects and other objects have been removed, and code breaks if I remove the references to the vSphere 5.5 stub files. So I would like to keep two different versions and use each one separately in the same solution, so that I support vSphere 5.5 and vSphere 6.

Unable to enforce GPT format using UpdateDiskPartitions

$
0
0


Greetings,


It started when I realized that I cannot create LUN-backed datastore larger than 2 TB using

CreateVmfsDatastore

even though vSphere Client (ESXi 5.1.0) creates it without complaints. No matter what size of datastore I specify, it appears with size 2 TB sitting on MBR partition (original LUN is raw). In attempts to make it working I specified


vmfsDatastoreCreateSpec.partition.partitionFormat = vim.HostDiskPartitionInfoPartitionFormat.gpt
vmfsDatastoreCreateSpec.vmfs.majorVersion = 5




without desired effect. Digging deeper, I thought I can split operations what

CreateVmfsDatastore

performs (presumably) behind the scene:

UpdateDiskPartitions

+

FormatVmfs

, so my call looked like:


devicePath = '/vmfs/devices/disks/naa.600a0980383030364746314b464d6f2f'

diskPartitionSpec = self.storageSystem.RetrieveDiskPartitionInfo(devicePathdevicePath])[0].spec

diskPartitionSpec.partitionFormat = vim.HostDiskPartitionInfoPartitionFormat.gpt

type = vim.HostDiskPartitionInfoType.vmfs

logical = False

attributes = 0

partition = 1

startSector = 2048

endSector = diskPartitionSpec.totalSectors - 2048

partitionAttributes = vim.HostDiskPartitionAttributes(attributes=attributes, endSector=endSector,

logical=logical, partition=partition, startSector=startSector, type=type)

diskPartitionSpec.partition =

self.storageSystem.UpdateDiskPartitions(devicePath=devicePath, spec=diskPartitionSpec)


No effect again, LUN appears as formatted with MBR. Could someone be so kind to shed the light on this magic and direct me how to create GPT partitioning?


Thank you!

Getting the LUN used by a VM in VMFS

$
0
0

Hi,

 

Can we identify which of the several LUNs that constitute a VMFS datastore is/are being used by a VM's Virtual Hard disk?

 

Or does the VMFS hide the details of which LUN is physically behind a VHD?

 

If at all possible to get this info, then which vSphere SDK APIs can give this info?

 

Regards,

Watsh

how to use pyVmomi to track on VMs disk related events

$
0
0


Hi Guys,


       I need to have asynchronous notifications on the changes that take places to a VM's vmdk files. The scope of  changes are like disk resizing, disk deletion etc. I need to use pyVmomi for this and my code will run on the Esx 5.1 host. Can you please tell me if asynchronous notifications are possible or do i need to poll?


Can you please tell me how can this be achieved. I am new to it and learning.


 Thanks.

How to add custom privileges to vCenter server

$
0
0


Hi,

 


We are in process of adding RBAC feature to an existing vCenter Web Client plugin. The plugin has actions and views which we want to protect using RBAC. In this context, we wanted to add our specific privileges to vCenter Server which map to the actions we have in plugin. The goal is to add these privileges programmatically and then use them in privilege definition for a given extension point.

 


I've searched through the API/SDK guide of vCenter server but could not find APIs to add custom privileges. Can someone point me to a direction where I can find some samples for doing the same?

 


Note:

 


1. Using existing VMware privileges is option number 2.

 


2. The plugin is intended to support vCenter server 5.1, 5.5 and 6.0 currently.

 


 


Any help is appreciated.

 


 


Regards

 


Tushar

 


Viewing all 1860 articles
Browse latest View live