Quantcast
Channel: VMware Communities : Discussion List - vSphere Management SDK
Viewing all 1375 articles
Browse latest View live

SRM Recoveryplan method issue please help

$
0
0

Hello all,

 

We are using the SRM API 5.0 and trying to start a recovery plan in a disaster recovery mode. What we want to do is provide a button for the customer in our portal where he can push it and have a DR failover initiated on the srm server. However we dont get to do that.

 

The api seems to me only allows for a planned migration only - please help me.

 

Thanks

RJ


Binding with VMKernel network Adapter with the iSCSI Adapter

$
0
0

Hello,

 

I'm trying to automate the flow for connecting the iSCSI initiator with the corresponding target server. The VISDK API doesn’t seems to provide the support for automating the “Binding with VMKernel network Adapter with the iSCSI Adapter”.  However it supports the API for configuring the Dynamic discovery and Static discovery of iSCSI targets corresponding to the iSCSI Adapter.


Can anyone help me on this with SDK support for achieving this functionality.


Thanks,


Issue with Data Object - GuestNicInfo

$
0
0

Hello everybody,

 

 

I am writing a script collecting data about virtual machines running our 32 ESXi 5.1 hosts. About 500 VMs are concerned.

 

I have an issue with about 20 VMs when I access GuestNicInfo object, here is the output for a "normal" virtual machine using "Prod_VM" network:

 

 

network         Prod_VM

                ip: 172.26.88.20

                mac: 00:50:56:80:60:28

                connected: yes

 

 

And the output for a virtual machine using the same network:

 

network         62 83 08 50 8c e9 37 e1-45 c2 42 16 04 34 60 4c

                ip: 172.26.72.129

                mac: 00:50:56:80:23:6c

                connected: yes

 

As you can see my network name "Prod_VM" has been converted to "62 83 08 50 8c e9 37 e1-45 c2 42 16 04 34 60 4c". I don't think there is an mistake in my script, as a Dum of the dataastructure returns the same value.

 

Using Network object returns the correect value, but I cannot match the IP address to the correct network adapter, so here is my question:

 

Does anyone has already saw this behavior?

 

Thanks in advance.

 

Regards,

 

Jeremy

How can I perform the heartbeat functions enable, disable and markactive within FreeBSD 8.1?

$
0
0

My company has an embedded system we would like to run within a virtual machine.  The system runs on FreeBSD 8.1 and has been extensively trimmed.  As an example, of this trimming, we only use the VXMNET and VXMNET3 drivers out of VMware tools.  We would like to use the VMware heartbeat functions for our reset watchdog.

 

I have downloaded and read the Guest SDK.  The good news is that it has the API I need to add the functionality.  The bad news is that the binary-only libraries that present the API are not for FreeBSD 8.1.

 

Could someone please tell me how to perform the three mentioned API functions, without the need for the library?

 

Sincerely,

Vincent

How to use DataByConstraintRequest?

$
0
0

Hi ,

 

I am new to the vSphere web client plugin development. I went through some samples specifically the helloworld sample and the views-properties-ui sample. I was then trying to retrieve list of powered on VMs and list their corresponding datastores. I am using DataByConstraintRequest for that. In the documentation, they say

you can give names to the event annotations like the following :

[Event(name="abc",

        type="com.vmware.data.query.events.DataByConstraintRequest")]

 

instead of

 

[Event(name="{com.vmware.data.query.events.DataByConstraintRequest.REQUEST_ID}",

        type="com.vmware.data.query.events.DataByConstraintRequest")]

 

as given in the sample. That way I can do two different things on firing two separate queries by writing two different response handlers.

 

When I change the name however, I get the following errors:

 

Description    Resource    Path    Location    Type

abc is not a valid name attribute for this tag.    FirstPluginMediator.as    /FirstPlugin/swf/src/main/flex/com/acme/firstPlugin/views    /FirstPlugin/swf/src/main/flex/com/acme/firstPlugin/views/FirstPluginMediator.as    Metadata Tag Problem

 

What could be the problem?

 

Thanks!

Reading host files

$
0
0

Hello,

 

Is there any way to list the contents of a host file (like: /etc/vmware/esx.conf) using the SDK? Actually I want to get the PSA claimrules for the host...

C# Proxy Class (Silverlight/Windows Phone)

$
0
0

Even though not supported I have been trying to generate a working proxyclass for Silverlight compatible C# for Windows Phone.

Generating the proxy class, it creates an enormous file, but that is not an issue for now.

However, when I compare the VimService.cs file after generation with SLsvcUtil.exe and wsdl.exe, I am missing the entire "VimService" class inside the file created by SLsvcUtil. Possible because it is a "System.Web.Services.Protocols.SoapHttpClientProtocol" class which seems to be not supported (System.Web not at all).

 

