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

"A WebService annotation is not present on class: com.vmware.vim25.VimPortType" error with vim25.jar from vSphere 6.5 HTML SDK

$
0
0

Hi,

We have a vSphere HTML SDK plugin developed using vSphere 6.5 SDK. One of the dependencies for our plugin is vim25.jar (from the libs folder of vSphere 6.5 HTML SDK).

Our plugin gets loaded successfully on the vSphere Client. However, when we click on the plugin and when our main page loading occurs we hit an exception (as below). Since the call is failing inside vim25.jar, I was suggested to ask this in this forum than vSphere SDK forum.

The very first call to getVimPort is failing. Could you please let us know if you have any suggestions to fix this or if you need any further info?

 

com.sun.xml.internal.ws.model.RuntimeModelerException: A WebService annotation is not present on class: com.vmware.vim25.VimPortType
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:254)
at com.sun.xml.internal.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:85)
at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59)
at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:43)
at com.sun.xml.internal.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:105)
at com.sun.xml.internal.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:875)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:892)
at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:855)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:435)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:404)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:386)
at javax.xml.ws.Service.getPort(Service.java:119)
at com.vmware.vim25.VimService.getVimPort(Unknown Source)
at com.mycompany.vsphere.ObjectStoreManager.getVimPort(ObjectStoreManager.java:82)

 

Regards,
Sunil


How to wait a task after cloning VM with VMWare.vim.dll ?

$
0
0

Hello everybody,

 

I work on a web interface which manage virtual machines on vsphere Esx 5.5. My interface is based on .net web forms (not MVC)

I followed jeffpaton posts (using VMware.Vim  ) which helped me (Thanks to you, Jeff).

 

But now i freeze on this subject. I do not know how to wait a task after cloning VM. I develop a little web page which launch vsphere command to my vsphere Esc with vmware.vim. I need to know when vpshere is finished his work to launch an another instruction.

 

I try to use PropertyCollector but i do not know how to use it :

i read this post but without success :

Synchronous versus Asynchronous Calls in vSphere API | DoubleCloud => Private Cloud + Public Cloud

What is the best way to wait for a Task in a concurrent environment?

 

Here is my code. i use jeffpaton functions.

 

...

using VMware.Vim;

...

VimClient client;

string serverUrl = "..."

client.Connect("https://" + serverUrl + "/sdk");

client.Login(userLogin, userPassword);

 

...

 

ManagedObjectReference cloneTask_MoRef = null;

cloneTask_MoRef = sourceVm.cloneVM_Task(sourceVm.Parent, "cloneName", mySpec);

