unixman's Posts

so this is getting a bit funny: I tried removing the Vix_ReleaseHandel(jobHandle) in VixDiscoveryProc() but I was still getting segfaults. this seems to be happening in main, as if it tries to ex... See more...
so this is getting a bit funny: I tried removing the Vix_ReleaseHandel(jobHandle) in VixDiscoveryProc() but I was still getting segfaults. this seems to be happening in main, as if it tries to execute abort no matter what. if I return(-1) then all is good. below is the compelete program which works without any segfaults on 32bit. on the 64bit machine I could only get this code to run if I use VMware-vix-1.0.3 and -m32 when compiling. below is the full listing of the code: #include "stdio.h" #include "string.h" #include "vix.h" static VixHandle hostHandle = VIX_INVALID_HANDLE; static VixHandle jobHandle = VIX_INVALID_HANDLE; void VixDiscoveryProc(VixHandle jobHandle, VixEventType eventType, VixHandle moreEventInfo, void *clientData) { VixError err = VIX_OK; VixHandle vmHandle = VIX_INVALID_HANDLE; char *url = NULL; // Check callback event; ignore progress reports. if (VIX_EVENTTYPE_FIND_ITEM != eventType) { return; } // Found a virtual machine. err = Vix_GetProperties(moreEventInfo, VIX_PROPERTY_FOUND_ITEM_LOCATION, &url, VIX_PROPERTY_NONE); if (VIX_OK != err) { // Handle the error... goto abort; abort: printf("Aborting in discover\n"); Vix_ReleaseHandle(jobHandle); VixHost_Disconnect(hostHandle); } printf("\nFound virtual machine: %s\n", url); } int main() { VixError err; // Connect to specified host. jobHandle = VixHost_Connect(VIX_API_VERSION, VIX_SERVICEPROVIDER_VMWARE_SERVER, "vmserver", //serverName 902, // hostPort "root", // userName "password", // password, 0, // options VIX_INVALID_HANDLE, // propertyListHandle NULL, // callbackProc NULL); // clientData err = VixJob_Wait(jobHandle, VIX_PROPERTY_JOB_RESULT_HANDLE, &hostHandle, VIX_PROPERTY_NONE); if (VIX_OK != err) { // Handle the error... printf("An error occurred\n"); goto abort; } printf("\nLooking for running virtual machines"); jobHandle = VixHost_FindItems(hostHandle, VIX_FIND_RUNNING_VMS, VIX_INVALID_HANDLE, // searchCriteria -1, // timeout VixDiscoveryProc, NULL); VixJob_Wait(jobHandle, VIX_PROPERTY_NONE); Vix_ReleaseHandle(jobHandle); VixHost_Disconnect(hostHandle); return(0); abort: printf("Aborting in main\n"); Vix_ReleaseHandle(jobHandle); VixHost_Disconnect(hostHandle); return(-1); }
Hi, well thank you for taking the time to look into all this. Great work indeed and we all miss things one time or another. I have 1 more questions(there is always 1 more, right?) would I be a... See more...
Hi, well thank you for taking the time to look into all this. Great work indeed and we all miss things one time or another. I have 1 more questions(there is always 1 more, right?) would I be able to take multiple snapshots with the vix api against a vmware server product giving the snapshots different names or would it always take 1 snapshot overwriting the existing snapshots below is the full listing of the code which causes the segfault, it pretty much came out of the docs. I haven't started doing anything complex yet. #include "stdio.h" #include "string.h" #include "vix.h" static VixHandle hostHandle = VIX_INVALID_HANDLE; static VixHandle jobHandle = VIX_INVALID_HANDLE; void VixDiscoveryProc(VixHandle jobHandle, VixEventType eventType, VixHandle moreEventInfo, void *clientData) { VixError err = VIX_OK; VixHandle vmHandle = VIX_INVALID_HANDLE; char *url = NULL; // Check callback event; ignore progress reports. if (VIX_EVENTTYPE_FIND_ITEM != eventType) { return; } // Found a virtual machine. err = Vix_GetProperties(moreEventInfo, VIX_PROPERTY_FOUND_ITEM_LOCATION, &url, VIX_PROPERTY_NONE); if (VIX_OK != err) { // Handle the error... goto abort; } printf("\nFound virtual machine: %s\n", url); abort: Vix_ReleaseHandle(jobHandle); Vix_FreeBuffer(url); } int main() { VixError err; // Connect to specified host. jobHandle = VixHost_Connect(VIX_API_VERSION, VIX_SERVICEPROVIDER_VMWARE_SERVER, "vmserver1", // hostName 902, // hostPort "root", // userName "password", // password, 0, // options VIX_INVALID_HANDLE, // propertyListHandle NULL, // callbackProc NULL); // clientData err = VixJob_Wait(jobHandle, VIX_PROPERTY_JOB_RESULT_HANDLE, &hostHandle, VIX_PROPERTY_NONE); if (VIX_OK != err) { // Handle the error... goto abort; } Vix_ReleaseHandle(jobHandle); printf("\nLooking for running virtual machines"); jobHandle = VixHost_FindItems(hostHandle, VIX_FIND_RUNNING_VMS, VIX_INVALID_HANDLE, // searchCriteria -1, // timeout VixDiscoveryProc, NULL); VixJob_Wait(jobHandle, VIX_PROPERTY_NONE); Vix_ReleaseHandle(jobHandle); VixHost_Disconnect(hostHandle); abort: printf("Aborting\n"); Vix_ReleaseHandle(jobHandle); VixHost_Disconnect(hostHandle); }
I tried both VMware-vix-1.0.3 and VMware-vix-1.1.0 on a 32bit machine. I am still getting segfault half way through the "finditems" loop. strace makes it look like it was on a poll on the tempor... See more...
I tried both VMware-vix-1.0.3 and VMware-vix-1.1.0 on a 32bit machine. I am still getting segfault half way through the "finditems" loop. strace makes it look like it was on a poll on the temporarily file created. is this a known issue or do you suspect it has to do with my environment? There are a few cases where the documentation was not accurate when it included example code. also the documentation for VMware::Vix::Simple has a typo, one line says "use VMware::Vix::Simple" and the other says "use VMWare::Vix::Simple".
I initially installed vix-1.1.0 release, which claimed to be compatible with server. it had a 64bit version under ws-2 and I tried to use that initially and it did not work so I installed the vix... See more...
I initially installed vix-1.1.0 release, which claimed to be compatible with server. it had a 64bit version under ws-2 and I tried to use that initially and it did not work so I installed the vix1.0.3 release and with -m32 things sort of work. I am going to try 1.1.0 with -m32 and if all fails I will have to use a 32bit machine. Do you know of any plans to have 64bit support for vix with server? Also, do you know if the API is going to get standardized in case and conventions. some calls use VIX and other use Vix. the docs seem to be out of date on the case isssue. Thanks. I will post what I find.
Yes I changed the port number because the installer claimed 902 was in use. I can connect and query the server now but I am seeing different problems as described in the othe other posts in this... See more...
Yes I changed the port number because the installer claimed 902 was in use. I can connect and query the server now but I am seeing different problems as described in the othe other posts in this thread.
This code still fails in the sense that It can't list out all the running machines. it dies in the middle of quering the server with a segfault. have you seen this behavior before? Thanks
My Question now is how can I get the vix bindings for perl to compile against 32bit libraries? Thanks
Hi, I found a solution, one must pass -m32 flag to the compiler to be able to link against the 32bit versions of the libraries. The ws-2 64bit version don't work on vmwar-server up to 1.0.3. Thi... See more...
Hi, I found a solution, one must pass -m32 flag to the compiler to be able to link against the 32bit versions of the libraries. The ws-2 64bit version don't work on vmwar-server up to 1.0.3. This is what I used to complie code that worked. gcc -m32 -o hostconnect hostconnect.c -I/usr/include/vmware-vix /usr/lib/libvmware-vix.so.0.0.0 The only thing is I get a segmentation fault at the end. much like what I am used to seeing from vmrun up to VMware server 1.0.2. Any hints what I can do to fix that?
OS: OpenSUSE 10.2 x86_64 VMware Product: VMware server VMware Product version: VMware-server-1.0.3-44356 Vix version: VMware-vix-1.0.3-44356.tar.gz let me know if there is anything else to ... See more...
OS: OpenSUSE 10.2 x86_64 VMware Product: VMware server VMware Product version: VMware-server-1.0.3-44356 Vix version: VMware-vix-1.0.3-44356.tar.gz let me know if there is anything else to help file a bug on this or find a way to get it to work
Hi, I am using the latest release of the vix api and I am not getting anywhere from C or from perl. I tried this on both 32 and 64 bit linux hosts and it seems like Vix_JobWait hangs forever. Th... See more...
Hi, I am using the latest release of the vix api and I am not getting anywhere from C or from perl. I tried this on both 32 and 64 bit linux hosts and it seems like Vix_JobWait hangs forever. The example in the docs that passes NULL for hostname, username and password also need to be corrected since they result in a segfault as it seems that some code tries to do strlen on these params. below is my code, which is pretty much out of the examples. I appreciate any tips : int main() { VixError err; // Connect to specified host. jobHandle = VixHost_Connect(VIX_API_VERSION, VIX_SERVICEPROVIDER_VMWARE_SERVER, "mymachine.com", // hostName 904, // hostPort "root", // userName "password", // password, 0, // options VIX_INVALID_HANDLE, // propertyListHandle NULL, // callbackProc NULL); // clientData err = VixJob_Wait(jobHandle, VIX_PROPERTY_JOB_RESULT_HANDLE, &hostHandle, VIX_PROPERTY_NONE); if (VIX_OK != err) { // Handle the error... goto abort; } Vix_ReleaseHandle(jobHandle); printf("\nLooking for running virtual machines"); jobHandle = VixHost_FindItems(hostHandle, VIX_FIND_RUNNING_VMS, VIX_INVALID_HANDLE, // searchCriteria -1, // timeout VixDiscoveryProc, NULL); VixJob_Wait(jobHandle, VIX_PROPERTY_NONE); abort: Vix_ReleaseHandle(jobHandle); VixHost_Disconnect(hostHandle); }