Did anyone try to do this before? For now it seems like mission impossible (not a C# expert). Does anyone have a clue what I could possibly do?

How does MO ID value get generated ?

$
0
0

Hi,

 

I'd like to know if MO ID value get never changed once assigned.

 

I think using the MO ID value like "vm-88" can help me to identify a certain virtual machine in the environment.

But of cource there would be vMotion, HA TKO or conversion of VM image, and I'm wondering if the MO ID of virtual machine could be changed in those cases.

 

Is there any possibility that the ID might get changed ?

 

 

Any help would be appreciated.


Java Sample CloneVM fails with "The server sent HTTP status code 200: OK"

$
0
0

Hi,

 

I downloaded the SDK zip and copied the VMClone.java from "SDK\vsphere-ws\java\JAXWS\samples\com\vmware\vm" into a Eclipse project and started it by this code:

 

String[] myargs = new String[12];

myargs[0] = "--url";

myargs[1] = "https://192.168.0.91:9443";

myargs[2] = "--username";

myargs[3] = "[myuser]";

myargs[4] = "--password";

myargs[5] = "[mypassword].";

myargs[6] = "--datacentername";

myargs[7] = "LaptopIkor";

myargs[8] = "--vmpath";

myargs[9] = "[datastore1]/liferayTomcat/liferayTomcat.vmx";

myargs[10] = "--clonename";

myargs[11] = "DriverCreation1";

com.vmware.vm.VMClone.main(myargs);

 

But this fails with following message/stacktrace:

com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 200: OK

at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(Unknown Source)

at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)

at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)

at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source)

at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)

at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)

at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)

at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)

at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)

at $Proxy35.retrieveServiceContent(Unknown Source)

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

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

 

This also happens with VMCreate and when using the samples.jar instead of copying the source files. Any idea how to resolve this?

The url points to a win2008 server with vCenter Server installed, including vSphere Web Client.

 

Thanks for any help.

create/change user on esx host in c#

$
0
0

Hello,

since a few days I try to write a function in c# with VMWARE.VIM to create a user or change existing user password on an ESX host.

For now, I have a function who enum all Hosts in a Datacenter and also read all user and groups on the ESX hosts, but not the user part.

 

Because I don't find any usefull sample or any documentation who helps me I hope someone can help me with a small code snipped who show me the right way.

 

Thanks, woodle.

VSphere realtime stats: timestamp is 1 hour off

$
0
0

I have an app that pulls down the realtime stats of a vsphere install every 15 minutes, and it's been working like a champ for close to a year now.  Recently, we added a new vsphere install in the same datacenter (same timezone), and this one is returning timestamps 1 hour less than it should be.

 

The datacenter is GMT-5/6, the timestamp is reporting as if it's GMT-4.

 

I've cracked open the SOAP message body, and the timestamp is definitely coming from the server.  We've checked the timezone on the vsphere servers, and it appears to be correct (CDT), so I'm unsure as to what could be causing this to happen.

 

One of the things I do is track the last timestamp, and the next time I grab the realtime metrics, I'll hand the last timestamp back, so we're not always grabbing a full hours worth of stats since we only kickup every 15 minutes.  The first time it will pull down the realtime stats properly.  The second time, I get an error about the parameter, which indicates to me that even the server doesn't think the timestamp is right.

 

Any ideas?

cloneVMTask - What about storage?

changing guest operating system's nic details via c# using CustomizeVM_Task

$
0
0

Hello.I would like to change for example the ip address of a nic on the guest operating system.

  CustomizationSpec customsSpec2 = new CustomizationSpec();

         

            CustomizationAdapterMapping adapterMap = new CustomizationAdapterMapping();

            CustomizationIPSettings adapter = new CustomizationIPSettings();

            CustomizationFixedIp fixedIP = new CustomizationFixedIp();

            fixedIP.IpAddress = "192.168.2.83";

            adapter.Ip = new CustomizationIpGenerator();

            adapter.Gateway = new string[] {"192.168.2.3"};

         

            adapterMap.Adapter = adapter;

            adapterMap.Adapter.Ip = fixedIP;

            adapterMap.Adapter.SubnetMask = "255.255.255.0";

            customsSpec2.NicSettingMap = new CustomizationAdapterMapping[] { adapterMap };

            var custwinoptions = new CustomizationWinOptions();

            customsSpec2.Options = custwinoptions;

         

            customsSpec2.GlobalIPSettings = new CustomizationGlobalIPSettings();

         

            var idid=new CustomizationSysprep();

            idid.Identification = new CustomizationIdentification();

            //idid.Identification.DomainAdmin = "";

            //idid.Identification.

         

            idid.GuiUnattended=new CustomizationGuiUnattended();

         

            idid.GuiUnattended.AutoLogon = true;

         

            idid.UserData = new CustomizationUserData();

 

            var custname = new CustomizationVirtualMachineName();

            idid.UserData.ComputerName = custname;

            idid.UserData.FullName = "userdataFullName";

            idid.UserData.OrgName = "userDataOrgName";

            idid.UserData.ProductId = "";

           customsSpec2.Identity = idid;

 

            var cName = new CustomizationName();

           customizeVMTask = targetVirtualMachine.CustomizeVM_Task(customsSpec2);

