troubleshooting Question

Virtual Machine Cloning C/C++

Avatar of srinathchow
srinathchowFlag for United States of America asked on
Operating SystemsCVMware
1 Comment1 Solution732 ViewsLast Modified:
Hi I am trying to clone a Virtual Machine usind C/C++ as a programming language and VIX API call which is

VixHandle VixVM_Clone(VixHandle vmHandle,
                      VixHandle snapshotHandle,
                      VixCloneType cloneType,
                      const char *destConfigPathName,
                      int options,
                      VixHandle propertyListHandle,
                      VixEventProc *callbackProc,
                      void *clientData);

But I am getting the error code 6 which is VIX_E_NOT_SUPPORTED and the VIX_PROPERTY_JOB_RESULT_HANDLE is showing 3010 which is VIX_E_NO_GUEST_OS_INSTALLED .

I first connected to the VM, then open the VM and then tried to Clone. The VM I am trying to Clone is not running i.e., it is powerd off state.

The destConfigPathName I specified = [datastore]clonename/conename.vmx

Can you please help me. Thanks a lot!
jobHandle = VixHost_Connect(VIX_API_VERSION,
                                CONNTYPE,
                                HOSTNAME, // *hostName,
                                HOSTPORT, // hostPort,
                                USERNAME, // *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_FAILED(err)) {
        goto abort;
    }
 
    Vix_ReleaseHandle(jobHandle);
    jobHandle = VixVM_Open(hostHandle,
                           VMXPATH_INFO,
                           NULL, // VixEventProc *callbackProc,
                           NULL); // void *clientData);
    err = VixJob_Wait(jobHandle, 
                      VIX_PROPERTY_JOB_RESULT_HANDLE, 
                      &vmHandle,
                      VIX_PROPERTY_NONE);
    if (VIX_FAILED(err)) {
        goto abort;
    }
Vix_ReleaseHandle(jobHandle);
 
	jobHandle = VixVM_Clone(vmHandle,NULL,VIX_CLONETYPE_FULL,CloneVM,0,VIX_INVALID_HANDLE,NULL,NULL);
 
	err = VixJob_Wait(jobHandle, 
                      VIX_PROPERTY_JOB_RESULT_HANDLE, 
                      &vmHandle,
                      VIX_PROPERTY_NONE);
 
	 if (VIX_FAILED(err)) {
        goto abort;
    }
ASKER CERTIFIED SOLUTION
srinathchow

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros