I have a persistent disk of 100GB attached to a VM instance. But I don\'t need all that space, and thus don\'t want to be billed for it. It has some data as
This is not possible TMK. You'll need to create another disk and copy the data over, though you can expand a snapshot to a larger disk.
I had to recently just do this. I originally created a disk 500GB, but quickly realized that was a mistake as the disk is only using 20GB.
The high-level process involves creating a new instance with the desired smaller disk size. Stopping all services that write to the larger disk (think MySQL/MongoDB, NGINX/Apache, etc). Then, using rsync
copy over all files from the larger disk to the smaller disk excluding a subset of instance specific data.