Quantcast
Channel: VMware Communities : Discussion List - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 2039

How do I Delete a VM?/vApp - Undeploy?

$
0
0

Can someone provide an example of how to delete a vm via the PHP bindings?

 

ie $vmsdk->delete()?

 

I know this is probably sooo simple but I have looked and cannot find the method to do this.

 

thanks

 

Update:

 

I have found out its easy... just scroll to the bottom of the docs pages and see the inherited methods

 

So I can do this:

 

$task = $sdkVm->delete();
$service->waitForTask($task);

 

but run into the problem William describes here:

 

http://blogs.vmware.com/vsphere/2012/04/partially-powered-off-vapp-vms.html

 

I can do a

 

 

$task = $sdkVm->undeploy();

$service->waitForTask($task);

 

 

but it expects a parameter and I am not sure exactly what it is looking for here...  Any code example of the use of the undeploy($someObjectHere) would be appreciated.

 

Update:

 

was able to just create an object of that type and pass it in:

 

$undeployparams = new VMware_VCloud_API_UndeployVAppParamsType();

$task = $sdkVm->undeploy($undeployparams);

$service->waitForTask($task);

 

VM deleted.


Viewing all articles
Browse latest Browse all 2039

Trending Articles



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