Hello there Proxmox Community!
I registered because I am stuck with my management of Proxmox VMs with the ansible proxmox_kvm module.
What I want to achieve:
I want to be able to create a new vm based on a template vm. I am trying to use the clone feature to achieve that with the following playbook:
The VM in step one gets created as specified but the cloning simply return "OK" and does not change anything. The proxmox server has a vm with id 9000 which is a vm which got turned into a template. I must be missing something, because I really dont know why it wont clone or thinks that there is nothing to change...
If I understood that correctly cloning a VM needs an already created VM as target. I dont know what prerequisites that created VM needs for a clone to be successful. I would expect, that a clone clones everything, but I wasnt sure how it handled references to disks, so I created the target VM with its own scsi0 storage (which unfortunately didnt help either).
Any help or hints are appreciated
I registered because I am stuck with my management of Proxmox VMs with the ansible proxmox_kvm module.
What I want to achieve:
I want to be able to create a new vm based on a template vm. I am trying to use the clone feature to achieve that with the following playbook:
YAML:
- hosts: "pve-staging"
tasks:
- name: Create VM
community.general.proxmox_kvm:
api_user: root@pam
api_password: "redacted"
api_host: pve-staging
name: TestVM
node: pve-staging
vmid: 503
- name: Waiting to apply changed in disk
wait_for:
timeout: 10
- name: Clone VM with source vmid and target newid and raw format
community.general.proxmox_kvm:
api_user: root@pam
api_password: "redacted"
api_host: pve-staging
net:
net0: 'virtio,bridge=vmbr0'
scsihw: virtio-scsi-pci
scsi:
scsi0: 'data:10,format=raw'
ostype: l26
vga: serial0
bootdisk: scsi0
clone: arbitrary
vmid: 9000
newid: 503
name: TestVM
full: yes
storage: data
format: raw
node: pve-staging
The VM in step one gets created as specified but the cloning simply return "OK" and does not change anything. The proxmox server has a vm with id 9000 which is a vm which got turned into a template. I must be missing something, because I really dont know why it wont clone or thinks that there is nothing to change...
If I understood that correctly cloning a VM needs an already created VM as target. I dont know what prerequisites that created VM needs for a clone to be successful. I would expect, that a clone clones everything, but I wasnt sure how it handled references to disks, so I created the target VM with its own scsi0 storage (which unfortunately didnt help either).
Any help or hints are appreciated
Last edited: