Are there any scripts that automate persistent disks formatting and attaching to the Google Cloud VM instance, instead of doing formatting & mounting steps?
The persistent disk is created with Terraform, which also creates a VM and attaches the disk to it with the attached_disk command.
I am hoping to run a simple script on the VM instance start that would:
- check if the attached disk is formatted, and format if needed with ext4
- check if the disk is mounted, and mount if not
- do nothing otherwise