Rebuild VM
/projects/:projectId/vms/:vmId/rebuildRebuilds a virtual machine, reinstalling it from a specified image.
This operation is asynchronous and returns a pollable operation id. Poll
GET /v1/projects/{projectId}/operations/{operationId} using the returned
operationId until its status leaves InProgress. A new initial login password is
generated and returned in the response. If sshKeyIds is omitted or empty, the rebuilt VM has
no SSH keys (the previously bound keys are not carried over); otherwise the provided keys become the
effective set for the rebuilt VM. Set deleteBackups to also delete the VM's backups. Existing
port-forwarding rules are left unchanged: when the new image uses a different service port (for
example RDP 3389 vs SSH 22), update the relevant rule separately via the port-forwards endpoints.
Request
Responses
- 202
- 400
- 404
- 409
The rebuild request was accepted; the VM is being reinstalled in the background.
The request body failed validation.
The project, VM or image was not found.
Another operation is already in progress on this VM. Poll until it clears, then retry.