Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions docs/USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2312,17 +2312,31 @@ The `VirtualMachineRestore` resource is used to restore a virtual machine from a
- VirtualMachine - the main VM resource with the configuration from the snapshot.
- VirtualDisk - disks connected to the VM at the moment of snapshot creation.
- VirtualBlockDeviceAttachment - disk connections to the VM (if they existed in the original configuration).
- VirtualMachineIPAddress — the IP address of the virtual machine (if the `keepIPAddress: Always` parameter was specified at the time of snapshot creation).
- Secret - secrets with cloud-init or sysprep settings (if they were involved in the original VM).

Important: resources are created only if they were present in the VM configuration at the time the snapshot was created. This ensures that an exact copy of the environment is restored, including all dependencies and settings.

#### Restore a virtual machine

There are two modes used for restoring a virtual machine. They are defined by the restoreMode parameter of the VirtualMachineRestore resource:
```yaml
spec:
restoreMode: Safe | Forced
```
`Safe` is used by default.

{{< alert level="warning">}}
To restore a virtual machine, you must delete its current configuration and all associated disks. This is because the restore process returns the virtual machine and its disks to the state that was fixed at the time the backup snapshot was created.
To restore a virtual machine in `Safe` mode, you must delete its current configuration and all associated disks. This is because the restoration process returns the virtual machine and its disks to the state recorded at the snapshot's creation time.
{{< /alert >}}

Example manifest for restoring a virtual machine from a snapshot:
The `Forced` mode is used to bring an already existing virtual machine to the state at the time of the snapshot.

{{< alert level="warning" >}}
`Forced` may disrupt the operation of the existing virtual machine because it will be stopped during restoration, and `VirtualDisks` and `VirtualMachineBlockDeviceAttachments` resources will be deleted for subsequent restoration.
{{< /alert >}}

Example manifest for restoring a virtual machine from a snapshot in `Safe` mode:

```yaml
d8 k apply -f - <<EOF
Expand All @@ -2331,6 +2345,7 @@ kind: VirtualMachineRestore
metadata:
name: <restore name>
spec:
restoreMode: Safe
virtualMachineSnapshotName: <virtual machine snapshot name>
EOF
```
Expand Down
Loading
Loading