Reverting to a Snapshot in ASP using CLI

Last Updated : Nov 19, 2026 |
Prolog information
Caution:
Reverting to a snapshot requires shutting down the virtual machine, which causes a temporary interruption in service.
  1. Log in to the KVM host using SSH or the server console.
    ADDITIONAL INFORMATION:
    For example, ssh <USERNAME>@<KVM_HOST_IP>
  2. Run the following command to switch to root user:
    ADDITIONAL INFORMATION:
    sudo su -
  3. Run the following command to display all registered virtual machines and their states:
    ADDITIONAL INFORMATION:
    virsh list --all
    Note the name of the virtual machine you want to revert.
  4. Run the following command to check the state of the virtual machine:
    ADDITIONAL INFORMATION:
    virsh domstate <VM_Name>
  5. Optional: If the virtual machine state is running, run the following command to shut down the virtual machine:
    ADDITIONAL INFORMATION:
    virsh shutdown <VM_Name>
    Note:
    Wait until the virtual machine is shut down before you continue. The time required depends on the guest operating system and application services.
  6. Run the following command to verify that the virtual machine is shut down:
    ADDITIONAL INFORMATION:
    virsh domstate <VM_Name>
  7. Run the following command to list the snapshots for the virtual machine:
    ADDITIONAL INFORMATION:
    virsh snapshot-list <VM_Name>
    Note the name of the snapshot you want to revert to.
  8. Run the following command to revert the virtual machine to the snapshot:
    ADDITIONAL INFORMATION:
    virsh snapshot-revert <VM_Name> <Snapshot_Name>
    The following message appears: Domain snapshot <Snapshot_Name> reverted.
  9. Run the following command to start the virtual machine:
    ADDITIONAL INFORMATION:
    virsh start <VM_Name>
    When the virtual machine starts, following message appears: Domain <VM_Name> started