We are going to develop the Plug-in for our PCIe SSD under vCenter Web UI.
Our product is PCIe SSD, which is the same as Fusion-IOs IODrive.
We develop the Block and SCSI driver for our PCIe SSD under ESXi 5.1 and
ESXi 5.5
We develop the monitor which called Memmonitor under ESXi 5.1 and ESXi 5.5
shell to monitor the SSDs performance/capacity and so on.
Right now, we want to develop the plug-in to let us can through the
vCenter
UI to monitor the SSDs performance/capacity and so on.
We want through "vmware web service sdk to call memmonitor under ESXi
But we found that the SDK only support esxtop and vscsiStats under
the
ServiceManager support list:
How to add the memmonitor to the support list, thus we can through the
SDK
to call the memmonitor, is the block issue of us while design the
plug-in.
Thanks if you can give some help on this!
Question about Plug-in Development for our PCIe SSD
Using SearchDatastore to find a file.
I have a simple request, I am using VIperl to write my script.
I need to check for a file in a datastore location and then run my if statement. I have been able to use searchdatastore but it returns with a hash , I want just a simple true or false that the file exists or not.
Issues with InitiateFileTransferFromGuest
We recently switched our code from using VIX to using the new web SDK guest services. We have noticed a strange issue with the InitiateFileTransferFromGuest call. It appears that the first time we call InitiateFileTransferFromGuest for a vm the size property of the returned FileTransferInformation object is 0. If we immediately recall InitiateFileTransferFromGuest we get the correct size and data returned on the HTTP GET call. Subsequent calls to the same vm seem ok after this. But this is repeatable on our other vm's.
We verified that the script if copied to the server and the script is ran as we are outputting the results into a file and this is the file being returned. So there is an issue here. these are both windows 2008 and 2003 vms.
Anyone else seen this behavior. We are also using the dotnet c# sdk.
Need help: Using SDK perl for creating a new Datacenter
Hi All,
I'm very new to using Vmware SDK for Perl and I'm stuck with some very basic issues. I'm trying to create a new Datacenter using the below code but its failing and I am not able to debug. Can anyone point out what is the error I'm doing?
#### begin code #####
use strict;
use Getopt::Long;
#VMware Connection libs
use VMware::VIRuntime;
use VMware::VILib;
my $vcname="alpha-vc-10";
my $service_url = "https://".$vcname."/sdk/vimService";
my $vim = Vim->new(service_url => $service_url);
$vim->login(user_name => "username", password => "my_password");
my $view = $vim->find_entity_view(view_type=>'Folder');
my $result = $view->name->CreateDatacenter("New_DataCenter");
# Disconnect from the server
Util::disconnect();
#### end code ####
My error is: Failed executing command. Exception: Can't load class 'Datacenters' at C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\lib/VMware/VIMRuntime.pm line 52.
I'm using SDK reference manual : https://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/index-methods.html
Thanks.
Alarm statuses
Hi everyone,
I'm trying to create an application that notifies me whenever a vCenter alarm gets triggered however I keep getting a gray value for the OverallStatus field of the AlarmState object for that particular alarm. I see 4 triggered alarms in the vSphere Management Console but the API reports all alarms as not triggered.
This is my C# code:
List < Alarm > list = new List < Alarm > ();
ManagedObjectReference mgr = serviceContent.alarmManager;
AlarmState[] alarmStates = null;
foreach(ManagedObjectReference reference in alarmReferences) {
AlarmInfo info = (AlarmInfo) GetPropertiesAsync(reference, new[] {
"info"
})[0];
if (info == null) continue;
if (alarmStates == null) {
var asyncResult = service.BeginGetAlarmState(mgr, info.entity, null, null);
asyncResult.AsyncWaitHandle.WaitOne();
alarmStates = service.EndGetAlarmState(asyncResult);
}
AlarmState state = LookupAlarmState(info.alarm, alarmStates);
if (state == null) {
var asyncResult = service.BeginGetAlarmState(mgr, info.entity, null, null);
asyncResult.AsyncWaitHandle.WaitOne();
AlarmState[] newStates = service.EndGetAlarmState(asyncResult);
if (newStates != null && newStates.Length > 0) {
alarmStates = alarmStates.Concat(newStates).Distinct().ToArray();
state = LookupAlarmState(info.alarm, alarmStates, true);
}
if (state == null) continue; // we don't add alarms that don't have states
}
Alarm alarm = new Alarm(info.alarm.Value, info.name, info.alarm, info, state, info.description, info.enabled);
if (filterFunc(alarm)) list.Add(alarm);
}
return list;
private static AlarmState LookupAlarmState(ManagedObjectReference alarmMor, IEnumerable < AlarmState > alarmStates, bool reverse = false) {
if (alarmStates == null || alarmMor == null) return null;
if (reverse) alarmStates = alarmStates.Reverse();
return alarmStates.Where(state = > state != null).FirstOrDefault(state = > state.alarm.Value == alarmMor.Value);
}
Also I've tried to get the Alarm via PowerCLI:
Get-VMHost | Select-Object TriggeredAlarmState
And again no alarms were returned. What am I doing wrong?
Thank You,
Paul
OVA import using importVapp fails for ISO files
I am using Java SDK to import OVA from local file system. I followed the sample code in vapp/OVFManagerImportLocalVApp.java
That works fine for VMDK images. Unfortunately my OVA also contains an ISO image (mapped to DVD drive). Upload of that file fails. It uploads 42k and then gets a server error. Neither PUT nor POST nor different content-types seem to make a difference.
Are there any examples or tricks to upload ISO files?
Thanks, Patrick
Get virtual disk IO operation offset and translate it to pysical storage offset.
Hello,
I have 2 problems that i couldn't solve yet.
1) How can I get the VM virtual disk offsets of IO operations? For example, I need to get all IO virtual disk offets from last 20 seconds.
2) If I will get the 'virtual' offset from VM, then how can I translate it to physical devices offsets? For example I have a IO operation on virtual disk, so I need to know that a the real offsets on physical devieces that attached to ESXi server (iSCSI).
Is where any possibility to retrieve this information via CLI or SDK sets? I have reserched capabilities of vSphere Management SDK, but it seems that this SDK couldn't help me in this issue.
Is enyone could help me in my question/problem?
Thanks
List of Standard switch portgroups in a ESXi (or) VC
Hi,
Is there a way to get the list of all standard switch port groups that are created in a ESXi server / VC..? I could get the list for DVS, but for standard switch I couldn't find the exact way or API..? Can anybody help..?
vSphere6.0 login issue: javax.xml.ws.soap.SOAPFaultException: The session is not authenticated.
In our plugin, we need to retrieve the extension information from ExtensionManager. We use the following code to do that.
private static void setContext(VCenterInfo vcenter) { Map<String, Object> ctxt = ((BindingProvider) vimPortType).getRequestContext(); ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, vcenter.getServiceUrl()); ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true); String vmwareSoapSession = "vmware_soap_session=\"" + vcenter.getSession() + "\""; @SuppressWarnings("unchecked") Map<String, List<String>> headers = (Map<String, List<String>>) ctxt.get(MessageContext.HTTP_REQUEST_HEADERS); if (headers == null) { headers = Maps.newHashMap(); } headers.put(COOKIE, Collections.singletonList(vmwareSoapSession)); ctxt.put(MessageContext.HTTP_REQUEST_HEADERS, headers); } private static Extension getExtension(VCenterInfo vcenter) throws RuntimeFaultFaultMsg { setContext(vcenter); ServiceContent sc = getServiceContent(); ManagedObjectReference extensionManager = sc.getExtensionManager(); return vimPortType.findExtension(extensionManager, KEY); }
vCenterInfo = VCenterInfo [name=10.18.236.231, vcenterUuid=fb1e5cdf-9b34-405d-946f-bcd450139a7d, serviceUrl=https://10.18.236.231:443/sdk, session="77b4562fbca17ce1bc27f8371c5ed737316ca77e", thumbprint=05:80:1B:A7:D0:05:DF:A1:F0:1D:E2:66:FA:66:4C:26:61:A9:65:33, version=6.0.0]
This code works perfectly in vSphere 5.5
Recently, we started to test vSphere 6.0 and keep running into this exception.
Caused by: javax.xml.ws.soap.SOAPFaultException: The session is not authenticated. at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178) at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:125) at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108) at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78) at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135) at com.sun.proxy.$Proxy499.findExtension(Unknown Source) at com.<companyname>.service.vcenter.VCenterService.getExtension(VCenterService.java:149)
The exception is thrown on the return vimPortType.findExtension(extensionManager, KEY); line.
If we run the same code using the exact same URL and session ID from a separate project (simple java program), we see no issues and get the correct information. All our other software modules that have similar code run just fine. We have also checked every log file we could find but could not find any information about a session being invalid or not authenticated.
Programmatically discover Web Client (server) location from vCenter?
Hi- is there a way, using the vSphere Management SDK (or otherwise) for a particular vCenter to discover the location - IP address/hostname of the vSphere Web Client server or servers which are currently being used to access that vCenter, which may not be co-located with vCenter.
How to revert to an older version of an extension in a production environment
If I register an extension with vCenter with version number 0.0.1 and then later upgrade it to 0.0.2, How can I revert back to the older version (0.0.1)? I ask this as we may sometimes we need to move back to an older version. I noticed that even after removing the extension completely from ExtensionManager, Virgo does not delete the downloaded plugin package from vc-packages folder. Upon registering the older version again, Virgo downloads the older package but uses the newer version. I see the following logs
[2015-01-13 19:07:57.716] [INFO ] vc-service-pool-342 com.vmware.vise.vim.extension.VcExtensionManager Downloading plugin package from https://10.12.60.241/plugin/<companyname>.zip (no proxy defined) [2015-01-13 19:07:58.702] [INFO ] vc-service-pool-342 com.vmware.vise.vim.extension.VcExtensionManager Done downloading plugin package from https://10.12.60.241/plugin/<companyname>.zip [2015-01-13 19:07:59.063] [INFO ] vc-service-pool-342 com.vmware.vise.vim.extension.VcExtensionManager Done expanding plugin package to C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity\com.<companyname>-0.0.189015 [2015-01-13 19:07:59.081] [INFO ] vc-service-pool-342 com.vmware.vise.extensionfw.ExtensionManager Use the plugin package com.<companyname>:0.0.189107 instead of the older com.<companyname>:0.0.189015 [2015-01-13 19:07:59.081] [INFO ] vc-service-pool-342 com.vmware.vise.extensionfw.ExtensionManager Plugin package com.<companyname>:0.0.189107 is already added in ExtensionManager, skip.
The only way I see it happening is that we delete all packages from the vc-packages folder and restart the virgo server. Is there an alternative way?
Thanks,
Virat
Is it possible to use vSphere scheduled task to call my own script in vSphere web client
I have written a script which can be called using command line, and i want it can be called when triggering vSphere scheduled task.
The API to create scheduled task is "createScheduledTask" method of ScheduledTaskManager object, but i don't know which action i can use to call my own script, "MethodAction" seems impossible, how is the "RunScriptAction"? Can anyone help me?
thank you very very much.
Getting "Session not authenticated" while calling createUser function
Hi,
We get successfully connected and authenticated to VMware ESXi machine using the webservices.
But when we try to do some more operations like 'createUser()' it gives us error saying "Session is not authenticated".
Currently the SESSION_MAINTAIN_PROPERTY is set to false in our code.
If we set this to true then we get an error saying "Maintain Session is enabled but none of the session properties(cookies, Over-Written URL) are returned. Also in this case connection is not established so we set it to false.
Can somebody help us here?
Changing network settings of guest-OS using vSphere API
Hello,
My question is regarding the VSphere 5.5 API:
I would like to change the network settings (IP, net-mask, dns etc.) of an OS (Linux & Windows) installed on a VM.
It seems that the correct way to do it is to use the CustomizeVM_Task API. It receives a parameter named CustomizationSpec, where I can fill CustomizationGlobalIPSettings and CustomizationAdapterMapping[] – just what I need.
However, it also requires that I fill the CustomizationIdentitySettings parameter. Not filling it or putting an empty string doesn’t work (the API throws an exception with the following message: “VI SDK invoke exception:com.vmware.vim25.InvalidRequest”).
Can this API be used to change the network settings only (I need this to work on both Windows and Linux machines)? Or do I need to use a different API for that task?
OS of the VM I tried to change the network settings of: Windows Server 2008 R2 Standard 64-bit.
The VM has the latest version of VMTools installed.
Your help will be greatly appreciated.
Slavik
Example code for adding to Recent Tasks
I would like to track action progress using the Recent Tasks view. I can't seem to find any sample code to help. I saw some other threads that suggested looking at the WSSDK, but I didn't find anything there either.
I see there are objects such as TaskManager and TaskInfo, but I can't figure out how to createTask properly. Also, it looks like I would need to register my custom task, and I don't know how to do that either.
Suggestions?
-E
com.vmware.vim25.DvsPortConnectedEvent - howcan i retrive theDistributed virtual portgroup name and UUID from this event
We need to listen to this event,based on the name and port we need to retrieve the info from our db.Please suggest appropriate methods
Automatically distinguish between RDM Vmdk and vmdk file.
Hello all,
I am working on an application that customise a virtual machine. So far I was using only RDMs, which as you probably know are pointers to physical disks. However, for the RDMs, I am using raw backing structure like this one: VirtualDiskRawDiskMappingVer1BackingInfo. I know that for vmdks that are not rdms, I can use VirtualDiskFlatVer2BackingInfo.
So my question is how to distinguish between the two types is there any easy way like a struct or something else that could clearly specify that this is RDM and this is simple VMDK?
Deeply Grateful,
Stefan
how the file delete is handled for thick and thin disks ?
Hello Experts,
Does it create the hole or zero-out when the file is deleted for thick or thin disks ?
does CBT recognize this hole and doesn't give these blocks ?
Thanks, Balu
how to identify thick and thin disks ?
Hi,
Using vSphere APIs, is there a way to identify disk type (thick and thin) ?
Thanks, Balu
examlple of using CloneVM_Task() in .NET
Hello,
Can anyone provide me a well-written, working example of c# code that uses the CloneVM_Task method? I find VMWare samples that came with the SDK complicated, hard to understand and modify for my needs. There is no comments or good description how to invoke it!