Quantcast
Channel: VMware Communities : Popular Discussions - VIX API
Viewing all 34639 articles
Browse latest View live

**ERROR**: file d:/build/ob/bora-127388/bora/vim/lib/gvmomiMOMgr .c: lin

$
0
0

Hi friends:

I´m automating ESX 4.0 with vix api 1.6.2... when I connect to server I obtain this error:

*ERROR*: file d:/build/ob/bora-127388/bora/vim/lib/gvmomiMOMgr .c: line 212: assertion failed: (priv->updatesListener == NULL) aborting...

I have read in other threads and I disconnect properly of the host, I reseat the server, etc.... but I can´t skip that error... what can I do???

 

Thanks!!


how to get the vmdk file path for a shutdown VM?

$
0
0

Hi Guys,

 

how to get the vmdk file path for a shutdown VM in ESX Server via VIX API?

I try to get it via VixVM_ReadVariable() function. but it seems this function requires the VM is power on.

I don't want to get the VM started, just want to know if I can get the vmdk file path when a VM is power off.

 

Thanks in advance.

Vix error 28

$
0
0

I am getting an error return 28 on VixJob_Wait.  I am looking in the list of error codes and I don't see it.  Am I missing it or is it not listed?

VixVM_RunProgramInGuest doesn't start right after the vmware is powered up

$
0
0

I have a vix program with common tasks including start the vmware, wait for vmware tool, then run a program in guest. The problem that I encounter is that my program in guest never get started right after the vmware is powered up. Vix seems to hang for a while. I usually have to terminate it. The second time when I run the program, it'll start my program in Guest. Is it because Vix doesn't know when Guest is finished loading? Is there a way to put a wait before calling RunProgramInGuest?

Thanks

[Urgent] Please help me out - Invalid user name or password on Guest Ubuntu

$
0
0

Hi,

 

Ater searching on Google for 1 week, I have finally came here. please help me out.

 

I have Windows 7 host OS and Ubuntu 11.04 for the Guest OS on running VMWare Workstation 6.5

 

I have any problem to run Power command such as "start" "stop" "reset"

c:\>vmrun -T ws reset "./Ubuntu.wmx"

 

HOWEVER,

Whenever I trying to run a command without ID/Password, it returns "Invalid user name or password for the Guest OS" even though YES it is correct ID/PASSWD for the Guest Ubuntu OS.

 

c:>vmrun -T ws -gu tshpark -gp 2001 runProgramInGuest "./Ubuntu.vmx" /usr/bin/xclock

Error: Invalid user name or password for the guest OS

 

Also tried,

c:>vmrun -T ws -gu "tshpark" -gp "2001" runProgramInGuest "./Ubuntu.vmx" /usr/bin/xclock

Error: Invalid user name or password for the guest OS

 

Please help me out how to troubleshoot this problem?

 

Thanks in advance,

Thomas

Unable to get OS Name from VIX Api

$
0
0

In my ESX Server, there are number of VM’s, I am trying to get the Name of OS from each VM’s using VIX API in Java.

 

Syntax:

 

osName = vixVmHandle.readVariable("guestOS",VixConstants.VIX_VM_CONFIG_RUNTIME_ONLY);

 

 

Any one have idea about this, please let me know.

 

Thanks in advance.

PowerOn VM failse with error 3008-Cannot connect to the virtual machine

$
0
0

Hello,

 

(I am sorry about my English) I am using VIX1.11 to start VM on ESXi5.0 host. The PowerOn() has always been failing for me with error "3008 Cannot connect to the virtual machine".However the VM still Power On. I also looked up some discussions already on this site but it just wont work for me. Could you please help me get it working?.

 

