Skip to main content

Rebuild VM

POST
/projects/:projectId/vms/:vmId/rebuild

Rebuilds 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

The rebuild request was accepted; the VM is being reinstalled in the background.