if (cloneTask_MoRef == null) {

     //error

}else

     {

          PropertyCollector pc = new PropertyCollector(client, cloneTask_MoRef);

          //1 PropertyFilterSpec [] pfs;

          //ObjectSpec

          ObjectSpec objectSpec = new ObjectSpec();

                          

          //PropertySpec

          //What could i do to know if the task is over or in progress ? :-(

 

I need some help.

 

Thanks for all.                                                          

How to get IP address of vCenter Server?

$
0
0

I want to get IP address of vCenter Server from my plugin. But from vimObjectReferenceService, I only can get host name of vCenter Server (something like vc01.example.local). Is there anyway to get IP address of vCenter Server? Thank you!

lock vsepehe

$
0
0

Hello

we used vcenter server lock it

We removed it vcenter

but not unlock server on vcenter

now we can not login to vSphere it massage locked

please help me

Can i upload a file in DataStoreBrower with vSphere Web Service Api For Java?

VSphere Java SDK: How to get the time when Virtual Machine was powered off

$
0
0

VSphere Java SDK: How to get the time when Virtual Machine was powered off

 

For getting Powered on Time, I am using

 

vm.getRuntime().getBootTime().getTime();

 

Problem is as per VM docs bootTime property is erased when Machine State changes from Powered on to off.

 

I tried using recent tasks but vm.getRecentTasks() is not returning any thing.

 

VM here means Virtual Machine Object

How to get VirtualMachine moid

$
0
0

I just started working with the MOB and learning about MOID's. I was hoping to get the VirtualMachine MOID. We have ESXi hosts with free license. Any way to get this? I just want to execute VirtualMachine.Interact.PowerOn and .Suspend.

 

Example:

https://balvmware1/mob/?moid=VirtualMachine

 

Any ideas? Or is this justs available via vcenterserver?

Get specific folder when there are multiple folders with the same name

$
0
0

Hi.

 

I'm trying to resolve a similar issue as described here:

Folder by Path - LucD notes

 

However, I'm trying to use the vSphere API to resolve the issue.

 

Trying to run the following code will display "Not found" when it's trying to find "UniqueFolderName" because FindEntityView will select the "wrong" "CommonFolderName" folder through the the first iteration of the loop.

 

In my environment, there's a "CommonFolderName" at the root Ievel and then another "CommonFolderName" that exists in a different folder at the second-level. l expected FindEntityView to select the "CommonFolderName" at the root level but it's actually selecting the one at the other level.

 

void Main()
{    VimClient client = new VimClient();    client.Login("https://vcenter/sdk/vimService", "username", "password");    string hierarchyPath = "CommonFolderName/UniqueFolderName";    Folder folder = GetFolder(client, null, hierarchyPath);    if (folder == null)    {        Console.WriteLine("Not found");    }    else    {        Console.WriteLine("Found");    }
}



private Folder GetFolder(VimClient client, ManagedObjectReference parent, string hierarchyPath)
{
    Folder folder = null;    string[] parts = new string[] { null };    if (hierarchyPath != null)    {        parts = hierarchyPath.Split(new[] { '/', '\\' });    }    foreach (string part in parts)    {        NameValueCollection folderFilter = null;        if (part != null)        {           folderFilter = new NameValueCollection { { "name", part } };        }        Folder folderPart = (Folder)client.FindEntityView(typeof(Folder), parent, folderFilter, null);        if (folderPart == null)        {            // failed to find folder            return null;        }        folder = folderPart;        parent = folderPart.MoRef;    }    return folder;
}

 

Any ideas?

 

Thank you.


Map vSphere API privileges to vSphere Web Client UI

$
0
0

Developers who work with the vSphere API (usually in Java or C#) ask how they can map privileges in the API to privilege strings in the vSphere Client. In the table below, up-arrows represent indentation for the privilege hierarchy in the UI. Last updated for vSphere 6.5.

 

Privilege in vSphere APILabel in vSphere Client UI
Alarm"Alarms"
Alarm.Acknowledge^ "Acknowledge alarm"
Alarm.Create^ "Create alarm"
Alarm.Delete^ "Remove alarm"
Alarm.DisableActions^ "Disable alarm action"
Alarm.Edit^ "Modify alarm"
Alarm.SetStatus^ "Set alarm status"
Authorization"Permissions"
Authorization.ModifyPermissions^ "Modify permission"
Authorization.ModifyPrivileges^ "Modify privilege"
Authorization.ModifyRoles^ "Modify role"
Authorization.ReassignRolePermissions^ "Reassign role permissions"
Certificate"Certificates"
Certificate.Manage^ "Manage certificates"
ComputeResource"Compute resource"
Cryptographer"Cryptographic operations"
Cryptographer.Access^ "Direct Access"
Cryptographer.AddDisk^ "Add disk"
Cryptographer.Clone^ "Clone"
Cryptographer.Decrypt^ "Decrypt"
Cryptographer.Encrypt^ "Encrypt"
Cryptographer.EncryptNew^ "Encrypt new"
Cryptographer.ManageEncryptionPolicy^ "Manage encryption policies"
Cryptographer.ManageKeyServers^ "Manage KMS"
Cryptographer.ManageKeys^ "Manage keys"
Cryptographer.Migrate^ "Migrate"
Cryptographer.Recrypt^ "Recrypt"
Cryptographer.RegisterHost^ "Register host"
Cryptographer.RegisterVM^ "Register VM"
DVPortgroup"dvPort group"
DVPortgroup.Create^ "Create"
DVPortgroup.Delete^ "Delete"
DVPortgroup.Modify^ "Modify"
DVPortgroup.PolicyOp^ "Policy operation"
DVPortgroup.ScopeOp^ "Scope operation"
DVSwitch"Distributed switch"
DVSwitch.Create^ "Create"
DVSwitch.Delete^ "Delete"
DVSwitch.HostOp^ "Host operation"
DVSwitch.Modify^ "Modify"
DVSwitch.Move^ "Move"
DVSwitch.PolicyOp^ "Policy operation"
DVSwitch.PortConfig^ "Port configuration operation"
DVSwitch.PortSetting^ "Port setting operation"
DVSwitch.ResourceManagement^ "Network I/O control operation"
DVSwitch.Vspan^ "VSPAN operation"
Datacenter"Datacenter"
Datacenter.Create^ "Create datacenter"
Datacenter.Delete^ "Remove datacenter"
Datacenter.IpPoolConfig^ "Network protocol profile configuration"
Datacenter.IpPoolQueryAllocations^ "Query IP pool allocation"
Datacenter.IpPoolReleaseIp^ "Release IP allocation"
Datacenter.Move^ "Move datacenter"
Datacenter.Reconfigure^ "Reconfigure datacenter"
Datacenter.Rename^ "Rename datacenter"
Datastore"Datastore"
Datastore.AllocateSpace^ "Allocate space"
Datastore.Browse^ "Browse datastore"
Datastore.Config^ "Configure datastore"
Datastore.Delete^ "Remove datastore"
Datastore.DeleteFile^ "Remove file"
Datastore.FileManagement^ "Low level file operations"
Datastore.Move^ "Move datastore"
Datastore.Rename^ "Rename datastore"
Datastore.UpdateVirtualMachineFiles^ "Update virtual machine files"
Datastore.UpdateVirtualMachineMetadata^ "Update virtual machine metadata"
EAM"ESX Agent Manager"
EAM.Config^ "Config"
EAM.Modify^ "Modify"
EAM.View^ "View"
Extension"Extension"
Extension.Register^ "Register extension"
Extension.Unregister^ "Unregister extension"
Extension.Update^ "Update extension"
ExternalStatsProvider"External stats provider"
ExternalStatsProvider.Register^ "Register"
ExternalStatsProvider.Unregister^ "Unregister"
ExternalStatsProvider.Update^ "Update"
Folder"Folder"
Folder.Create^ "Create folder"
Folder.Delete^ "Delete folder"
Folder.Move^ "Move folder"
Folder.Rename^ "Rename folder"
Global"Global"
Global.CancelTask^ "Cancel task"
Global.CapacityPlanning^ "Capacity planning"
Global.Diagnostics^ "Diagnostics"
Global.DisableMethods^ "Disable methods"
Global.EnableMethods^ "Enable methods"
Global.GlobalTag^ "Global tag"
Global.Health^ "Health"
Global.Licenses^ "Licenses"
Global.LogEvent^ "Log event"
Global.ManageCustomFields^ "Manage custom attributes"
Global.ManagePolicies^ "Manage policies"
Global.PolicyEditorSuperUser^ "Policy editor SuperUser"
Global.Proxy^ "Proxy"
Global.ScriptAction^ "Script action"
Global.ServiceManagers^ "Service managers"
Global.SetCustomField^ "Set custom attribute"
Global.Settings^ "Settings"
Global.SystemTag^ "System tag"
Global.VCServer^ "Act as vCenter Server"
HealthUpdateProvider"Health update provider"
HealthUpdateProvider.Register^ "Register"
HealthUpdateProvider.Unregister^ "Unregister"
HealthUpdateProvider.Update^ "Update"
Host"Host"
Host.Amqp^ "AMQP"
Host.Amqp.AmqpInteraction^ ^ "AMQP interaction"
Host.Cim^ "CIM"
Host.Cim.CimInteraction^ ^ "CIM interaction"
Host.Config^ "Configuration"
Host.Config.AdvancedConfig^ ^ "Advanced settings"
Host.Config.AuthenticationStore^ ^ "Authentication Store"
Host.Config.AutoStart^ ^ "Virtual machine autostart configuration"
Host.Config.Connection^ ^ "Connection"
Host.Config.DateTime^ ^ "Change date and time settings"
Host.Config.Firmware^ ^ "Firmware"
Host.Config.HyperThreading^ ^ "Hyperthreading"
Host.Config.Image^ ^ "Image configuration"
Host.Config.Locker^ ^ "Locker"
Host.Config.Maintenance^ ^ "Maintenance"
Host.Config.Memory^ ^ "Memory configuration"
Host.Config.NetService^ ^ "Security profile and firewall"
Host.Config.Network^ ^ "Network configuration"
Host.Config.Nvdimm^ ^ "NVDIMM"
Host.Config.Patch^ ^ "Query patch"
Host.Config.PciPassthru^ ^ "Change PciPassthru settings"
Host.Config.Power^ ^ "Power"
Host.Config.Quarantine^ ^ "Quarantine"
Host.Config.Resources^ ^ "System resources"
Host.Config.Settings^ ^ "Change settings"
Host.Config.Snmp^ ^ "Change SNMP settings"
Host.Config.Storage^ ^ "Storage partition configuration"
Host.Config.SystemManagement^ ^ "System Management"
Host.Hbr^ "vSphere Replication"
Host.Hbr.HbrManagement^ ^ "Manage replication"
Host.Inventory^ "Inventory"
Host.Inventory.AddHostToCluster^ ^ "Add host to cluster"
Host.Inventory.AddStandaloneHost^ ^ "Add standalone host"
Host.Inventory.CreateCluster^ ^ "Create cluster"
Host.Inventory.DeleteCluster^ ^ "Remove cluster"
Host.Inventory.EditCluster^ ^ "Modify cluster"
Host.Inventory.MoveCluster^ ^ "Move cluster or standalone host"
Host.Inventory.MoveHost^ ^ "Move host"
Host.Inventory.RemoveHostFromCluster^ ^ "Remove host"
Host.Inventory.RenameCluster^ ^ "Rename cluster"
Host.Local^ "Local operations"
Host.Local.CreateVM^ ^ "Create virtual machine"
Host.Local.DeleteVM^ ^ "Delete virtual machine"
Host.Local.InstallAgent^ ^ "Add host to vCenter"
Host.Local.ManageUserGroups^ ^ "Manage user groups"
Host.Local.ReconfigVM^ ^ "Reconfigure virtual machine"
ImageLibrary"Image library"
ImageLibrary.Manage^ "Manage"
Network"Network"
Network.Assign^ "Assign network"
Network.Config^ "Configure"
Network.Delete^ "Remove"
Network.Move^ "Move network"
Performance"Performance"
Performance.ModifyIntervals^ "Modify intervals"
Policy"Policy"
Policy.Apply^ "Apply"
Profile"Host profile"
Profile.Clear^ "Clear"
Profile.Create^ "Create"
Profile.Delete^ "Delete"
Profile.Edit^ "Edit"
Profile.Export^ "Export"
Profile.View^ "View"
Resource"Resource"
Resource.ApplyRecommendation^ "Apply recommendation"
Resource.AssignVAppToPool^ "Assign vApp to resource pool"
Resource.AssignVMToPool^ "Assign virtual machine to resource pool"
Resource.ColdMigrate^ "Migrate powered off virtual machine"
Resource.CreatePool^ "Create resource pool"
Resource.DeletePool^ "Remove resource pool"
Resource.EditPool^ "Modify resource pool"
Resource.HotMigrate^ "Migrate powered on virtual machine"
Resource.MovePool^ "Move resource pool"
Resource.QueryVMotion^ "Query vMotion"
Resource.RenamePool^ "Rename resource pool"
ScheduledTask"Scheduled task"
ScheduledTask.Cancel^ "Cancel task"
ScheduledTask.Create^ "Create tasks"
ScheduledTask.Delete^ "Remove task"
ScheduledTask.Edit^ "Modify task"
ScheduledTask.Run^ "Run task"
Sessions"Sessions"
Sessions.GlobalMessage^ "Message"
Sessions.ImpersonateUser^ "Impersonate user"
Sessions.TerminateSession^ "View and stop sessions"
Sessions.ValidateSession^ "Validate session"
StoragePod"Datastore cluster"
StoragePod.Config^ "Configure a datastore cluster"
StorageProfile"Profile-driven storage"
StorageProfile.Update^ "Profile-driven storage update"
StorageProfile.View^ "Profile-driven storage view"
StorageViews"Storage views"
StorageViews.ConfigureService^ "Configure service"
StorageViews.View^ "View"
System"System"
System.Anonymous^ "Anonymous"
System.Read^ "Read"
System.View^ "View"
Task"Tasks"
Task.Create^ "Create task"
Task.Update^ "Update task"
TroubleShooting"Troubleshooting"
TroubleShooting.all^ "All"
VApp"vApp"
VApp.ApplicationConfig^ "vApp application configuration"
VApp.AssignResourcePool^ "Assign resource pool"
VApp.AssignVApp^ "Assign vApp"
VApp.AssignVM^ "Add virtual machine"
VApp.Clone^ "Clone"
VApp.Create^ "Create"
VApp.Delete^ "Delete"
VApp.Export^ "Export"
VApp.ExtractOvfEnvironment^ "View OVF environment"
VApp.Import^ "Import"
VApp.InstanceConfig^ "vApp instance configuration"
VApp.ManagedByConfig^ "vApp managedBy configuration"
VApp.Move^ "Move"
VApp.PowerOff^ "Power off"
VApp.PowerOn^ "Power on"
VApp.Rename^ "Rename"
VApp.ResourceConfig^ "vApp resource configuration"
VApp.Suspend^ "Suspend"
VApp.Unregister^ "Unregister"
VirtualMachine"Virtual machine"
VirtualMachine.Config^ "Configuration"
VirtualMachine.Config.AddExistingDisk^ ^ "Add existing disk"
VirtualMachine.Config.AddNewDisk^ ^ "Add new disk"
VirtualMachine.Config.AddRemoveDevice^ ^ "Add or remove device"
VirtualMachine.Config.AddRemoveRawDevice^ ^ "Add/remove raw device"
VirtualMachine.Config.AdvancedConfig^ ^ "Advanced"
VirtualMachine.Config.Annotation^ ^ "Set annotation"
VirtualMachine.Config.CPUCount^ ^ "Change CPU count"
VirtualMachine.Config.ChangeTracking^ ^ "Disk change tracking"
VirtualMachine.Config.DiskExtend^ ^ "Extend virtual disk"
VirtualMachine.Config.DiskLease^ ^ "Disk lease"
VirtualMachine.Config.EditDevice^ ^ "Modify device settings"
VirtualMachine.Config.HostUSBDevice^ ^ "Host USB device"
VirtualMachine.Config.ManagedBy^ ^ "Configure managedBy"
VirtualMachine.Config.Memory^ ^ "Memory"
VirtualMachine.Config.MksControl^ ^ "Display connection settings"
VirtualMachine.Config.QueryFTCompatibility^ ^ "Query Fault Tolerance compatibility"
VirtualMachine.Config.QueryUnownedFiles^ ^ "Query unowned files"
VirtualMachine.Config.RawDevice^ ^ "Raw device"
VirtualMachine.Config.ReloadFromPath^ ^ "Reload from path"
VirtualMachine.Config.RemoveDisk^ ^ "Remove disk"
VirtualMachine.Config.Rename^ ^ "Rename"
VirtualMachine.Config.ResetGuestInfo^ ^ "Reset guest information"
VirtualMachine.Config.Resource^ ^ "Change resource"
VirtualMachine.Config.Settings^ ^ "Settings"
VirtualMachine.Config.SwapPlacement^ ^ "Swapfile placement"
VirtualMachine.Config.UpgradeVirtualHardware^ ^ "Upgrade virtual machine compatibility"
VirtualMachine.GuestOperations^ "Guest operations"
VirtualMachine.GuestOperations.Execute^ ^ "Guest operation program execution"
VirtualMachine.GuestOperations.Modify^ ^ "Guest operation modifications"
VirtualMachine.GuestOperations.ModifyAliases^ ^ "Guest operation alias modification"
VirtualMachine.GuestOperations.Query^ ^ "Guest operation queries"
VirtualMachine.GuestOperations.QueryAliases^ ^ "Guest operation alias query"
VirtualMachine.Hbr^ "vSphere Replication"
VirtualMachine.Hbr.ConfigureReplication^ ^ "Configure replication"
VirtualMachine.Hbr.MonitorReplication^ ^ "Monitor replication"
VirtualMachine.Hbr.ReplicaManagement^ ^ "Manage replication"
VirtualMachine.Interact^ "Interaction"
VirtualMachine.Interact.AnswerQuestion^ ^ "Answer question"
VirtualMachine.Interact.Backup^ ^ "Backup operation on virtual machine"
VirtualMachine.Interact.ConsoleInteract^ ^ "Console interaction"
VirtualMachine.Interact.CreateScreenshot^ ^ "Create screenshot"
VirtualMachine.Interact.CreateSecondary^ ^ "Turn on Fault Tolerance"
VirtualMachine.Interact.DefragmentAllDisks^ ^ "Defragment all disks"
VirtualMachine.Interact.DeviceConnection^ ^ "Device connection"
VirtualMachine.Interact.DisableSecondary^ ^ "Suspend Fault Tolerance"
VirtualMachine.Interact.DnD^ ^ "Drag and drop"
VirtualMachine.Interact.EnableSecondary^ ^ "Resume Fault Tolerance"
VirtualMachine.Interact.GuestControl^ ^ "Guest operating system management by VIX API"
VirtualMachine.Interact.MakePrimary^ ^ "Test failover"
VirtualMachine.Interact.Pause^ ^ "Pause or Unpause"
VirtualMachine.Interact.PowerOff^ ^ "Power off"
VirtualMachine.Interact.PowerOn^ ^ "Power on"
VirtualMachine.Interact.PutUsbScanCodes^ ^ "Inject USB HID scan codes"
VirtualMachine.Interact.Record^ ^ "Record session on virtual machine"
VirtualMachine.Interact.Replay^ ^ "Replay session on virtual machine"
VirtualMachine.Interact.Reset^ ^ "Reset"
VirtualMachine.Interact.SESparseMaintenance^ ^ "Perform wipe or shrink operations"
VirtualMachine.Interact.SetCDMedia^ ^ "Configure CD media"
VirtualMachine.Interact.SetFloppyMedia^ ^ "Configure floppy media"
VirtualMachine.Interact.Suspend^ ^ "Suspend"
VirtualMachine.Interact.TerminateFaultTolerantVM^ ^ "Test restart Secondary VM"
VirtualMachine.Interact.ToolsInstall^ ^ "VMware Tools install"
VirtualMachine.Interact.TurnOffFaultTolerance^ ^ "Turn off Fault Tolerance"
VirtualMachine.Inventory^ "Inventory"
VirtualMachine.Inventory.Create^ ^ "Create new"
VirtualMachine.Inventory.CreateFromExisting^ ^ "Create from existing"
VirtualMachine.Inventory.Delete^ ^ "Remove"
VirtualMachine.Inventory.Move^ ^ "Move"
VirtualMachine.Inventory.Register^ ^ "Register"
VirtualMachine.Inventory.Unregister^ ^ "Unregister"
VirtualMachine.Namespace^ "Service configuration"
VirtualMachine.Namespace.Event^ ^ "Allow notifications"
VirtualMachine.Namespace.EventNotify^ ^ "Allow polling of global event notifications"
VirtualMachine.Namespace.Management^ ^ "Manage service configurations"
VirtualMachine.Namespace.ModifyContent^ ^ "Modify service configuration"
VirtualMachine.Namespace.Query^ ^ "Query service configurations"
VirtualMachine.Namespace.ReadContent^ ^ "Read service configuration"
VirtualMachine.Provisioning^ "Provisioning"
VirtualMachine.Provisioning.Clone^ ^ "Clone virtual machine"
VirtualMachine.Provisioning.CloneTemplate^ ^ "Clone template"
VirtualMachine.Provisioning.ConsolidateDisks^ ^ "Consolidate disks"
VirtualMachine.Provisioning.CreateTemplateFromVM^ ^ "Create template from virtual machine"
VirtualMachine.Provisioning.Customize^ ^ "Customize"
VirtualMachine.Provisioning.DeployTemplate^ ^ "Deploy template"
VirtualMachine.Provisioning.DiskRandomAccess^ ^ "Allow disk access"
VirtualMachine.Provisioning.DiskRandomRead^ ^ "Allow read-only disk access"
VirtualMachine.Provisioning.FileRandomAccess^ ^ "Allow file access"
VirtualMachine.Provisioning.GetVmFiles^ ^ "Allow virtual machine download"
VirtualMachine.Provisioning.MarkAsTemplate^ ^ "Mark as template"
VirtualMachine.Provisioning.MarkAsVM^ ^ "Mark as virtual machine"
VirtualMachine.Provisioning.ModifyCustSpecs^ ^ "Modify customization specification"
VirtualMachine.Provisioning.PromoteDisks^ ^ "Promote disks"
VirtualMachine.Provisioning.PutVmFiles^ ^ "Allow virtual machine files upload"
VirtualMachine.Provisioning.ReadCustSpecs^ ^ "Read customization specifications"
VirtualMachine.State^ "Snapshot management"
VirtualMachine.State.CreateSnapshot^ ^ "Create snapshot"
VirtualMachine.State.RemoveSnapshot^ ^ "Remove snapshot"
VirtualMachine.State.RenameSnapshot^ ^ "Rename snapshot"
VirtualMachine.State.RevertToSnapshot^ ^ "Revert to snapshot"

How to create a VI 2.5 client plugin

$
0
0

This is not a replacement for the white paper I am writing that describes VI client plugin development. Consider this a "BSG: Razor" tactic. Yes, the real product is coming, this is just to tide you over

 

To create a VI client plugin you just need to build a .NET library assembly (as opposed to an EXE). Your assembly should reference the following VMware assemblies (by default found in "C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\2.5\")

 

- TransportInterfaces.25.dll

- VimSoapService.25.dll

- VimSoapService.25.XmlSerializers.dll

- *VIPlugins.dll

- VirtualInfrastructure.25.dll

- VpxClient.SSPI.dll

 

VIPlugins.dll is the only assembly required, but the plugin you are creating would be pretty bland if you did not reference the rest of the above assemblies.

 

Your assembly should have at least one class that implements the following interface defined in VIPlugins.dll: VMware.VIClient.Plugins.Plugin. Implementing that interface requires your class to implement the following methods:

 

- void Load( VMware.VIClient.Plugins.VIApp viApp )

- void Unload()

 

You could go ahead and compile your assembly, place it and its dependencies in a directory under (by default) "C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Plugins\" and it will show up in the VI client plugin manager.

 

You may be asking yourself, is that it? Hardly. However, the rest of the explanation is at this time best left to code comments. Please visit http://www.lostcreations.com/code/browser/trunk/vmware/viplugins/SVMotion/SVMotion/SVMotionPlugin.cs to see a syntax-colored view of the SVMotion plugin. The code is thoroughly documented and should tell you everything you need to know to write a basic VI client plugin.

 

Hope this helps!

 

Update


I stupidly let lostcreations.com expire, and someone is now squatting on it for $2500. I don't have that money to buy a domain back for sentimental purposes. To that end, I'm attaching the VI Plug-ins Guide for historical purposes.

AlarmManager.createAlarm() API changes since 6.0

$
0
0

Hi All,

 

Update

Is there any mandatory property of AlarmSpec that I must supply in vsphere client SDK 6.0+? Looks like the SDK has enforced some validation against null value since 6.0+.

The API document I'm referencing is this: VMware vSphere 6.5 Documentation Library I fulfilled all mandatory fields of an AlarmSpec, please see attachment for details.

 

Just noticed some changes when I maintain my plugin code for 6.0.   In 5.5 or earlier version, when calling  AlarmManager.createAlarm() and supplied a AlarmSpec with few properties specified, it went through without exceptions, however when I tested it on a 6.0 sdk, it throws null exceptions , attaching my calling stack for reference:

 

com.vmware.vim25.ws.WSClient - Exception caught while invoking method: CreateAlarm

 

com.vmware.vim25.InvalidRequest: null

 

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

 

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

 

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

 

        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

 

        at java.lang.Class.newInstance(Class.java:442)

 

        at com.vmware.vim25.ws.XmlGenDom.fromXml(XmlGenDom.java:219)

 

        at com.vmware.vim25.ws.XmlGenDom.parseSoapFault(XmlGenDom.java:147)

 

        at com.vmware.vim25.ws.XmlGenDom.fromXML(XmlGenDom.java:105)

 

        at com.vmware.vim25.ws.SoapClient.unMarshall(SoapClient.java:212)

 

        at com.vmware.vim25.ws.WSClient.invoke(WSClient.java:93)

 

        at com.vmware.vim25.ws.VimStub.createAlarm(VimStub.java:2544)

 

        at com.vmware.vim25.mo.AlarmManager.createAlarm(AlarmManager.java:151)

 

        at com.mycompany.myproject.vmware.createAlarmCall...

 

 

 

I'm also attaching a AlarmSpec object instance that I pass to this API call which is working in 5.5 however throws null exception in 6.0:

 

Thanks in advance.

Hello, I have a question about creating users or groups in vCenter Server

$
0
0

Firstly, my main programming language is Java.

Do you guys know how to create a user or group in the vCenter Server instead of ESXi server which to be needed to use HostLocalAccountManager class from vim25

The vCenter Server which holds all the local users and groups refuses to return useful information except of NULL when I invoke HostLocalAccountManager class.

My vCenter Server runs on Linux and its version is 6.0.

I want to create users,groups as I do in vSphere Web Client at the corner of Users and Groups under the Single Sign-On tab which locates in Administration.

I really appreciate your help if you show me the way to deal with it.

Have a nice day!

I have some question about creating users or groups in vSphere Center Server

$
0
0

Firstly, my main programming language is Java.

Do you guys know how to create a user or group in the vCenter Server instead of ESXi server which to be needed to use HostLocalAccountManager class from vim25

The vCenter Server which holds all the local users and groups refuses to return useful information except of NULL when I invoke HostLocalAccountManager class.

My vCenter Server runs on Linux and its version is 6.0.

I want to create users,groups as I do in vSphere Web Client at the corner of Users and Groups under the Single Sign-On tab which locates in Administration.

I really appreciate your help if you show me the way to deal with it.

Have a nice day!

AlarmManager.createAlarm() API changes since 6.0

$
0
0
I'm working with vsphere client SDK to integrate functionalities into our management plugin for vmware, recently I find a compatibility issues with API version 6.0 or above:
 
 
Just noticed some changes when I maintain my plugin code for 6.0.  In 5.5 or earlier version, when calling  AlarmManager.createAlarm() and supplied a AlarmSpec with few properties specified, it went through without exceptions, however when I tested it on a 6.0 sdk, it throws null exceptions , attaching my calling stack for reference:
 
com.vmware.vim25.ws.WSClient - Exception caught while invoking method: CreateAlarm
com.vmware.vim25.InvalidRequest: null
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at com.vmware.vim25.ws.XmlGenDom.fromXml(XmlGenDom.java:219)
        at com.vmware.vim25.ws.XmlGenDom.parseSoapFault(XmlGenDom.java:147)
        at com.vmware.vim25.ws.XmlGenDom.fromXML(XmlGenDom.java:105)
        at com.vmware.vim25.ws.SoapClient.unMarshall(SoapClient.java:212)
        at com.vmware.vim25.ws.WSClient.invoke(WSClient.java:93)
        at com.vmware.vim25.ws.VimStub.createAlarm(VimStub.java:2544)
        at com.vmware.vim25.mo.AlarmManager.createAlarm(AlarmManager.java:151)
        at com.mycompany.myproject.vmware.createAlarmCall...

 

Attaching log from my vcenter: /var/log/vmware/vpxd/vpxd-69.log

 

2017-03-13T20:50:36.018Z info vpxd[7F9F68DE5700] [Originator@6876 sub=vpxLro opID=72c2b2a9] [VpxLRO] -- FINISH task-internal-5248835

2017-03-13T20:50:35.973Z info vpxd[7F9F68EE7700] [Originator@6876 sub=Default opID=7c867ed3] [VpxLRO] -- ERROR task-2362 -- AlarmManager -- vim.alarm.AlarmManager.create: vmodl.fault.InvalidArgument:

--> Result:

--> (vmodl.fault.InvalidArgument) {

-->    faultCause = (vmodl.MethodFault) null,

-->    invalidProperty = <unset>,

-->    msg = ""

--> }

--> Args:

-->

--> Arg entity:

--> 'vim.Datastore:datastore-2571'

--> Arg spec:

--> (vim.alarm.AlarmSpec) {

-->    name = "mydatastore",

-->    systemName = <unset>,

-->    description = "None",

-->    enabled = true,

-->    expression = (vim.alarm.MetricAlarmExpression) {

-->       operator = "isAbove",

-->       type = "vim.Datastore",

-->       metric = (vim.PerformanceManager.MetricId) {

-->          counterId = 280,

-->          instance = ""

-->       },

-->       yellow = 7500,

-->       yellowInterval = <unset>,

-->       red = 8500,

-->       redInterval = <unset>

-->    },

-->    action = (vim.alarm.AlarmAction) null,

-->    actionFrequency = <unset>,

-->    setting = (vim.alarm.AlarmSetting) null,

-->    alarmMetadata = <unset>

--> }

 
Is there any mandatory property of AlarmSpec that I must supply in vsphere client SDK 6.0+? Looks like the SDK has enforced some validation against null value since 6.0+.
 I fulfilled all mandatory fields of an AlarmSpec, please see attachment for more details.
Thanks in advance.

How can I control the vSphere API version?

$
0
0

We have recently upgraded to vSphere 6.0

I failed to access the vSphere 6.0 specific API calls.

According to the documentation, the property that we need to configure for enabling/disabling vSphere HA VM Component Protection service is:

ClusterDasConfigInfo.vmComponentProtecting (disabled/enabled)

This property does exist in the vSphere web services SDK/API version 6.0.2 API, however when we run the code we get an exception that says:

Method not found: 'System.String Vim25Api.ClusterDasConfigInfo.get_vmComponentProtecting()'.

After running the code with a debugger I’ve realized that dynamically the ClusterDasConfigInfo object doesn’t have the vmComponentProtecting property.

However, it does contains the vmMonitoring property and other properties of older versions of vSphere API.

 

I've suspected that, from some reason I'm using a lower API version, so I've checked the AboutInfo object.

This is what I found:

AboutInfo.apiVersion="6.0"

AboutInfo.build="5112529"

AboutInfo.sessioninfo.fullName=VMware vCenter Server 6.0.0 build-5112529

 

I've continued investigating this and I've used Fiddler tool in order to check the actual SOAP requests sent to the server.

 

This is what I came up with:

SOAPAction: "urn:vim25/5.1"

 

This means that although I'm using the vSphere 6.0 API, the actual SOAP request is of version 5.1.

 

The question is how could it be?

How can I control this?

 

This is what I've expected:

SOAPAction:urn:vim25/6.0

 

Many thanks,

Dudi.


C# Using Single SignOn (SSPI) for Virtual Center 2.5.0.119598

$
0
0

I am trying to use passthru authentication using SSPI to work in my c# application. Here is a snippet of the code I am trying to get to work.

 

returns a reference for VMware.Vim.SessionManager

 

VMware.Vim.VimClient vimClient = new VMware.Vim.VimClient();

vimClient.Connect("10.x.x.x", CommunicationProtocol.Https, 443);

 

ManagedObjectReference serviceInstance = new ManagedObjectReference();

serviceInstance.Type = "ServiceInstance";

serviceInstance.Value = "ServiceInstance";

 

SessionManager sm = new SessionManager(vimClient, serviceInstance);

sm.LoginBySSPI(ct_b64, null);

 

I get an exception when I try to call this method LoginBySSPI

 

I am not sure that this is the correct approach, but I really would like to be able to login using single signon in my c# code but not having much success.

This works fine using PowerShell but I want to be able to do this directly using c# without using PS Pipelines.

 

 

Any suggesstions welcome.

 

 

Thanks

How can I control the vSphere Web Services SDK/API version?

$
0
0

We have recently upgraded to vSphere 6.0

I'm using the Web Services SDK for .Net.

I failed to access the vSphere 6.0 specific API calls.

According to the documentation, the property that we need to configure for enabling/disabling vSphere HA VM Component Protection service is:

ClusterDasConfigInfo.vmComponentProtecting (disabled/enabled)

This property does exist in the vSphere web services SDK/API version 6.0.2 API, however when we run the code we get an exception that says:

Method not found: 'System.String Vim25Api.ClusterDasConfigInfo.get_vmComponentProtecting()'.

After running the code with a debugger I’ve realized that dynamically the ClusterDasConfigInfo object doesn’t have the vmComponentProtecting property.

However, it does contains the vmMonitoring property and other properties of older versions of vSphere API.

 

I've suspected that, from some reason I'm using a lower API version, so I've checked the AboutInfo object.

This is what I found:

AboutInfo.apiVersion="6.0"

AboutInfo.build="5112529"

AboutInfo.sessioninfo.fullName=VMware vCenter Server 6.0.0 build-5112529

 

I've continued investigating this and I've used Fiddler tool in order to check the actual SOAP requests sent to the server.

 

This is what I came up with:

SOAPAction: "urn:vim25/5.1"

 

This means that although I'm using the vSphere 6.0 API, the actual SOAP request is of version 5.1.

 

The question is how could it be?

How can I control this?

 

This is what I've expected:

SOAPAction:urn:vim25/6.0

 

Many thanks,

Dudi.

 

How can I create a user in VCenter Server, using vim25?

$
0
0

I can create a user account through the web client.

But I want to create users, using vim25 SDK(JAVA).

I can retrieve user information from UserDirectory(retriveUserGroups method) but I couldn't find the method to create a user in vCenter server.

HostLocalAccountManager  only works for ESXi.

Any suggestions?

I will really appreciate your help! Thanks!

How can I bypath the Root CA when using HTML Console?

$
0
0

I want users to see their HTML console directly without installing root CA on their computers.

I have been using vim25(JAVA) for developing.

Is there a way to bypath the Root CA when using HTML Console?

Thank you for reading!

Is PerformanceManager thread safe?

Viewing all 1860 articles
Browse latest View live


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