[ovirt-users] JavaAPI exporting VM

David David dd432690 at gmail.com
Fri Apr 7 13:04:22 UTC 2017


Hello.

Can't reexport a VM if this VM is already present in the export domain

With Java api:



*VM vm = api.getVMs().get("vm01");StorageDomain exportDomain =
api.getStorageDomains().get("export");   *







*Action act = vm.exportVm(new Action() {    {
setExclusive(True);        setDiscardSnapshots(True);
setStorageDomain(exportDomain);    }});*

And following error is returned:

Exception in thread "main"
code  : 409
reason: Conflict
detail: Cannot export VM. VM with the same identifier already exists.
    at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:120)
    at
org.ovirt.engine.sdk.web.HttpProxyBroker.add(HttpProxyBroker.java:209)
    at
org.ovirt.engine.sdk.web.HttpProxyBroker.action(HttpProxyBroker.java:153)
    at org.ovirt.engine.sdk.decorators.VM.exportVm(VM.java:784)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20170407/2278c8d2/attachment.html>


More information about the Users mailing list