Skip to main content
Solved

How to Implement API Post data to clone a VM

  • January 23, 2021
  • 3 replies
  • 961 views

Forum|alt.badge.img+1

Hi,

For my user, i want to create a web page where i can implement API Post data to clone a vm via clicking on a button .User just have to enter his credentials, vm uuid to be cloned is already decided by web developer inserted in web page already.

Is there any way to implement API data in web page where on clicking html button ,post data will be sent to server

OR

Is there any Powersehll cmdlet script to create vm and launch console.?

Best answer by AnishWalia20

Hey, @Balram check this post out for more details :
https://next.nutanix.com/server-virtualization-27/vm-creation-automation-37960

 

 

You can check out the Powershell commands under Acropolis Task administration(2nd column in the above screenshot) to Clone, create a new VM, add vDisk to it, add VMNIC to it etc.

 

There is also a REST API v2 POST method to /clone a VM: https://www.nutanix.dev/reference/prism_element/v2/api/vms/post-vms-uuid-clone-clonevm/

 

I hope this helps.:smile:

This topic has been closed for replies.

3 replies

AnishWalia20
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • Answer
  • January 25, 2021

Hey, @Balram check this post out for more details :
https://next.nutanix.com/server-virtualization-27/vm-creation-automation-37960

 

 

You can check out the Powershell commands under Acropolis Task administration(2nd column in the above screenshot) to Clone, create a new VM, add vDisk to it, add VMNIC to it etc.

 

There is also a REST API v2 POST method to /clone a VM: https://www.nutanix.dev/reference/prism_element/v2/api/vms/post-vms-uuid-clone-clonevm/

 

I hope this helps.:smile:


Forum|alt.badge.img+1
  • Author
  • Adventurer
  • January 25, 2021

 I have tried REST API via curl and swagger.js. Can i implement REST API Post data in web page button eg- In a form, user enter username and password ,vm uuid predefined, on submit button, vm will cloned via sending POST API data prism server.


AnishWalia20
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • January 25, 2021

Hey @Balram , I personally have never tried it, but I think it should work. Give it a try and do let us know. :sweat_smile: