Ansible - Deploy VM from Clone instance

dudenamedben

New Member
Sep 10, 2021
15
2
3
Playbook as follows:
- name: Create a full clone
hosts: PVE201
tasks:
- name: Create a full clone of 900
community.general.proxmox:
api_host: 192.168.90.201
api_user: root@pam
api_password: Passwrod
clone: 900 # vmid to clone
clone_type: full
cores: 2 # number of cores per cpu socket
cpus: 2 # number of cpu sockets
description: "Ubuntu 22.04 TEST"
disk: 10 # disk size in GB
hostname: ubuntu-2204-test
memory: 2048 # memory in MB
node: pve201
storage: pve_disks
vmid: 777 # new vmid

However, receiving internal server error 500 Configuration file does not exist nodes/pve201/lxc/900.conf - this is correct this is no 900.conf file

This is a standalone PVE server, not in a cluster.

I must specify the node value in the playbook.

What is wrong here?
 
Hi,

500 Configuration file does not exist nodes/pve201/lxc/900.conf - this is correct this is no 900.conf file
This simply means that there is no CT/template with the vmid 900. Are you sure this is the correct ID to clone?

Please post the output of pveversion -v and ls -lah /etc/pve/nodes/pve201/lxc/.
 
@cheiss thanks for the reply.

VMID 900 is the Ubuntu template VM that I clone in the GUI.

pveversion -v
Bash:
proxmox-ve: 7.4-1 (running kernel: 5.15.108-1-pve)
pve-manager: 7.4-16 (running version: 7.4-16/0f39f621)
pve-kernel-5.15: 7.4-4
pve-kernel-5.13: 7.1-9
pve-kernel-5.11: 7.0-10
pve-kernel-5.15.108-1-pve: 5.15.108-2
pve-kernel-5.15.102-1-pve: 5.15.102-1
pve-kernel-5.15.83-1-pve: 5.15.83-1
pve-kernel-5.13.19-6-pve: 5.13.19-15
pve-kernel-5.13.19-2-pve: 5.13.19-4
pve-kernel-5.11.22-7-pve: 5.11.22-12
pve-kernel-5.11.22-1-pve: 5.11.22-2
ceph-fuse: 15.2.13-pve1
corosync: 3.1.7-pve1
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown2: 3.1.0-1+pmx4
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.24-pve2
libproxmox-acme-perl: 1.4.4
libproxmox-backup-qemu0: 1.3.1-1
libproxmox-rs-perl: 0.2.1
libpve-access-control: 7.4.1
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.4-2
libpve-guest-common-perl: 4.2-4
libpve-http-server-perl: 4.2-3
libpve-rs-perl: 0.7.7
libpve-storage-perl: 7.4-3
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 5.0.2-2
lxcfs: 5.0.3-pve1
novnc-pve: 1.4.0-1
proxmox-backup-client: 2.4.3-1
proxmox-backup-file-restore: 2.4.3-1
proxmox-kernel-helper: 7.4-1
proxmox-mail-forward: 0.1.1-1
proxmox-mini-journalreader: 1.3-1
proxmox-offline-mirror-helper: 0.5.2
proxmox-widget-toolkit: 3.7.3
pve-cluster: 7.3-3
pve-container: 4.4-6
pve-docs: 7.4-2
pve-edk2-firmware: 3.20230228-4~bpo11+1
pve-firewall: 4.3-5
pve-firmware: 3.6-5
pve-ha-manager: 3.6.1
pve-i18n: 2.12-1
pve-qemu-kvm: 7.2.0-8
pve-xtermjs: 4.16.0-2
qemu-server: 7.4-4
smartmontools: 7.2-pve3
spiceterm: 3.2-2
swtpm: 0.8.0~bpo11+3
vncterm: 1.7-1
zfsutils-linux: 2.1.11-pve1

Code:
root@pve201:~# ls -lah /etc/pve/nodes/pve201/lxc/
total 0
drwxr-xr-x 2 root www-data 0 Oct  4  2021 .
drwxr-xr-x 2 root www-data 0 Oct  4  2021 ..
root@pve201:~#
 
@cheiss
Code:
root@pve201:~# qm list
      VMID NAME                 STATUS     MEM(MB)    BOOTDISK(GB) PID
       202 WinSVR2019           stopped    2048              60.00 0
       204 thames-prod-core1    stopped    2048              60.00 0
       205 thames-prod-motion1  stopped    2048              60.00 0
       213 Docker1              stopped    8192              32.00 0
       226 MOT1                 stopped    2048              60.00 0
       231 VERSIO-METAL-CS1     stopped    4096              60.00 0
       301 Win10Pro-JUMP-JR     stopped    8192              60.00 0
       302 Win10Pro-JUMP-JI     stopped    8192              60.00 0
       601 HA1                  stopped    1024              32.00 0
       701 PG1-UBUNTU           stopped    1024              32.00 0
       702 PG2-UBUNTU           stopped    1024              32.00 0
       704 PG4-UBUNTU           stopped    1024              32.00 0
       801 SRT                  stopped    1024              32.00 0
       900 Ubuntu-2204-template stopped    1024              32.00 0
       999 Monitor              stopped    4096              32.00 0
root@pve201:~#
 
@cheiss located the conf file - under qemu-server dir not the lxc folder. However, when I cp the .conf file I am told that the file exists already. Same if I attempt to touch the file, apparently it exists... but dir (ls -al) shows no files.
 
error resolved - using wrong ansible module! needed to use the community.general.proxmox_kvm module not the community.general.proxmox which is used for LXC! My bad. thanks for the replies.
 
Great to hear you solved it!

Please just mark the thread as solved by editing the first post - there should be a dropdown near
the title field. This helps other people with the same problem to more easily find this thread in
the future! :)
 

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!