Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
Merge pull request #13 from ClaudiuPID/master
Browse files Browse the repository at this point in the history
KVM clone VM/template
  • Loading branch information
Daemonthread committed Mar 13, 2014
2 parents 9afa87c + 8733c1f commit 119df6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -219,6 +219,10 @@ Requires a dictionary of tuples formatted [('postname1','data'),('postname2','da

createVirtualMachine(node,post_data)
"Create or restore a virtual machine. Returns JSON
Requires a dictionary of tuples formatted [('postname1','data'),('postname2','data')]"

cloneVirtualMachine(node,vmid,post_data)
"Create a copy of virtual machine/template. Returns JSON
Requires a dictionary of tuples formatted [('postname1','data'),('postname2','data')]"

resetVirtualMachine(node,vmid)
Expand Down
8 changes: 8 additions & 0 deletions src/pyproxmox.py
Expand Up @@ -388,6 +388,14 @@ def createVirtualMachine(self,node,post_data):
data = self.connect('post',"nodes/%s/qemu" % (node), post_data)
return data

def cloneVirtualMachine(self,node,vmid,post_data):
"""
Create a copy of virtual machine/template
Requires a dictionary of tuples formatted [('postname1','data'),('postname2','data')]
"""
data = self.connect('post',"nodes/%s/qemu/%s/clone" % (node,vmid), post_data)
return data

def resetVirtualMachine(self,node,vmid):
"""Reset a virtual machine. Returns JSON"""
post_data = None
Expand Down

0 comments on commit 119df6c

Please sign in to comment.