-
-
Save cocampbe/f4437e6b7d666c0cd5a48cb60c795b57 to your computer and use it in GitHub Desktop.
Found this info here: http://blog.ls-al.com/oracle-vm-ovm-rest-api/ | |
Had trouble finding the rest calls to create a vm clone from a template. | |
## CloneVM failing | |
## The value for the argument "serverPoolId" was found to be null | |
def cloneVm(s,baseUri,templateVm,vmName): | |
repo_id=get_id_from_name(s,baseUri,'Repository','ovs1') | |
sp_id=get_id_from_name(s,baseUri,'ServerPool','ovs-home') | |
template_id=get_id_from_name(s,baseUri,'Vm',templateVm) | |
print 'clone {} into repo_id {:20} ServerPool Id {:55}'.format(template_id,repo_id,sp_id) | |
data={ "serverPoolId": sp_id, | |
"repositoryId": repo_id, | |
"createTemplate": False | |
} | |
uri='{base}/Vm/{vmId}/clone'.format(base=baseUri,vmId=template_id) | |
r=s.put(uri,data=json.dumps(data)) | |
job=r.json() | |
print job | |
# wait for the job to complete | |
vm_id=wait_for_job(job['id']['uri'],s) | |
print "new vm id:" + vm_id |
Can you please provide me the playbook for vm clone
Try my repo
Hi Team, Thanks, Can i use clone_vm library . I will execute this in ansible. Have you tested create clone vm from template. I am not using github..i am using ansible with awx. Is this work?
…
On Tue, Dec 17, 2019 at 6:38 PM Court @.***> wrote: Can you please provide me the playbook for vm clone Try my repo https://github.com/cocampbe/ansible-ovm — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://gist.github.com/f4437e6b7d666c0cd5a48cb60c795b57?email_source=notifications&email_token=AOBH73KYJZEESGE4VNNLTQLQZDFOHA5CNFSM4J3NUK2KYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAF6B5M#gistcomment-3113942, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOBH73MYAHKRSYMEEPTURJLQZDFOHANCNFSM4J3NUK2A .
-- Thanks & RegardsDivyalakshmi R
Yes, you are free to use it. Yes, I do builds with this library.
Hi Team, Thanks, Is possible provide the Vm_clone library using OVM CLI. I have checked provided vm_clone library and its use REST API.
…
On Tue, Dec 17, 2019 at 6:38 PM Court @.***> wrote: Can you please provide me the playbook for vm clone Try my repo https://github.com/cocampbe/ansible-ovm — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://gist.github.com/f4437e6b7d666c0cd5a48cb60c795b57?email_source=notifications&email_token=AOBH73KYJZEESGE4VNNLTQLQZDFOHA5CNFSM4J3NUK2KYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAF6B5M#gistcomment-3113942, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOBH73MYAHKRSYMEEPTURJLQZDFOHANCNFSM4J3NUK2A .
-- Thanks & RegardsDivyalakshmi R
You are free to create your own ansible modules that use the OVM CLI. I do not plan on writing modules that use the CLI.
Hi Team, How to get user input for vmnamr,cpu,memory,boot disk name in ansible for clone vm from template. If you have this type of playbook and library.please share to me
…
On Wed, 18 Dec 2019, 00:47 Divyalakshmi, @.> wrote: Hi Team, Thanks, Is possible provide the Vm_clone library using OVM CLI. I have checked provided vm_clone library and its use REST API. On Tue, Dec 17, 2019 at 6:38 PM Court @.> wrote: > Can you please provide me the playbook for vm clone > > Try my repo https://github.com/cocampbe/ansible-ovm > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > https://gist.github.com/f4437e6b7d666c0cd5a48cb60c795b57?email_source=notifications&email_token=AOBH73KYJZEESGE4VNNLTQLQZDFOHA5CNFSM4J3NUK2KYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAF6B5M#gistcomment-3113942, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AOBH73MYAHKRSYMEEPTURJLQZDFOHANCNFSM4J3NUK2A > . > -- Thanks & RegardsDivyalakshmi R
For building VMs I use the clone library to first create a VM from a template. I then use the ovm_modify module to change the cpu and memory.
Hi Team,
I have already tried this ovm_clone and working fine. ThanksI need help for i have to give input in ovm_clone based on the input cvm clone create from template with ,The below input asked from user1.vm name2.repository3.server name4.cpu5.memory6.nic card details.
Please provide me the python library and playbook for this.
Can you please provide me the playbook for vm clone