You can choose to expand the existing vmdk or to add a new one.
Adding a new vmdk is the most easy path:
- detect the new storage device (LINK)
- create a new partition on the new device with fdisk
- create a new physical volume (PV) on the new partition (pvcreate /dev/sdXN)
- add the new PV to the volume group ("vgextend /dev/sdXN vgname" where vgname in you case is centos)
- extend the logical volumes with lvextend (lvextend -L SIZE /dev/centos/lvname)
- resize filesystem (resize2fs /dev/centos/lvname for ext filesystem, xfs_growfs /dev/centos/lvname for xfs for example)
You can also extend the actual vmdk, detect the new device size (the easiest way is to reboot) and create a new partition, then follow the previous commands using a new partition on the same device (for example /dev/sda3 instead of /dev/sda2).
Or you can extend the actual vmdk and extend the existing pv /dev/sda2, but in this case you must
- delete the /dev/sda2 partition and create it again starting from the very same starting block (that's very important!)
- extend the pv with pvresize command (pvresize /dev/sda2)
- extend the LV
For swap logical volume you must deactivate the actual swap (swapoff /dev/centos/swap), extend the lv (lvextend), create the new swap space (mkswap /dev/centos/swap) and enable the swap (swapon /dev/centos/swap)
I hope this will helpful