Quantcast
Channel: VMware Communities : Unanswered Discussions - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 872

rebooting a vm : failed, return code: 204, error

$
0
0

hello,

First of all, I wish you an happy new year !

 

so, we are using the sdk php (vcloudPHP-1.0.0-314767) and our vcd director cell is the 1.0.0-285979 build.

 

We try to use the possibilities to start, stop, reset and reboot a vm.

powerOn, powerOff and reset functions work, but we have a problem with the reboot function on a vm.

our code is something like that :


$sdkVm = $service->createSDKObj ($vm_href) ;
try {
  $task = $sdkVm->reboot();
  $result = $service->waitForTask($task,200,2);
}
catch (Exception $e) {
echo $e->getMessage() ;
}

we have an error when we execute that code, the error message is the following one :
POST https://10.170.232.44/api/v1.0/vApp/vm-1670680622/power/action/reboot failed, return code: 204, error: , request data:

there is no content return. and if we look the code in VCloud.php we can see that the reboot function expect a 202 return code.

 

the reboot works, but as we have no return content, we are not able to execute the waitFortask function and we got an exception.

 

I try to change the reboot function to work with a 204 :

public function reboot()
    {
        $this->powerOp('reboot', 204);
    }

 

But the problem is moved in the wait function:
The given object is in class VMware_VCloud_SDK_Service_Abstract type, cannot invoke refetch() function.

 

Like we saw above there is no content returned, hence it can not refetch a none existing object.

For the moment we ignore the exception and do not use the waitForTask function. But that is a problem.

 

Do you have a solution ?

 

regards,

 

Yann CONAN


Viewing all articles
Browse latest Browse all 872

Trending Articles



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