Then i had to insert the sysprep files in the appropriate directory....

After a lot of pain and tears(lol) i managed to change the ip address.

My questions

a)Is Sysprep the only solution in order to change info on the guest operating system ?

b)By using the method above i had to power on the machine twice i think.Then i had to enter a few options(i suppose i didn't complete all of them although i had used GuiUnattended)

c)The other solution is to use powercli?Which  i have seen that works in linux too via perl.

d)Isn't an easier way to change the ip address of a nic ?????Is there any way call whatever  Set-VMGuestNetworkInterface calls via c# without using powershell ?

Somebody please answer.

Thanks.

AcquireTicket and vmware-vmrc.exe

$
0
0

Hi all,

We let users open remote consoles, and we used to call AcquireMksTicket and pass the ticket to vmware-vmrc to paypass the credential

 

With Vi SDK 4.1, AcquireMksTicket is replaced with AcquireTicket and also it seems vmware-vmrc distributed with the vSphere also changed and now it requires the ticket returned by AcquireCloneTicket rather than AcquireTicket.

 

We dont want to use AcquireCloneTicket, because the ticket returned by that API can be used to connect to any VM. We want more control over how that ticket is used. According to SDK documentation, AcquireTicket can still be used to connect to the VM. When we pass the ticket returned by AcquireTicket, vmrc fails to connect to the VM with "invalid ticket" error. What is the correct way to use the AcquireTicket to connect to VM console?

 

Thanks in advance

Onur

Can't create linked clones

$
0
0

Hi All,

 

  I'm trying to clone a vm from a snapshot point and share the disks with the original vm (linked clone).

 

According to the API reference documentation, I'm setting:

 

  * spec.snapshot  to the snapshot mor to get the configuration from

  * location.diskMoveType to "createNewChildDiskBacking"

 

The clone is created from the snapshot point but the disks are fully copied, using the datastore browser I can see the disks sizes for the new are the same than the original.

 

As this functionality is not supported by the vSphere client, I can't get SOAP logs to see how it should be done.

 

Is there any other mandatory parameter I need to set?

What are the restrictions for this functionality to work?

 

I guess that If there's any restriction on my environment the task should fail. Or does it just ignore the location.diskMoveType setting and falls back to the default option?

 

Thanks in advance,


Is there any API to get/update session timeout value

$
0
0

Hi,

 

Is there any API to get or update the Timeout value between vcenter server and vsphere web client?  I am attaching the screenshot which shows this value in the VShpere Web client v5.1.

 

Thanks

'Error parsing the server 'ip' "clients.xml" file. Login will continue, contact your system administrator' error vSphere at login

$
0
0

Hi, I'm experiencing a problem when trying to login to one of our esx hosts. I see the following error at login...

 

Error parsing the server 'ip' "clients.xml" file. Login will continue, contact your system administrator

 

I'm trying to connect to a host running esx 4.1, from a vSphere client running v4.1.0. I have seen posts talking about a possible windows update, but have tried logging on via a machine with no recent windows updates see the same issue. Unable to connect via SSH as its not enabled.

 

Any help appreciated.

Thanks

Vcenter server operation timeout

$
0
0

Hi,

 

Is there any API or other way to get/update the timeout intervals for vcenter server operations other than web client or vSphere client?

 

I need to check/update the values of the interval timeout in my plugin code.    I searched the SDK document but didn't see any API to do that.    I might miss that.    I am wondering if there is an API or a property file to save these data so that I can read/update them.   Your help is really appreciated.

vim.fault.invalidticket exception when passing AcquireTicket value to vmware-vmrc (remote console)

$
0
0

 

I have written an app that opens the vmware remote console (vmware-vmrc.exe) by passing it the VirtualMachineTicket value from the AcquireTicket method (see vSphere API for more details).

 

 

The problem I am having is that when I pass the ticket value to the vmware-vmrc.exe application I receive a vim.fault.invalidticket. Here is what the command looks like:

 

 

