[SOLVED] cloud-init limited at 1 GB

Oct 17, 2008
96
6
73
48
Netherlands
Hello,

I don't know if it was also on 6 but since the upgrade from PVE 6 to 7 i cannot add more memory to the VM.

When i add another GB of mem, it stays at 927MB


It is based on the template made with this command:

qm create 9001 -name UB-2004-CI-20210803 --memory 2048 --net0 virtio,bridge=vmbr0

Adding more CPU works tho...

Any idea?
 
Last edited:
is the vm running? if yes, the change is 'pending' (in the ui it is orange) and you need to shut off the vm and start it again for it to be changed
 
can you post the vm config before and after, as well as the command you execute?
 
These are the commands:

wget https://cloud-images.ubuntu.com/focal/20210803/focal-server-cloudimg-amd64-disk-kvm.img
mv focal-server-cloudimg-amd64-disk-kvm.img focal-server-cloudimg-amd64-disk-kvm.qcow2
qm importdisk 9001 focal-server-cloudimg-amd64-disk-kvm.qcow2 Pool_dedup_comp
qm set 9001 -scsihw virtio-scsi-pci -virtio0 Pool_dedup_comp:vm-9001-disk-0
qm set 9001 -boot c -bootdisk virtio0
qm set 9001 -agent 1
qm set 9001 -hotplug disk,network,usb
qm set 9001 -ide2 Pool_dedup_comp:cloudinit
qm resize 9001 virtio0 +17G
qm set 240 -serial0 socket
qm template 9001

After that i adjusted the template to have 2GB instead, 2vcpu's, the cloud-init settings through the GUI.

qm clone 9001 240 --name OPS-test2 --full --storage Pool_dedup_comp
 
Last edited:
so you change the memory on the template and the memory on the clone stays the same? thats intended. the configuration of the template does not change the already cloned guests, this will only be copied on every subsequent clone...
 
Strange, i will start from scratch.
Tried so many times to duplicate the template to a new machine but the memory stays at 1 Gbyte.

Someone has a good guideline to create a cloudimage-setup?
 
Last edited:
Hi !

I know this post is a bit old, but this could help some people.

You may have different options in order to fix this :
  • Disable hot-plug option in proxmox for this VM
  • Trigger the kernel to use all available memory (virtual memory are available with hotplug but not online) :

Code:
cd /sys/devices/system/memory

for F in memory*
do
  if [ $(cat "$F/state") != "online" ]
  then
    echo "online" > "$F/state"
  fi
done

  • Enable it dynamicaly with udev :
Code:
cat <<EOF > /lib/udev/rules.d/80-hotplug-cpu-mem.rules2
SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1"
SUBSYSTEM=="memory", ACTION=="add", TEST=="state", ATTR{state}=="offline", ATTR{state}="online"
EOF

This should no longer be necessary on recent kernels with memhp_default_state but there seems to be a bug still present.

Kind regards
 
  • Like
Reactions: Andrzej Zawadzki