My code as bellow:

 

               //connec to esxi5.0 - work well

               UInt64 err;
                VixCOM.VixLibClass lib = new VixCOM.VixLibClass();
                job = lib.Connect(
                    Constants.VIX_API_VERSION,
                    VixCom.Constants.VIX_SERVICEPROVIDER_VMWARE_VI_SERVER,
                    hostName,
                    hostPort,
                    userName,
                    password,
                    0,
                    null,
                    null
                    );
                err = job.Wait(new int[] { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE },
                           ref Results);
                if (lib.ErrorIndicatesFailure(err))
                {
                         ;
                }
                IHost host = (VixCOM.IHost)((object[])Results)[0];

 

               //open vm - work well

               job = host.RegisterVM(vmPath, null);

                err = job.WaitWithoutResults();

                if (lib.ErrorIndicatesFailure(err))

                {

                    ;

                }

                job = host.OpenVM(vmPath, null);

                err = job.Wait(new int[] { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE },

                               ref Results);

                if (lib.ErrorIndicatesFailure(err))

                {

                    ;

                }

 

                IVM2 vm = (VixCOM.IVM2)((object[])Results)[0];

 

               //start vm - work with error 3008

               job = vm.PowerOn(VixCOM.Constants.VIX_VMPOWEROP_LAUNCH_GUI, null, null);

                err = job.WaitWithoutResults();

                if (lib.ErrorIndicatesFailure(err))

                {

                    ;

                }

PowerOn fails with 3008-Cannot connect to the virtual machine

$
0
0

Hello,

 

I am using VIX1.11 to start a VM(XPSP2 32bit) on ESXi5 server.I call PowerOn() method, this method return error 3008-Cannot connect to the virtual machine but the VM still started.

 

Beside that, I am using vSphere client5 to start VM and open console, this work well.

 

Could you please help me get it working?

 

Thanks

Trung Nguyen.


64 bit bersion of VixCOM.dll

$
0
0

I downloaded Vix SDK and see a 32 bit version of VixCOM.dll available. Is there a 64 bit version available?

 

Thx!

How does the Vix_Virtuozo_Suite work with snapshots

$
0
0

I found the Vix_Vurtuozo_Suite and it sounds very cool.  My trouble is that I can't find much information pertaining to how it works with snapshots.  Does it just save snapshots or is it a full backup of VMs?

Connection fails with perl VIX but works with C

$
0
0

Hi,

I'm new to the VIX SDK, and i'm willing to manage my  VM with VIX.

I'm more accustomed to perl.

 

Tu get my hands on it i tryed to use the sample host connection program which failed :

 

Unrecognized property type
Connect failed, 6000 The operation is not supported for the specified parameters

 

this is with using the sample code with the correct host connection parameters.

 

I tryed the same sample code in C with the same API and enevrything works.

 

I'm using VIX 1.11 and trying to connect to a vCenter Server 4.1 under Debian squeeze x86_64

VixVM_Open() returns error "The datastore corresponding to the given datastore path is not found"

$
0
0

In one of our setup, VixVM_Open() API call returns error "The datastore corresponding to the given datastore path is not found."

The returned error code is 38.

 

The specified vmx path as input to VixVM_Open() is of the fornmat "[MyDatastore] MyVM/MyVM.vmx".

We have verified that the datastore "MyDatastore" and the vmx path "[MyDatastore] MyVM/MyVM.vmx" exists and a VM is using this path.

 

We don't suspect any problem with the code, as the same code works in other setups.

 

What can be the possible reasons of VixVM_Open() returning this error?

And where to look for to drill down the root cause?

 

PS: We called VixHost_Connect() API to connect to a vCenter server (5.1) and then used VixVM_Open() API to try to connect to a VM. But the later is returning error.

 

 

Thanks in advance.

How to get VM path to .vmx file when you have the VM name?

$
0
0

Hi All,

I'm using the latest release of VIX API to power on VMs on an ESX server. I'm working with C# in Visual Studio 2012 and currently, I power on the VM using the following code:

 

VMWareVirtualMachine virtualClientMachine = host.Open(vmMachinePath, 2100);

 

While this works, I think it's better to instead be able to power on the VM when you know the VM name and not the path. So, how can I get the VM path to the vmx file when I know the name of the VM? For example, if my VM on the ESX server is called WIN7GERMAN, how do I then get the path and pass this to the host.Open function?

 

Thanks for any help or code.

John

API for Get-template?.

$
0
0

Hello All,

I am trying to find VMware template API command, what we use to get the templates from the vcenter using get-template command in the power cli method.

 

IS anybody know, is any handy guide which provide power cli command and API reference.

 

Regards,

- Mr.Y

PowerON VM from remote via PSEXEC and API doesn't work

$
0
0

Frame:

