<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[REST API create_vm returns task URL that doesn't exist?]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I'm currently creating VMs via the REST API endpoint:</p>
<p dir="auto">POST /rest/v0/pools/${poolId}/actions/create_vm</p>
<p dir="auto">Everything works great so far, but since I'm managing VMs externally via my own panel, I need the UUID of the newly created VM as part of the response.</p>
<p dir="auto">Right now, my workaround is to cache all existing VMs beforehand, use a very unique name (including a timestamp) when creating the VM, and then scan all VMs afterward to find the new one by matching the name — from which I can extract the UUID. This works, but it's far from efficient, especially since I have to query every single VM individually to get the name_label.</p>
<p dir="auto">However, I noticed that the API call returns something like this:</p>
<p dir="auto">XOA success response: "/rest/v0/tasks/0mcmb9kba"</p>
<p dir="auto">But as far as I can tell, there is no /rest/v0/tasks endpoint available in the REST API. So... why does create_vm return a reference to a resource that doesn't exist?</p>
<p dir="auto">I was quite excited at first, thinking this would let me track the task and maybe get the VM UUID without extra API calls — but it seems like a dead end.</p>
<p dir="auto">@devs – Is there any timeline on when this /tasks route will be available? And in the meantime, could you consider not returning references to non-existent endpoints? It's a bit misleading and made me waste some time debugging something that doesn't exist (yet?).</p>
<p dir="auto">Thanks in advance!</p>
]]></description><link>https://xcp-ng.org/forum/topic/11023/rest-api-create_vm-returns-task-url-that-doesn-t-exist</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 00:56:16 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/11023.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Jul 2025 19:01:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to REST API create_vm returns task URL that doesn't exist? on Tue, 09 Jun 2026 09:18:22 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/devflint" aria-label="Profile: DevFlint">@<bdi>DevFlint</bdi></a>,<br />
tasks are now correctly visible in the swagger documentation</p>
]]></description><link>https://xcp-ng.org/forum/post/106095</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/106095</guid><dc:creator><![CDATA[MathieuRA]]></dc:creator><pubDate>Tue, 09 Jun 2026 09:18:22 GMT</pubDate></item><item><title><![CDATA[Reply to REST API create_vm returns task URL that doesn't exist? on Thu, 03 Jul 2025 08:41:23 GMT]]></title><description><![CDATA[<p dir="auto">This is normal, as the <code>tasks</code> endpoints are in the old REST API (undocumented by Swagger).<br />
We are gradually migrating to the new REST API to document all endpoints.</p>
]]></description><link>https://xcp-ng.org/forum/post/94784</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/94784</guid><dc:creator><![CDATA[MathieuRA]]></dc:creator><pubDate>Thu, 03 Jul 2025 08:41:23 GMT</pubDate></item><item><title><![CDATA[Reply to REST API create_vm returns task URL that doesn't exist? on Thu, 03 Jul 2025 08:38:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/mathieura" aria-label="Profile: MathieuRA">@<bdi>MathieuRA</bdi></a> I can’t find any documentation of /tasks/ in swagger, I am on the newest Version of XOA</p>
]]></description><link>https://xcp-ng.org/forum/post/94783</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/94783</guid><dc:creator><![CDATA[DevFlint]]></dc:creator><pubDate>Thu, 03 Jul 2025 08:38:55 GMT</pubDate></item><item><title><![CDATA[Reply to REST API create_vm returns task URL that doesn't exist? on Thu, 03 Jul 2025 08:36:30 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/devflint" aria-label="Profile: DevFlint">@<bdi>DevFlint</bdi></a>.<br />
<code>/rest/v0/tasks/:id</code> exists. It's not yet documented in Swagger, but it does exist.</p>
<p dir="auto">FYI, "actions" endpoint are specific.<br />
They can be executed asynchronously (which is what you're currently doing). In this case, a task is returned and needs to be monitored. Use <code>/rest/v0/tasks/:id</code> for this.<br />
You can also execute your action synchronously by using <code>sync=true</code> as a query parameter. In this case, the VM ID will be returned in response.</p>
<p dir="auto">This should normally be documented in Swagger. If it's not clear in the documentation, we can improve it <img src="https://xcp-ng.org/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=f084dd9e819" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://xcp-ng.org/forum/post/94782</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/94782</guid><dc:creator><![CDATA[MathieuRA]]></dc:creator><pubDate>Thu, 03 Jul 2025 08:36:30 GMT</pubDate></item><item><title><![CDATA[Reply to REST API create_vm returns task URL that doesn't exist? on Thu, 03 Jul 2025 08:34:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/devflint" aria-label="Profile: DevFlint">@<bdi>DevFlint</bdi></a> the https://XOA_URL/rest/v0/tasks endpoint exists, but it's not yet documented through swagger</p>
<p dir="auto">you should be able to add ?sync=true to the url to get the immediate result, but it can fail with a timeout if the creation takes too much time ( for example : migrating a big template )</p>
]]></description><link>https://xcp-ng.org/forum/post/94781</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/94781</guid><dc:creator><![CDATA[florent]]></dc:creator><pubDate>Thu, 03 Jul 2025 08:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to REST API create_vm returns task URL that doesn't exist? on Wed, 02 Jul 2025 19:17:03 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Let me ask the XO team via <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/lsouai-vates" aria-label="Profile: lsouai-vates">@<bdi>lsouai-vates</bdi></a></p>
]]></description><link>https://xcp-ng.org/forum/post/94775</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/94775</guid><dc:creator><![CDATA[olivierlambert]]></dc:creator><pubDate>Wed, 02 Jul 2025 19:17:03 GMT</pubDate></item></channel></rss>