How to over-write VMs in Export-Domain via REST API ?

Solution Verified - Updated -

Issue

  • The issue is, when a VM is already present in the export-domain and one tries to re-export the same VM again to the Export-domain, using the following curl syntax, one cannot achieve the same:
# curl --insecure -u admin@internal:***** -X POST -H "Accept: application/xml" -H "Content-type: 
application/xml" -d "<action><storage_domain><name>export</name></storage_domain><overwrite>true</overwrite>
<discard_snapshots>false</discard_snapshots></action>" https://rhevm.example.com:8443/api/vms/6925bb76-178e-4bf4-bfbf-f05c1adc0193/export
  • The curl syntax is executed from RHEV-Manager.

  • The following reply is returned:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
     <storage_domain>
         <name>export</name>
     </storage_domain>
     <discard_snapshots>false</discard_snapshots>
     <status>
         <state>failed</state>
     </status>
     <fault>
         <reason>Operation Failed</reason>
         <detail>[Cannot export VM. VM with the same identifier already exists.]</detail>
     </fault>
</action>
  • The tag has been used, which should overwrite the files on the export-domain.

  • This tag is completely being ignored and instead the following error is returned:

"Cannot export VM. VM with the same identifier already exists"

Environment

  • Red Hat Enterprise Virtualization 3.0
  • REST API

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In