- go to the cloud console https://console.developers.google.com
- go to snapshots and click on 'New snapshot'
- select your source disk
- Take note of the Name field and click 'Create'
- go to disks click on 'New disk'
- flip Source Type to Snapshot
- make sure you define the zone matching where the instance is going to be hosted
- select source snapshot created at step 4
- take note of the Name field and click 'Create'
- delete your snapshot created at step 4
- go to the cloud console https://console.developers.google.com
- select your project and instance you will end up at a location like: console.developers.google.com/project/[project number]/compute/instancesDetail/zones/[zone name]/instances/[instance name]
- scrool down to the bottom of the page
- click on 'Equivalent REST'
- copy the JSON contents of the popup window
- go to https://developers.google.com/apis-explorer/#p/compute/v1/compute.instances.insert
- flip 'Authorize requests using OAuth 2.0' to ON in the top right corner
- in the top right corner of the 'Request body' field pull down the triangle menu and select the Freeform editor
- fill in the project and zone fields
- paste your JSON copied at step 5
- make sure you remove any orphan comas in JSON lists while you are doing the next step Example:
removing from natIP line requires to remove the , at the end of the name line
   {
      "kind": "compute#accessConfig",
      "type": "ONE_TO_ONE_NAT",
      "name": "External NAT",
      "natIP": "130.211.71.121"
    }
result should be
   {
      "kind": "compute#accessConfig",
      "type": "ONE_TO_ONE_NAT",
      "name": "External NAT"
    }
- remove the lines starting with the below key:
- id
- status
- creationTimestamp
- fingerprint (two of them)
- natIP
- networkIP
- selfLink
- deviceName
- $$hashKey
- change the name
- update disks / source to the disk cloned in section A step 9
- optionally edit any other options you wish to change
if you were not careful at step 11, you will get a response of:
400 Bad Request
- Show headers -
{ "error": { "errors": [ { "domain": "global", "reason": "parseError",
you can use a validator like below to get hints where you made the mistake http://jsonformatter.curiousconcept.com/
if everything went well you will receive:
Response
200 OK