Increase Disk Size
Increase Disk Size
Broad Summary for Experienced Sadmins
- Snapshot the Volume
- Increase Volume size
- Extend any VGs & LVs
- Extend Filesystem
Full Steps
-
Connect to proxmox
-
select the vm to edit
-
click
Hardwareon the left menu in the VM -
click the disk to increase the size of
-
click the
Disk Actionsbutton at the top -
click
Rezize -
set the amount of extra space to add, not the total space used
-
click
Resize Disk -
Extend the partition
growpart /dev/sde 1[!NOTE] If you're working with NVMe names, it will be more like:
growpart /dev/nvme0n1 1
Increase LVM Size
Broad Summary for Experienced Sadmins
- Follow initial steps if not already completed
- Increase Volume size
- Extend any VGs & LVs
- Extend Filesystem
- Add intended changes to a PR in the relevant git repo
Full Steps
Increasing size of a single EBS Volume used within an LVM
-
Check the Used and Available storage for the Physical Volume, which should show the addtional space added under PFree
pvsPV VG Fmt Attr PSize PFree /dev/sde1 vg_mysql_data lvm2 a-- <12.00t 4.00t -
Extend the Physical Volume to the full size of the physical device
pvresize /dev/sde1 -
Check the Used and Available storage for the Volume Group, which should show the addtional space added under VFree
vgsVG #PV #LV #SN Attr VSize VFree vg_mysql_binlogs 1 1 0 wz--n- <20.00g 0 vg_mysql_data 1 1 0 wz--n- <12.00t 4.00t -
Extend your Logical Volume to the full size of the Volume Group using the
/dev/<vgname>/<lvname>formatlvextend -l +100%FREE /dev/vg_mysql_data/lv_mysql_data -
Check the Used and Available storage for the Logical Volume, which should show the additional space added under LSize
LV VG Attr LSize lv_mysql_binlogs vg_mysql_binlogs -wi-ao---- <20.00g lv_mysql_data vg_mysql_data -wi-ao---- <12.00t -
Resize the filesystem with either resize2fs, xfs_growfs, etc. using the
/dev/<vgname>/<lvname>formatresize2fs /dev/vg_mysql_data/lv_mysql_data -
Check the Used and Available storage for the Filesystem
df -hFilesystem Size Used Avail Use% Mounted on /dev/mapper/vg_mysql_data-lv_mysql_data 12T 7.6T 3.8T 67% /mnt/mysql_data
Add changes to Terraform
- Next, make sure your changes are reflected in terraform.
- For example, if you've just increased your disk from 8TB to 12TB, your terraform code may look like this:
server = { nodes_ids = ["01"] nodes_ami = ["ami-be773nD9ddf4b09ae0"] nodes_types = ["x2iedn.32xlarge"] nodes_root_vol = [ ["", "16", true] ] nodes_disks = [ ["8192", "20"] - Increase it to match the amount you've increased the disk in AWS. The important part here is
nodes_disks:
nodes_disks = [
["12288", "20"]
- Push these changes to a new branch and create a PR as soon as possible.
[!NOTE] Changes outside of terraform can be destructive if they are not matched by source code. Make sure your changes are always documented in pull requests - it doesn't hurt to make your intentions visible to the team!