vmware-vmrc.exe -h 192.168.1.10:443 -p VCT-52d576c5-b292-681a-40f8-f06cf9d7b926 -M "vm-18273"

 

 

I was able to determine this was the format VMware was using by running process explorer while logging into the vSphere Web Interface. The process explorer shows exactly what the command looks like at the time it is called. So the 192.168.1.10 address is the vCenter server in this case, the password is the ticket value preceded by a "VCT-" prefix (perhaps standing for VMware Console Ticket), and finally the ManagedObject ID of the virtual machine I am trying to connect to.

 

 

So after passing the ticket value to the vmware-vmrc application, the error is generated... but if I do this from the web interface directly, there is no invalidticket exception. The only way I can get the vmware-vmrc to work is to exclude the VCT-Ticket info and call the vmware-vmrc application with the vCenter host address and the MOID value for the virtual machine. Then the console opens up, asks for the username and password, and then allows access to the vm console.

 

 

Of course the idea is to bypass having to login by supplying the ticket information on behalf of the user that is already authenticated.

 

 

Does anyone have experience with this? There is almost nothing on google about how to handle VirtualMachineTicket information with regards to the vmware-vmrc console application.

 

 

 

 

 

Unable to retrieving more than 100 VMs using PropertyCollector and WaitForUpdatesEx method

$
0
0

Using vSphere SDK for .NET. Sorry, couldn't find a .NET forum for the vSphere SDK but the Java forum should be close enough.

 

I am having problems retrieving a list of VMs from a Resource Pool. Specifically if there are more than 100 VMs (104 in my case) in the Folder or Resource Pool the returned UpdateSet will only ever have 100 items in it.

 

The offending code is as follows:

 

UpdateSet uSet = pc.WaitForUpdatesEx(string.Empty, new WaitOptions() { MaxWaitSeconds = 0 });
Console.Writeline(uSet.FilterSet[0].ObjectSet.Count); // will always contain no more than 100 items

 

There seems to be a hard cut off of 100 items.
WaitForUpdatesEx's WaitOptions contains a MaxObjectUpdates property, from the documentation

 

"The maximum number of ObjectUpdate entries that should be returned in a single result from WaitForUpdatesEx. See truncated

An unset value indicates that there is no maximum. In this case PropertyCollector policy may still limit the number of objects that appear in an UpdateSet."

 

But what is the "PropertyCollector Policy"  that it is referring to? I've been trawling the web and can find absolutely no reference to this at all other than in the documentation.

 

I also tried just putting in a a MaxObjectUpdates = 150 just to see what would happen. Again only 100 items returned.

 

For reference here is a more complete section of code:

 

EntityViewBase folderMngObj = GetVsphereVmFolderManagedObjectRefId(vClient, vSpherefolderName);

 

if (folderMngObj != null)
     {
          ManagedObjectReference svcRef = new ManagedObjectReference() { Type = "ServiceInstance", Value = "ServiceInstance" };
          ServiceInstance srvInst = new ServiceInstance(vClient, svcRef);

 

          ServiceContent sContent = srvInst.RetrieveServiceContent();
          ViewManager viewManager = new ViewManager(vClient, sContent.ViewManager);
          PropertyCollector pc = new PropertyCollector(vClient, sContent.PropertyCollector);

 

          ManagedObjectReference cvMngObjRef = viewManager.CreateContainerView(folderMngObj.MoRef, new string[] { "VirtualMachine" }, false);
          ContainerView cv = new ContainerView(vClient, cvMngObjRef);
          List<PropertySpec> propertySpecList = new List<PropertySpec>();

 

          foreach (string propertyPath in vmPropertyPaths)
          {
               PropertySpec propSpec = new PropertySpec();
               propSpec.PathSet = new string[] { propertyPath };
               propSpec.Type = "VirtualMachine";
               propertySpecList.Add(propSpec);
          }

 

          PropertySpec[] propertySpecs = propertySpecList.ToArray();
          PropertyFilterSpec pfs = new PropertyFilterSpec();
          pfs.ObjectSet = new ObjectSpec[] { CreateObjSpec(cv) };
          pfs.PropSet = propertySpecs;

 

          // Create a Property with partialUpdate is true
          PropertyFilter pf = new PropertyFilter(vClient, pc.CreateFilter(pfs, true));

 

          // Wait for initial udpate with empty version string
          UpdateSet uSet = pc.WaitForUpdatesEx(string.Empty, new WaitOptions() { MaxWaitSeconds = 0 });

 

          // Here uSet.FilterSet[0].ObjectSet will always contain no more than 100 items

 

          viewTable = OutputDataset(uSet);
          pf.DestroyPropertyFilter();
}

 

Any help would be appreciated.

Viewing all 1375 articles
Browse latest View live


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