VMware Workstation 10.0

VS-Studio 2012

.NET 4.0

Windows 7 64bit

Vestris.VMwareLib.Dll [version 1.7] <-- wrapper for VIX API

Installed VMware-VIX-1.13.1-1379776.exe

-----------------------------------------------------------------------------------------------------------------------

 

I have a small C#-program to "shutdown" and "poweron" VM's. If I start my console-pgm with parameters from local in a BAT-file, all works fine.

 

Now i tried to start my pgm from a remote pc via psexec. The poweroff option works fine, the poweron option fails with the following error:

 

Failed to power on virtual machine: powerOnOption=512 timeoutInSeconds=120

 

Does anyone have an idea why?

 

psexec command> psexec \\xxx.xxx.xxx.xxx -u "{domain}\{user}" -p "{password}"  -s "D:\Programme\VMoperations\VMstart_XXNNV.bat

 

ADDON {05.03.2014 15:59}: I  tried it with PAEXEC and REEXEC, they failed too. And I changed my BATCH-file to call the VMrun.exe, but failed too. I think, it's a bug of VMware ?!?!?!

 

----------------------------------------------------------------------------------------------------------------------

 

BAT-File VMstart_XXNNV.bat:

SET fwpath="D:\Programme\VMoperations"

%fwpath%\VMoperations.exe -location:{vmpath} -vmname:XXNNV -o:poweron

----------------------------------------------------------------------------------------------------------------------

 

C# source VMoperations.exe:

reference to Vestris.VMWareLIb

refernce to Interop.VixCOM

--------------------------------------------------------------------------------------------


using Vestris.VMWareLib;  <-- version 1.7

...

 

private static void VMwork(string location, string vmName, string operationType)

        {

            try

            {

                using (VMWareVirtualHost virtualHost = new VMWareVirtualHost())

                {

                    virtualHost.ConnectToVMWareWorkstation();

                    vmxName = location + vmName + @"\" + vmName + @".vmx";

                    using (VMWareVirtualMachine virtualMachine = virtualHost.Open(vmxName))

                    {

                        vmPowerState = virtualMachine.PowerState;

 

                        switch (operationType)

                        {

                            case "shutdown":

                                if (vmPowerState == 1096)

                                {

                                    virtualMachine.ShutdownGuest();

                                }

                                break;

                            case "poweroff":

                                if (vmPowerState == 1096)

                                {

                                    virtualMachine.PowerOff();

                                }

                                break;

                            case "poweron":

                                if (vmPowerState == 2)

                                {

                                    virtualMachine.PowerOn(120);

                                }

                                break;

                        }

                        virtualMachine.Dispose();

                    }

                    virtualHost.Disconnect();

                    virtualHost.Dispose();

                }

                retCode = 0;

            }

            catch (Exception ex)

            {

                retCode = 1;

            }

        }

 

I tried everything, read dozends of internet pages, but found no info. Ever user on local and remote pc have full admin rights.

 

Best regards Hipp1010


VLAN Interconnectivity Issue on VIX API

$
0
0

Hi All

We've recently started testing out the VIX API, and picked up a strange issue when crossing the VLANs on our network.

If the client running the VIX API is on the same VLAN as our vCenter Server Appliance, then we don't have issues.

 

Whenever the client is on a different VLAN, we get connectivity errors.  The API will connect to vCenter, but seemingly be unable to send or receive the required data.

Occasionally it'll connect but I can't see anything in the logs to help with this.

VIX API Log:

2015-05-27T11:01:48.137+10:00| vthread-4| I120: Vix: [23412 vixVIMProxy.c:7990]: VixTranslateVimException: basicHttp/libcurl error code is 48, translated to VixError VIX_E_NET_HTTP_TRANSFER (30200).

2015-05-27T11:01:48.137+10:00| vthread-4| I120: Vix: [23412 vixVIMProxy.c:8006]: VixTranslateVimException: response message is "".

 

VPXD Log from vCenter just shows:

[7F6256980700 info 'commonvpxLro' opID=78bdcfae] [VpxLRO] -- BEGIN task-internal-33228 --  -- vmodl.query.PropertyCollector.retrieveContents --

