Change Google Compute/Cloud Server to SSD Persiste

2020-06-03 00:49发布

问题:

I have a live production website running on a standard persistent disk.

How do I safely upgrade this to an SSD disk?

Is there a simple way to do it using the dashboard and not console commands?

Just to be clear, it's fine to take the instance down for 10 minutes or so.

Will this work?

  1. Snapshot Instance
  2. Clone Instance (using snapshot - create SSD drive)
  3. Move over static IP to clone.
  4. Check everything is working and eventually delete original instance

回答1:

OP has provided the steps in the question, posting an answer for users still looking for a solution:

  1. Create snapshot of the persistent disk.
  2. Create SSD disk from the snapshot.
  3. At this point you have two choices:
    1. Create a new instance with the SSD disk as a boot disk, unassign the static IP from old instance and attach it to the new instance. Once done delete the old instance. This will have has less or almost no downtime.
    2. Delete the old instance, create a new instance with SSD and assign the static IP. This will reduce the cost but will have downtime.


回答2:

The process for changing boot disk type of a Google Cloud VM is as follows:

  1. (Optional) Flush disk buffers sudo sync.
  2. Stop your instance
  3. Take a snapshot of existing disk
  4. Create a new persistent disk based on the snapshot. From the Type dropdown list, select "SSD persistent disk".
  5. Detach old boot disk & attach new SSD boot disk

For more details, visit docs

Note: there is NO NEED to delete your VM