Clone a Container on Proxmox using Ansible

Gaurav Sood

New Member
Mar 27, 2019
2
0
1
41
hello Proxmox experts,

I'm trying to clone a container from a clone in my Proxmox LAB setup.

I have a template with name "Ansible-Gold" converted from a container to template. When i try to create a FULL clone from GUI it works and no issues.

However, when i am trying to clone a container using above mentioned template using Ansible it's not working,

```
---
- name: 'prep proxmox hosts for automation'
hosts: 'prox'
gather_facts: false

tasks:
- proxmox_kvm: api_user='root@pam' api_password='password' api_host='10.0.0.106' clone='Ansible-Gold' name='Demo-Ansible' format='qcow2' timeout='200' node='pve'

```

Questions

a) Is it possible to clone a container in Proxmox using Ansible ?
b) if yes, is it going to be module "proxmox" or "proxmox_kvm" ?

As i am not able to find source option under "proxmox" module, so, i think promox module is not the correct candidate. I may be wrong.

Here is the error code i am getting when executing the above mentioned playbook

msg": "Unable to clone vm Demo-Ansible from vmid 102=500 Internal Server Error: {\"data\":null}"

Thanks in advance..

GS
 
a) Is it possible to clone a container in Proxmox using Ansible ?
b) if yes, is it going to be module "proxmox" or "proxmox_kvm" ?
The ansible modules do not come from Proxmox.
I personal use the shell command to clone guests.
 
Thank you for the reply,Wolfgang.

I realized after doing some more research and ended up using shell module.

GS
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!