[7F62566FB700 info 'commonvpxLro' opID=efac4ba] [VpxLRO] -- FINISH task-internal-33227 --  -- vmodl.query.PropertyCollector.retrieveContents --

 

 

How do I change/overwrite any of the global settings (better logging)?

Could it be HTTP/S Issue - vCenter appliance is running default certificate? (since browsing to http://x.y.z.25:80/sdk redirects to HTTPS)

Connectivity has been tested between all hosts/VMs

Able to connect on VM to vCenter without issue.

No errors in switches/router.

 

 

 

Example Logs:
VPXD -Ticket 930bd7c2-b625-52a0-bdb2-bc90699907a4(5252ed21-07f6-9795-ad50-289a9b6ee69c eventually works

VIX Logs showing a working example after 14 attempts

 

Does anyone have any suggestions on how to increase logging, or to diagnose the issue?

Thanks

How to skip CPU & RAM while capturing Snapshot?

$
0
0

Hi All,

 

Can anyone help on, How to skip CPU & RAM while capturing Snapshot? I only want to capture the disk(s) snapshot. So that when i revert to

 

Thanks

vix-perl installation

$
0
0

Hi All,

 

I wanted to take a quick poll as far as what kind of configuration people are installing vix-perl onto? I've tried many make programs, compilers, and ActivePerl versions, and I have not been able to successfully install vix-perl. Mostly there have been (apparently) problems with the makefile creation (errors when trying to make), or problems running perl after an apparent "successful" install.

 

I've tried make, nmake, cygwin, visual c++ express, ActivePerl 5.8.0 (as well as later versions).... What combination of these tools or others have worked for you guys? Any input welcome! I'd love to just start developing already!

 

Ideally I'm looking for a windows configuration, but again, any input is welcome. Please list your OS, perl version (if you compiled from source or what installer you used), compilers and make programs, and any relevant process information.

 

Thanks,

Nudi

 

Message was edited by:

        nudicles

VIX and Workstation version compatibility

$
0
0

 

I think i am having problems with the the workstation and vix not being the right versions ( compatibility wise ).

 

 

I have a virtual machine that was created using 6.0 . 

 

 

I had some working code in c++ and perl.

 

 

now , i upgraded to the latest workstation and vix available for download.

 

 

I verified  the version  of the workstation to be 6.0.1.

 

 

The vix i installed is  VMware-vix-1.1.0-45731.exe .

 

 

now , program gives errors .

 

 

i get the following error for the perl script

 

 

"VMOpen() failed, 3008 Cannot connect to the virtual machine"

 

 

also,  the VIX_API_VERSION is 2 , is this right ?

 

 

   

 

 

here is the first few lines of the script

 

 

############################################################3use VMware::Vix::Simple;

use VMware::Vix::API::Constants;

 

 

my $err = VIX_OK;

my $hostHandle = VIX_INVALID_HANDLE;

my $vmHandle = VIX_INVALID_HANDLE;

my $vmxFilePathName = "C:
Documents and Settings
Arun
My Documents
My Virtual Machines
Windows Server 2003 Enterprise x64 Edition
Windows Server 2003 Enterprise x64 Edition.vmx";

 

 

print "VIX_API_VERSION = ".VIX_API_VERSION."\n";

($err, $hostHandle) = HostConnect(VIX_API_VERSION,

                                  VIX_SERVICEPROVIDER_VMWARE_WORKSTATION,

                                  undef, # hostName localhost

                                  0, # hostPort

                                  undef, # userName

                                  undef, # password

                                  0, # options

                                  VIX_INVALID_HANDLE); # propertyListHandle

 

 

die "HostConnect() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

 

die "Virtual Machine file cannot be found $vmxFilePathName\n" if not -e $vmxFilePathName;

 

 

($err, $vmHandle) = VMOpen($hostHandle,

                           $vmxFilePathName);

 

 

die "VMOpen() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

 

 

 

 

How to Power On a remote host virtual machine

$
0
0

 

I am using vix api and vmware workstation.  My scripts in perl and C++ can power on a guest operating system in my computer (localhost).  However, I cannot power on a remote VM in another computer on my network.  The scripts give the following  errors:

 

 

C++ script:

The virtual machine cannot be found

 

 

Perl Script:

VMopen() failed, 4000 The virtual machine cannot be found

 

 

Here is part of my code:

 

 

C++:

 

 

VixHandle hostHandle = VIX_INVALID_HANDLE;

     VixHandle jobHandle = VIX_INVALID_HANDLE;

     VixHandle vmHandle = VIX_INVALID_HANDLE;

     VixError err;

     char vmxFilePath[] = "c:
home
My Virtual Machines
Windows Server 2003 Enterprise Edition
Windows Server 2003 Enterprise Edition.vmx";

 

 

     jobHandle = VixHost_Connect(1,

          VIX_SERVICEPROVIDER_VMWARE_WORKSTATION,

          "10.55.10.100",                    // hostName

          902,                       // hostPort

          "xxxxxx",                    // userName              

          "yyyyyyy",                    // password

          0,                       // options

          VIX_INVALID_HANDLE,      // propertyListHandle

          NULL,                    // callbackProc

          NULL);                   // clientData

 

 

     // Wait for completion of operation.

     err = VixJob_Wait(jobHandle,

          VIX_PROPERTY_JOB_RESULT_HANDLE,

          &hostHandle,

          VIX_PROPERTY_NONE);

 

 

     if (VIX_OK != err) {

          goto abort;

     } else {

          printf ("connect success\n");

     }

 

 

     Vix_ReleaseHandle(jobHandle);

 

 

     // Use VixVM_Open with the hostHandle and the vmxFilePath to open your virtual machine.

     jobHandle = VixVM_Open(hostHandle,

          vmxFilePath,

          NULL,           // callbackProc

          NULL);          // clientData

 

 

 

     err = VixJob_Wait(jobHandle,

          VIX_PROPERTY_JOB_RESULT_HANDLE,

          &vmHandle,

          VIX_PROPERTY_NONE);

 

 

     if (VIX_OK != err) {

          goto abort;

     } else {

          printf ("%s: open success\n",vmxFilePath);

     }

 

 

     // Use VixVM_PowerOn to power on your VM.

 

 

     jobHandle = VixVM_PowerOn(vmHandle,

          VIX_VMPOWEROP_NORMAL,           // options

          VIX_INVALID_HANDLE,             // propertyListHandle

          NULL,                           // *callbackProc,

          NULL);                          // *clientData

 

 

     err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);

 

 

     if (VIX_OK != err) {

          goto abort;

     } else {

          printf ( "%s: power on success\n",vmxFilePath);

     }

 

 

     Vix_ReleaseHandle(jobHandle);

 

 

 

 

 

Perl Code:

 

 

use VMware::Vix::Simple;

use VMware::Vix::API::Constants;

 

 

my $err = VIX_OK;

my $hostHandle = VIX_INVALID_HANDLE;

my $vmHandle = VIX_INVALID_HANDLE;

 

 

($err, $hostHandle) = HostConnect(1,

                                  VIX_SERVICEPROVIDER_VMWARE_WORKSTATION,

                                  "10.55.10.100", # hostName

                                  902, # hostPort

                                  "xxxxxx", # userName

                                  "yyyyyyy", # password

                                  0, # options

                                  VIX_INVALID_HANDLE); # propertyListHandle

 

 

die "HostConnect() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

 

($err, $vmHandle) = VMOpen($hostHandle,

                           "c:
home
My Virtual Machines
Windows Server 2003 Enterprise Edition
Windows Server 2003 Enterprise Edition.vmx");

die "VMOpen() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

$err = VMPowerOn($vmHandle,

                 VIX_VMPOWEROP_LAUNCH_GUI, # powerOnOptions

                 VIX_INVALID_HANDLE);  # propertyListHandle

die "VMPowerOn() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

 

$err = VMWaitForToolsInGuest($vmHandle,

                             300); # timeoutInSeconds

die "VMWaitForToolsInGuest() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

 

$err = VMLoginInGuest($vmHandle,

                      "administrator", # userName

                      "C*vmuser$$", # password

                      0); # options

die "VMLoginInGuest() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

 

 

 

 

 

Help please.  Both work well with the localhost when I change the hostname and port to NULL and 0.

 

 

 

 

 

Thanks

 

 

 

 

 

 

 

 

Viewing all 34639 articles
Browse latest View live




Latest Images