GCP Convert Standard to SSD

How to convert Persistent Standard disk to SSD.

First create a snapshot of the disk.

gcloud compute disks snapshot your-server \
--snapshot-names manual-snapshot-disk-1 \
--project your-project \
--zone us-central1-c

Restore snapshot to SSD format.

gcloud compute disks create disk-1-ssd \
--source-snapshot manual-snapshot-disk-1 \
--project your-project \
--zone us-central1-a \
--type pd-ssd \
--size 10GB

Swap disks using GCP attach and detach.

AWS CLI Restore Object from S3 Glacier

How to restore an object from Amazon S3 Glacier via the AWS CLI.

aws s3api restore-object \
--bucket awsexamplebucket \
--key dir1/example.obj \
--restore-request '{"Days":25,"GlacierJobParameters":{"Tier":"Standard"}}'

GCP Restore

How to restore from GCP Snapshots. Let’s say you have an instance called webserver with 2 disks.

Restore from snapshots:

gcloud compute disks create webserver-boot-r \
--project=your-project \
--source-snapshot=webserver-boot-190616 \
--zone=us-central1-a
gcloud compute disks create webserver-data-r \
--project=your-project \
--source-snapshot=webserver-data-190616 \
--zone=us-central1-a

Stop instance. Detach and attach disks:

gcloud compute instances detach-disk webserver --disk=webserver-boot --zone us-central1-a
gcloud compute instances attach-disk webserver --disk=webserver-boot-r --zone us-central1-a --boot
gcloud compute instances detach-disk webserver --disk=webserver-data --zone us-central1-a
gcloud compute instances attach-disk webserver --disk=webserver-data-r --zone us-central1-a

Boot instance.