qm set command, can't delete "args" , stuck pending

locusofself

Member
Mar 29, 2016
39
3
8
40
I have an ansible playbook that clones a debian template, sets some kernel arguments via qm command, boots the VM, and then is supposed to remove the kernel arguments, so they would only be used/seen on first boot. I based my method off of this excellent guide: https://morph027.gitlab.io/post/pve-kickseed/ , but prefer to use a template instead of preseeding for speed and less package downloads.

My issue is that the command to delete the args produces no error, but the deletion of the args is stuck in [pending] state in the VM conf file as seen below. Anyone know how to fix this?




root@pxmx09:~# qm set 112 -delete args
update VM 112: -delete args
root@pxmx09:~#



root@pxmx09:~# cat /etc/pve/nodes/pxmx09/qemu-server/112.conf
#vpntest.haloprivacy.com
args: -kernel /tmp/vmlinuz -initrd /tmp/initrd.img -append 'root=/dev/mapper/debian--vg-root HaloFirstRun ipaddress=10.93.56.45 netmask=255.255.255.0 gateway=10.93.56.1 hostname=vpntest.*****.com nameserver1=8.8.8.8 nameserver2=4.2.2.2'
bootdisk: scsi0
cores: 1
ide2: local:iso/debian-8.5.0-amd64-netinst.iso,media=cdrom
memory: 1024
name: vpntest.*****com
net0: e1000=66:CC:25:0C:6E:A3,bridge=vmbr0,tag=23
numa: 0
ostype: l26
scsi0: local:112/vm-112-disk-1.qcow2,size=32G
scsihw: virtio-scsi-pci
smbios1: uuid=8926ad99-e260-401b-8a64-5c69fb4deb2d
sockets: 1

[PENDING]
delete: args
 
As it turns out, I needed to *shut down* the VM and not just reboot it , before this change would go into effect. So I guess I will have to program a shutdown and qm start into my ansible playbooks. Hmm.
 
Changing 'args' is not hot-plug able, so it goes into pending unless you stop/start the VM. But this change only effects the VM when you start it, so I think there is no need to do anything from your side.
 
Jip, also faced a preseed loop in my firsts tests ;) But in my blog, there is line which claims to power off the vm. I'm going to emphasize it a bit more :)

Ah, will take a look. Must have missed that, thanks for the guide though. Was very helpful

Are you using this module https://github.com/ansible/ansible-modules-extras/pull/3292 or some self written playbooks?

I had not seen this module, just wrote one with qm commands myself, based on your blog. I just include a shell script in my debian VM template, called by /etc/rc.local , which parses the /proc/cmdline to set the ip,subnet,gateway,dns of the VM ;) pretty handy. Could do the same with DHCP I'm sure, but I wanted to assign VMs to specific VLAN from the very start.
 
FWIW, its working just fine with ansible just waiting for the VM to come online, then shutting it down via shutdown -h , then using qm start command delegated to proxmox node to power it up again. Only adds ~10 seconds to the playbook run and only needs to happen once so not a big deal ;)
 

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!