[TUTORIAL] 500 Internal Server Error: mount points configured, but 'rootfs' not set - aborting

Crasher_

New Member
May 6, 2023
1
0
1
Dear All,

I'm new in proxmox 7.4-3. I deploy automation in ansible. Everything is fine, ct is creating, but when i add "mounts:" :

mounts: '{"mp0":"local:8,mp=/mnt/test/"}'

i see the following error:

fatal: [192.168.122.63]: FAILED! => {"changed": false, "msg": "Creation of lxc VM 205 failed with exception: 500 Internal Server Error: mount points configured, but 'rootfs' not set - aborting"}

I see on our forum that on proxmox terminal is common uses:

--rootfs local-lvm:8 (f.e. pct create 100 local:vztmpl/debian-10.0-standard_10.0-1_amd64.tar.gz --rootfs local-lvm:8)

How can I implement it in my ansible auto script?

My playbook's look like:

YAML:

- name: Test connectivity to target servers
hosts: all
run_once: true
gather_facts: false
tasks:
- name: Create CT
community.general.proxmox:
api_host: devops
api_user: root@pam
api_password: 123zxc
api_token_id: yyy
api_token_secret: xxx
node: devops
hostname: testct
password: 123zxc
ostemplate: 'local:vztmpl/centos-7-default_20190926_amd64.tar.xz'
vmid: 205
description: created with ansible
cores: 2
timeout: 60
netif: '{"net0":"name=eth0,ip=dhcp,ip6=dhcp,bridge=vmbr0"}'
mounts: '{"mp0":"local:8,mp=/mnt/test/"}'
features: nesting=1
memory: 1024
swap: 1024
nameserver: 192.168.122.1
searchdomain: devops.local
unprivileged: 1
onboot: true
 
Last edited:
Late answer but...

You need to define a "rootfs" entry before assigning mount points.

In your case, mounts should be something like:

'{"rootfs": "local:8", "mp0":"local:8,mp=/mnt/test/"}'

Using Ansible you need to make sure the "mounts" values are a dict containing both rootfs and the mount points you want to use.
The easiest way would be to declare them in inventory, as a persistence value or something like this, and to retrieve this persistence variable, as a dict, in your playbook or role.

Good luck !
 

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!