• Reducir el tamaño de un disco de una MV Proxmox

    La interfaz de Proxmox no nos permite reducir el tamaño del disco de una máquina virtual de PVE desde la interfaz web. Entonces, ¿cómo se consigue el truco?

    Pues primero, lógicamente, apagamos la máquina virtual. Luego:

    SI EL DISCO ESTÁ EN UN ALMACENAMIENTO LVM

    Para quitarle 5GB:

    lvreduce -L 5G /dev/pve/disk-name

    Para reducirlo a un tamaño total de 5GB

    lvreduce -L -5G /dev/pve/disk-name

    SI EL DISCO ES UN QCOW2

    qemu-img resize --shrink <vmfile.qcow2> [+-] or size

    SI EL DISCO ESTÁ EN UN ALMACENAMIENTO ZFS

    zfs set volsize=<new size>G rpool/data/vm-<vm id>-disk-<disk number>

     

     

    Luego:

    qm rescan

    Edit the vm config in /etc/pve/local/qemu-server/<vm id>.conf
    virtio0: local-zfs:vm-<vm id>-disk-<disk number>,size=<new size>G

    Change something in the Proxmox GUI panel (like cache mode) to see the updated config in the GUI

    Sometimes I’ve had to attach the HD to the VM as different Dev# i.e. change from virtio0 to virtio1 to trigger the guest OS to recognise the size change

    Optional: in the Guest OS extend the partition into any leftover fragment


    Deja una respuesta