22

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
Amy Neville
  • 10,067
  • 13
  • 58
  • 94
  • My reply is late but for another people see this question. Your solution is work probaly, i always do this way – Pham Lai Jul 11 '16 at 17:00

2 Answers2

28

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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Pritesh Mhatre
  • 3,847
  • 2
  • 23
  • 27
  • sudo sync has to be done BEFORE switching down the instance, right ?! ;) – tisc0 Jan 29 '20 at 11:00
  • 3
    There's absolutely no point in bothering with `sudo sync` before stopping the instance. – rustyx Jul 30 '21 at 10:29
  • Why it isn't required is that the OS shutdown in the instance( as part of stopping the instance) will flush all buffers to disk as part of the shutdown process. – Samveen Nov 18 '22 at 12:51
14

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.
Faizan
  • 1,937
  • 13
  • 18