I'm not sure if this is an Ansible, or a Proxmox question, but I've got to start somewhere...
I can create and/or clone a QEMU VM in Proxmox using Ansible's
I therefore tried to use
Ignoring the crud, the pertinent lines above are the code being ran
I realise that the command needs to be run as the
I've tried the default, which is to use
And I've tried used a variation which uses
Both fail.
The command itself works as I can SSH in and run the command, with the
As background, this is on a recently rebuilt Proxmox host with no live data. I therefore re-installed this morning, just in-case I'd inadvertently meddled with something and broken it. This is a standalone Proxmox instance - no clustering. I also tried on another Proxmox instance and got the same results.
I could potentially use Ansible to manipulate the Proxmox REST API, but it would be much simpler if I could get a simple command to work.
Any ideas?
Thanks.
I can create and/or clone a QEMU VM in Proxmox using Ansible's
community.general.proxmox_kvm
module. However, that module's documentation specifically states that it cannot resize a disk.I therefore tried to use
qm resize <vm> <disk> <new size>
from Ansible. I used the command
, shell
and raw
modules in turn and they all failed with:
JSON:
"invocation": {
"module_args": {
"_raw_params": "/usr/sbin/qm resize 100 scsi0 3G",
"_uses_shell": false,
"argv": null,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"stdin_add_newline": true,
"strip_empty_ends": true,
"warn": false
}
},
"msg": "non-zero return code",
"rc": 21,
"start": "2021-10-13 07:57:11.688857",
"stderr": "ipcc_send_rec[1] failed: Is a directory\nipcc_send_rec[2] failed: Is a directory\nipcc_send_rec[3] failed: Is a directory\nUnable to load access control list: Is a directory",
"stderr_lines": [
"ipcc_send_rec[1] failed: Is a directory",
"ipcc_send_rec[2] failed: Is a directory",
"ipcc_send_rec[3] failed: Is a directory",
"Unable to load access control list: Is a directory"
Ignoring the crud, the pertinent lines above are the code being ran
/usr/sbin/qm resize 100 scsi0 3G
, the return code (21) and the ipcc_send_rec
messages.I realise that the command needs to be run as the
root
user so I've used the become
directive within the playbook:I've tried the default, which is to use
sudo
:
Code:
become: yes
And I've tried used a variation which uses
su
:
Code:
become: yes
become_method: su
Both fail.
The command itself works as I can SSH in and run the command, with the
root
account or with a normal account and sudo
. Also, other non Proxmox related Ansible commands which require privilege elevation work.As background, this is on a recently rebuilt Proxmox host with no live data. I therefore re-installed this morning, just in-case I'd inadvertently meddled with something and broken it. This is a standalone Proxmox instance - no clustering. I also tried on another Proxmox instance and got the same results.
I could potentially use Ansible to manipulate the Proxmox REST API, but it would be much simpler if I could get a simple command to work.
Any ideas?
Thanks.