Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to SUSE Linux Enterprise Server 11 SP4

11 Save and Restore of Virtual Machines

11.1 Saving Virtual Machines

The save operation preserves the exact state of the virtual machine’s memory. The operation is slightly similar to hibernating a computer. The virtual machine is off, but it can be quickly restored to its previously saved running condition. The operation does not make a copy of any portion of the virtual machine’s virtual disk.

When saved, the virtual machine is paused, its current memory state saved to a location you specify, and then the virtual machine is stopped. The amount of time to save the virtual machine depends on the amount of memory allocated. When saved, a virtual machine’s memory is returned to the pool of memory available on the host.

The restore operation is used to return a saved virtual machine to its original running state.

Important
Important

After using the save operation, do not boot, start, or run a virtual machine that you intend to restore. If the virtual machine is at any time restarted before it is restored, the saved memory state file becomes invalid and should not be used to restore.

Procedure 11.1: Save a Virtual Machine’s Current State (Virtual Machine Manager)
  1. Make sure the virtual machine to be saved is running.

  2. Select the virtual machine.

  3. Click Open to view the virtual machine console, then Details to view virtual machine information.

  4. Select Virtual Machine › Shut Down › Save from the menu.

  5. Name and save the file.

Procedure 11.2: Save a Virtual Machine’s Current State (xm Command)
  1. Make sure the virtual machine to be saved is running.

  2. In the host environment, enter xm save ID state-file where ID is the virtual machine ID you want to save, and state-file is the name you specify for the memory state file.

11.2 Restoring Virtual Machines

The restore operation loads a virtual machine’s previously saved memory state file and starts the virtual machine. The virtual machine does not boot the operating system but resumes at the point that it was previously saved. The operation is slightly similar to coming out of hibernation.

Important
Important

After using the save operation, do not boot, start, or run the virtual machine you intend to restore. If the virtual machine is at any time restarted before it is restored, the saved memory state file becomes invalid and should not be used to restore.

Procedure 11.3: Restore a Virtual Machine’s Current State (Virtual Machine Manager)
  1. Make sure the virtual machine to be restored has not been started since you ran the save operation.

  2. Run the Virtual Machine Manager.

  3. Select the hypervisor and connection used to restore the virtual machine. On the local machine, this is localhost. Right-click it and choose Details from the context menu.

  4. In the Connection Details window, choose File › Restore Saved Machine from the drop-down menu.

  5. Specify the previously saved file.

  6. Click Open.

    The virtual machine and the guest operating system are restored to the previously saved state.

Procedure 11.4: Restore a Virtual Machine’s Current State (xm Command)
  1. Make sure the virtual machine to be restored has not been started since you ran the save operation.

  2. In the host environment, enter xm restore state-file where state-file is the previously saved memory state file.

11.3 Virtual Machine States

A virtual machine’s state can be displayed in Virtual Machine Manager or by viewing the results of the xm list command, which abbreviates the state using a single character.

  • r - running - The virtual machine is currently running and consuming allocated resources.

  • b - blocked - The virtual machine’s processor is not running and not able to run. It is either waiting for I/O or has stopped working.

  • p - paused - The virtual machine is paused. It does not interact with the hypervisor but still maintains its allocated resources, such as memory.

  • s - shutdown - The guest operating system is in the process of being shutdown, rebooted, or suspended, and the virtual machine is being stopped.

  • c - crashed - The virtual machine has crashed and is not running.

  • d - dying - The virtual machine is in the process of shutting down or crashing.

Print this page