Resize ARTESCA+ VM Volumes

This procedure describes how to resize the volumes of a ARTESCA+ VM.

Check the Available Space in the Volume Group (VG)

  1. Get the free space available of vgartesca Volume Group (VG)

    [artesca-os@bootstrap ~]$
    
    sudo vgs /dev/vgartesca --unit g -o free
    
    VFree
    600.00g
    

Resize the Volume

  1. Find the LVM logical volume name you want to resize.

    [artesca-os@bootstrap ~]$
    
    sudo lvs --unit g /dev/vgartesca/vm-*-disk
    
  2. Set the LV_NAME variable.

    Note

    Replace <LV_NAME> by the name of the actual Logical Volume (LV) identified in the previous command output.

    [artesca-os@bootstrap ~]$
    
    export LV_NAME="<LV_NAME>"
    
  3. Set the LV_EXPANSION_SIZE variable.

    [artesca-os@bootstrap ~]$
    
    export LV_EXPANSION_SIZE="10G"
    
  4. Resize the Logical Volume (LV).

    [artesca-os@bootstrap ~]$
    
    vol_fstype=$(lsblk -o FSTYPE -n /dev/vgartesca/$LV_NAME); \
    if [ "$vol_fstype" == "ext4" ]; then \
      sudo lvextend --size +$LV_EXPANSION_SIZE --resizefs /dev/vgartesca/$LV_NAME; \
      vol_mnt=$(lsblk -o MOUNTPOINT -n /dev/vgartesca/$LV_NAME); \
      sudo salt-call --local cmd.run "truncate -s +${LV_EXPANSION_SIZE} ${vol_mnt}/disk.img"; \
    else \
      sudo lvextend --size +$LV_EXPANSION_SIZE /dev/vgartesca/$LV_NAME; \
    fi
    
  5. Get the VM name.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl --kubeconfig=/etc/kubernetes/admin.conf get vm -n veeam
    
    NAME             AGE   STATUS     READY
    vbr-1234         63d   Running    True
    
  6. Restart the VM to apply the changes (replace <VM_NAME> by the actual VM name returned by the previous command).

    [artesca-os@bootstrap ~]$
    
    sudo virtctl --kubeconfig=/etc/kubernetes/admin.conf restart -n veeam <VM_NAME>
    

Important

Now the VM disk is resized. You can proceed with resizing the corresponding filesystem inside the VM.